by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:24
    mdjermanovic labeled #13488
  • 13:24
    mdjermanovic labeled #13488
  • 13:24
    mdjermanovic opened #13488
  • 13:12

    mdjermanovic on changelog-linebreaks-v740

    Docs: fix linebreaks between ve… (compare)

  • 12:44
    mdjermanovic commented #13479
  • 09:31
    Moeriki synchronize #12611
  • 05:01
    uzagoranski closed #13480
  • 05:01
    uzagoranski commented #13480
  • 02:46
    wang12124468 commented #13479
  • 02:42
    wang12124468 commented #13479
  • 00:49
    mdjermanovic commented #13346
  • 00:47
    eslint[bot] commented #13304
  • 00:47
    eslint[bot] labeled #13304
  • 00:47
    eslint[bot] closed #13304
  • 00:47
    eslint[bot] commented #13389
  • 00:47
    eslint[bot] labeled #13389
  • 00:47
    eslint[bot] labeled #12683
  • 00:47
    eslint[bot] closed #13389
  • 00:47
    eslint[bot] locked #12683
  • 00:25
    mdjermanovic commented #13349
Carl Vitullo
@vcarl
any info about why that's recommended?
Roy Sutton
@webOS101
Because of the problems of having multiple different versions of plugins included from different configs and/or plugins.
Carl Vitullo
@vcarl

plugins will be loaded relative to the end user's project, so the end user is required to install the plugins they need

since they're being flattened (i see them in node_modules/<plugin name> i don't really understand why this would be breaking

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.