Skip to content
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

Bug: ~/.eslintrc being taken into account for rules not defined in rc/.eslintrc #32

Closed
Flet opened this issue Feb 7, 2015 · 2 comments

Comments

@Flet
Copy link
Member

Flet commented Feb 7, 2015

To reproduce, create a ~/.eslintrc file with this in it:

{
  "rules": {
    "no-var": 2
  }
}

Next, checkout the latest copy of standard and run npm test. You'll see many errors and the test will fail. This seems to be a feature of eslint: http://eslint.org/docs/configuring/#configuration-cascading-and-hierarchy

Note that this only affects rules that are not yet defined in rc/.eslintrc due to the layering/cascading nature. I see two possible solutions:

  • define every rule in rc/.eslintrc to stop the possibility of cascading
  • figure out a way to explicitly turn off the cascading feature when calling eslint.

Maybe @nzakas knows if there is a flag to stop this behavior? I did not see one in the command line options or on the linked configuration page.

The only workaround for users would be to remove any .eslintrc files from their directory hierarchy, which is probably not acceptable.

@feross
Copy link
Member

feross commented Feb 9, 2015

I went ahead and defined every rule, for completeness. Looks like the --no-eslintrc option would have done the trick too.

Released as 2.5.0.

@feross feross closed this as completed Feb 9, 2015
feross added a commit that referenced this issue Feb 9, 2015
@Flet
Copy link
Member Author

Flet commented Feb 9, 2015

Ah cool totally missed that option! Assuming this also disables package.json stuff too? Will investigate myself :)

@lock lock bot locked as resolved and limited conversation to collaborators May 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants