Overriding a rule doesn't reset options, unless you pass an empty object #6955
Labels
archived due to age
This issue has been archived; please open a new issue for any further discussion
triage
An ESLint team member will look at this issue soon
What version of ESLint are you using?
3.3.1
What parser (default, Babel-ESLint, etc.) are you using?
babel-eslint
Please show your full configuration:
What did you do? Please include the actual source code causing the issue.
I added
import/no-extraneous-dependencies: 2
to my config.What did you expect to happen?
I thought this would override the default setting from airbnb, which is
[2, { devDependencies: false }]
.I assumed my
2
would receive the default options, which includedevDependencies: true
.What actually happened? Please include the actual, raw output from ESLint.
Instead, the original options from the eslint-config-airbnb were retained. ESLint behaved as if I had set
devDependencies: false
.I found it's necessary to pass an empty object just to get the defaults back:
Notes
I guess it might be by design, but I think it's very surprising that
2
behaves completely differently from[2, {}]
.Before I worked out the root cause, I posted this issue on eslint-plugin-import, and a few people commented saying they'd had exactly the same problem. So it seems like a lot of people are confused by this behaviour.
The text was updated successfully, but these errors were encountered: