by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 21:51
    mdjermanovic commented #12334
  • 21:41

    mdjermanovic on master

    Update: Improve report location… (compare)

  • 21:41

    mdjermanovic on noirregularwhitespace-loc

    (compare)

  • 21:41
    mdjermanovic closed #13462
  • 21:34

    mdjermanovic on master

    Build: update webpack resolve.m… (compare)

  • 21:34

    mdjermanovic on webpack-resolve-browser

    (compare)

  • 21:34
    mdjermanovic closed #13457
  • 21:09
    mdjermanovic commented #13179
  • 19:24
    dimitropoulos synchronize #13465
  • 16:06

    mdjermanovic on master

    Fix: arrow-body-style fixer for… (compare)

  • 16:06
    mdjermanovic closed #13228
  • 16:05
    mdjermanovic closed #11849
  • 15:41
    mdjermanovic unlabeled #13465
  • 15:41
    mdjermanovic labeled #13465
  • 15:41
    mdjermanovic commented #13465
  • 15:35
    mdjermanovic commented #13465
  • 13:55
    dimitropoulos commented #13465
  • 13:55
    dimitropoulos synchronize #13465
  • 13:50
    dimitropoulos synchronize #13465
  • 13:28
    anikethsaha review_requested #13179
Carl Vitullo
@vcarl

it's not a monorepo or anything, i've just got

module.exports = {
  extends: ["@stellar/eslint-config"],
  rules: {
    "import/no-unresolved": 0,
  },
};

in .eslintrc.js locally. gatsby site

Roy Sutton
@webOS101
You can try passing the command line argument that sets where to find the plugins. Or, as you say, install the deps into the project.
I don’t believe it’s recommended for a config to have plugins as dependencies, but instead to have them as peer dependencies.
Carl Vitullo
@vcarl
they used to be peer deps, but it's annoying to have to install like 8 things to get a shared config working
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?