New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot override rule in shared config #4079
Comments
Can you provide a code that is failing and also specify what did you expect to happen? |
@ilyavolodin Sure, sorry. The code is simply:
The documentation for the indent rule (http://eslint.org/docs/rules/indent.html) says the default is 4 spaces and gives the example I've changed my .eslintrc to the following, specifying a number of spaces, and it works now:
Perhaps the default space setting for indentation is overridden elsewhere and I'm not aware of it or haven't found it. |
Do you know what is the config of indent rule inside your extended config (airbnb)? |
It's Maybe the docs need to be updated eslint/tests/lib/config-initializer.js Line 35 in abe3669
|
Yes, the airbnb config has |
This is the expected behavior. If you just change the error level then we do inherit the options from the extended config. |
Thanks, @gyandeeps. The only mention of overriding extended configs that I found was on http://eslint.org/docs/developer-guide/shareable-configs.html, and it only says, "You can override settings from the shareable config by adding them directly into your .eslintrc file." |
It's mentioned on the primary configuration documentation: http://eslint.org/docs/user-guide/configuring#extending-configuration-files |
This behavior still seems confusing to me, and (as far as I understand it) makes it impossible to override certain rule options (see #6144). Also, @nzakas, I don't see anywhere in the docs where it explains that rule options will be inherited from extended configs, just that rules can be overridden in the child configs. I was lead to believe that if you specified a rule in a child config, it would completely negate any rules of the same name in extended configs, resorting back to that rule's default options if none are specified. |
@nzakas Can you give us a response to what @danny-andrews brought up? It is very confusing. |
ESLint v1.6.0
In my .eslintrc, I'm extending the AirBnb config and overriding a rule like this:
I couldn't find an example elsewhere, but eslint-config-airbnb v0.1.0 is overriding a rule the same way in its .eslintrc file so I assume what I have is correct. However, I'm seeing the following output when I run
eslint scripts/**
:The text was updated successfully, but these errors were encountered: