ESLint using config file from the directory above
See original GitHub issueWhat version of ESLint are you using? 3.0.1, 2.9.0 What parser (default, Babel-ESLint, etc.) are you using? babel-eslint Please show your full configuration: None or as empty as possible:
{ "parser" : "babel-eslint", "env" : { "browser" : true }, "globals" : { "Action" : false, "__DEV__" : false, "__PROD__" : false, "__DEBUG__" : false, "__BASENAME__" : false }, "rules": { } }
What did you do? Please include the actual source code causing the issue.
- I copied .eslintrc the the upper dir (mv .eslintrc …). This eslintrc had some rules that I didn’t intend to use anymore (obsolete).
- I removed or cleaned-up the eslintrc in the projects dir.
- I run either
./node_modules/.bin/eslint .
or npm run lint (which is running:eslint .
) (I do not have global eslint installed (or anything else than npm).) What did you expect to happen? I expected eslint to go lint the files without any rules. What actually happened? Please include the actual, raw output from ESLint. ESLint used the eslintrc from upper directory. Basically if you have such structure: ~/projects/project1 and you put a file .eslintrc in ~/projects, then if you run eslint in ~/projects/project1 , then it’ll use the file from upper dir. It is also valid if you have also additional projects there: ~/projects/project2 ~/projects/project3
They’d be all affected by this “common” file.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 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 >Configuration Files (New) - 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 >Configuring ESLint - ESLint - Pluggable JavaScript Linter
Configuration Files - use a JavaScript, JSON, or YAML file to specify configuration information for an entire directory and all of its subdirectories....
Read more >Ignoring Code - 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 1: Background
eslintrc file. When a file was linted, ESLint would first look in the same directory as that file for a .eslintrc file and...
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 Free
Top 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
Well, that’s why we recommend
"root": true
in project configuration files as a best practice.Glad to help @Muniek. Incidentally, if you haven’t had a chance to read the ESLint documentation, you might find it pretty helpful, especially this section on Configuration Cascading and Hierarchy. Hopefully that will help everything to make more sense.
Closing this issue for now-- please reopen if I haven’t answered all your questions, or feel free to stop by our chat room if you need help with anything else.