by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 11:07
    mysticatea synchronize #13416
  • 11:07

    mysticatea on optional-chaining

    update prefer-arrow-callback (compare)

  • 10:40
    mysticatea synchronize #13416
  • 10:40

    mysticatea on optional-chaining

    update wrap-iife (compare)

  • 10:12
    mysticatea synchronize #13416
  • 10:12

    mysticatea on optional-chaining

    update new-cap (compare)

  • 10:03
    mysticatea synchronize #13416
  • 10:03

    mysticatea on optional-chaining

    update a comment in no-implicit… update comments in no-extra-bind remove unnecessary change from … and 1 more (compare)

  • 00:47
    eslint[bot] labeled #12619
  • 00:47
    eslint[bot] labeled #12633
  • 00:47
    eslint[bot] commented #13364
  • 00:47
    eslint[bot] locked #12633
  • 00:47
    eslint[bot] labeled #13364
  • 00:47
    eslint[bot] labeled #12732
  • 00:47
    eslint[bot] closed #13364
  • 00:47
    eslint[bot] locked #12732
  • Jul 01 12:57
    nickdeis commented #13450
  • Jul 01 12:34
    mdjermanovic labeled #13451
  • Jul 01 12:34
    mdjermanovic labeled #13451
  • Jul 01 12:34
    mdjermanovic opened #13451
Carl Vitullo
@vcarl
ah, no, i guess that's only the ones that i installed while debugging
well that significantly diminishes the value of sharing a config for me, but i guess i have my fix
Roy Sutton
@webOS101
They might be flattened, but that behavior from npm isn’t guaranteed. What if I use your config and a config Joe made and you required v2 of eslint-plugin-baz and Joe required v1 of eslint-plugin-baz… Which version would be affected if I try to set a baz rule in my config?
Also, which version of that plugin gets put into the root of node_modules might vary (I’m not sure how it decides).
Carl Vitullo
@vcarl
i haven't thought that deeply, but for me half the value of sharing a config was to simplify new project setup. if i still have to gather together every plugin needed, then that's functionally the same as using a custom config in the first place and documenting what plugins i used last time
Roy Sutton
@webOS101
Can’t argue you with you about that.
Carl Vitullo
@vcarl
our workflow before setting up this package was to copy the list of deps needed + the .eslintrc.js. now, it's the same, but with 1 more package and slightly fewer items in the eslint config
just venting though. burned a bit of time hunting this down
Roy Sutton
@webOS101
The shared config does still make it easier to share updates to rules, but I hear you.
Robert Kieffer
@broofa
Hi all, quick ? about extends. I have a shareable config file "eslint-config-myconfig.js" inside a private module "@foo/common". I've npm linked the private module into my project, and am trying to include it with "extends": "@foo/common/eslint-config-myconfig". Sadly, eslint is saying it can't find the config file. So... what am I doing wrong?
Jordan Harband
@ljharb
a shared config in a package generally has to be the "main" of the package
(i believe)
i think if you want anything else to be a config you need to use a plugin as the vehicle, not a shared config
(i could be wrong here)
rouxfeur
@rouxfeur
Hi, I wanted to use “prettier-eslint”, but the eslint part doesn’t work. So I want to try doing it myself. What they seem to do is that they suppress all un-fixable rules and then run eslint. The closest command I could find was eslint —fix —quiet, which I think just suppresses (some) messages, not actual checking?
What do I do if all I want is for eslint to format my code?
What I am trying to do, is to run prettier on save and eslint —fix right after, to apply some styling that diverges from prettier.
Roy Sutton
@webOS101
I don’t use prettier myself, but can’t you just change prettier to apply the styling you want and just use eslint for non-stylistic warnings?
Having two tools fight over the formatting seems like a bad idea.
Kai Cataldo
@kaicataldo
Prettier has some excellent documentation around using Prettier and ESLint here https://prettier.io/docs/en/integrating-with-linters.html
rouxfeur
@rouxfeur
@ Roy: no, prettier is opinionated and they favor less configuration.
Roy Sutton
@webOS101
Bummer, I’m opinionated, too, and was hoping to use prettier at some point. ;P
Jordan Harband
@ljharb
if you want to run prettier (you don't have to, of course), then you should only run it via eslint, using eslint-config-prettier to disable conflicting rules, and eslint-plugin-prettier to format
Kai Cataldo
@kaicataldo
I think there's a misunderstanding here - what @webOS101 suggested is really the only way to use Prettier and ESLint simultaneously
Jordan Harband
@ljharb
i don't think prettier-eslint is even maintained anymore
rouxfeur
@rouxfeur
@ Kai: The actually is about how to suppress other eslint rules and in favor of prettier.
Jordan Harband
@ljharb
@rouxfeur you do that by extending eslint-config-prettier
Kai Cataldo
@kaicataldo
Yes, please see the link above. There's an eslint config for that
rouxfeur
@rouxfeur
Yes, I know about eslint-config-prettier, which suppresses eslint rules in favor of prettier. What I’m looking for is what prettier-eslint is doing.
It’s the opposite - override some prettier styles.
Jordan Harband
@ljharb
@rouxfeur i've tried it, and it doesn't work well, and prettier-eslint is unmaintained. so i'd suggest either accepting prettier's limited configuration, or abandoning prettier entirely and pursuing regular eslint rules for the things you're missing
Kai Cataldo
@kaicataldo
Sounds like you don't want to use Prettier :P
FWIW, you can use ESLint's autofixing feature for more flexibility
The beauty of Prettier is its opinionated nature. I like using it because it eliminates most discussions around style :)
Jordan Harband
@ljharb
meh, "beauty"
using a shared eslint config like airbnb's or similar achieves the same goal
Kai Cataldo
@kaicataldo
For sure
To each their own
rouxfeur
@rouxfeur
Ok, but no matter if I use prettier && eslint or just eslint, I think my original questions is still relevant: What do I do if all I want is for eslint to format my code? As fast as possible, without it having to check all the rules that it cant automatically fix.
Kai Cataldo
@kaicataldo
ESLint has autofixing built in - you can run eslint --fix and it will autofix for you
Jordan Harband
@ljharb
there's not currently a way to do like eslint --only-fix
so if all you want is to lint autofixable rules, i think you have to just "not enable" rules that aren't autofixable
rouxfeur
@rouxfeur
Oh ok. And does —quiet makes any difference or it is just about logging?
Jordan Harband
@ljharb
--quiet suppresses things set to "warn"
rouxfeur
@rouxfeur
I see. Thank you!
Jordan Harband
@ljharb
(but warnings don't fail the build, so it's not really a viable approach to set all non-autofixable to warn, in case that's what you're thinking)
rouxfeur
@rouxfeur
I was actually thinking about it haha 😄 but yeah, I agree. I think I’ll just run prettier —write && eslint —fix on save for a few days and will see.
Roy Sutton
@webOS101
You can always force a failure on build with --max-warnings 0. I don’t know whether that will also fail on fixable warnings or only unfixable ones, though.
(If you also wanted to be fixing at build time)
Kevin Partington
@platinumazure

@webOS101 --max-warnings only takes into account warnings left after autofix.

In practice this means non-autofixable warnings, although it could also happen if one rule's autofix causes a violation in another rule, and that rule's autofix causes a violation in another rule, etc. (in such a way that there is a cycle/loop). ESLint bails out after 10 autofix attempts, so in that degenerate case, an autofixable rule could fix and still leave a warning (on the 10th pass).