question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ESLint using config file from the directory above

See original GitHub issue

What 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.

  1. I copied .eslintrc the the upper dir (mv .eslintrc …). This eslintrc had some rules that I didn’t intend to use anymore (obsolete).
  2. I removed or cleaned-up the eslintrc in the projects dir.
  3. 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:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
platinumazurecommented, Jul 8, 2016

Well, that’s why we recommend "root": true in project configuration files as a best practice.

0reactions
platinumazurecommented, Jul 8, 2016

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found