extends is kind of mysterious
#20126
Unanswered
s-h-a-d-o-w
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I just wanted to publish a default config to npmjs but it's unclear to me how to actually use it.
In the docs, it says "Configs are merged from first to last, with later entries overriding earlier ones." and "Only some properties can be extended. The supported properties are: rules, plugins, overrides"
I used an otherwise empty extension file and the following plugin config in the base:
Both configs resulted in running the same number of rules. Makes sense. Or does it? Because if only
rules, plugins, overridesis merged with the parent,categoriesconfig should be empty for the extended config, reverting to default.But then... I don't use e.g. react and nextjs everywhere, so I figured I'd try using an empty plugins array as the base and then only
eslintin the extension. Still the same number of rules for both. How can that be? Is it because eslint is part of the default set and when empty, the default set is used too?So I changed
eslinttoimportin the extension file, which isn't part of the default set. Still the same number of rules for both.Then I removed the plugins array in the extension file. Base config still has an empty plugins array. Base now runs 97 rules, extension 252. Where do those additional rules come from?
Beta Was this translation helpful? Give feedback.
All reactions