ESLint looks for .eslintrc.* files even when `-c` flag is used
See original GitHub issueTell us about your environment
- ESLint Version: master
- Node Version: 8.8.0
- npm Version: 5.4.2
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
Configuration
# foo.yml
rules:
semi: 2
# .eslintrc.yml
rules:
no-console: 2
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
console.log('foo');
eslint -c foo.yml foo.js
What did you expect to happen?
I expected no errors to be reported, because I used the -c
flag to specify a config, so I did not expect ESLint to also look for other config files in the filesystem.
What actually happened? Please include the actual, raw output from ESLint.
1:1 error Unexpected console statement no-console
In addition to the config file specified with -c
, ESLint also looked for .eslintrc
files in the current directory, so the no-console
rule was enabled.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Configuration Files - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Command Line Interface - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >ESLint's new config system, Part 2: Introduction to flat config
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Configuring ESLint - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Working with Rules - ESLint - Pluggable JavaScript Linter
Here is the basic format of the source file for a rule: /** * @fileoverview Rule to disallow unnecessary semicolons * @author Nicholas...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, it seems like this is working as designed, so I’ll update it to be a documentation issue. I think we should document more clearly that
-c
still causes ESLint to look for other config files.I dont think its a bug, it was designed this way. You have to use
--no-eslintrc
option to disable that feature. So-c
and--no-eslintrc
are individual options. Thats why your nested.eslintrc
files (like in test folder) will respected even when you supply a config file using-c
flag.root: true
is used inside.eslintrc
files to stop the traversal lookup of.eslintrc
files up in the hierarchy chain.