eslint throws exception when no configuration file found.
See original GitHub issueWhen no configuration file is present, eslint prints an exception backtrace to the console and returns an exit status of 1
. This throws a spanner in the works of automated syntax checkers like flycheck as seen here.
$ echo 'var x = "y";' | eslint --stdin
No ESLint configuration found.
Error: No ESLint configuration found.
at getLocalConfig (/Users/cowboyd/.nvm/versions/node/v4.2.3/lib/node_modules/eslint/lib/config.js:162:35)
at Config.getConfig (/Users/cowboyd/.nvm/versions/node/v4.2.3/lib/node_modules/eslint/lib/config.js:256:22)
at processText (/Users/cowboyd/.nvm/versions/node/v4.2.3/lib/node_modules/eslint/lib/cli-engine.js:222:33)
at CLIEngine.executeOnText (/Users/cowboyd/.nvm/versions/node/v4.2.3/lib/node_modules/eslint/lib/cli-engine.js:749:26)
at Object.execute (/Users/cowboyd/.nvm/versions/node/v4.2.3/lib/node_modules/eslint/lib/cli.js:174:42)
at /Users/cowboyd/.nvm/versions/node/v4.2.3/lib/node_modules/eslint/bin/eslint.js:57:36
at ConcatStream.<anonymous> (/Users/cowboyd/.nvm/versions/node/v4.2.3/lib/node_modules/eslint/node_modules/concat-stream/index.js:36:43)
at emitNone (events.js:72:20)
at ConcatStream.emit (events.js:166:7)
at finishMaybe (/Users/cowboyd/.nvm/versions/node/v4.2.3/lib/node_modules/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:475:14)
One possible solution would be to make this a warning not an error, or also to have an option to suppress the error / warning. e.g. eslint --no-configuration-ok
Environment
> eslint "--version"
>v3.5.0
> node -v
> v4.2.3
> npm -v
Issue Analytics
- State:
- Created 7 years ago
- Comments:33 (18 by maintainers)
Top Results From Across the Web
"No ESLint configuration found" error - Stack Overflow
I had eslint.rc file in my root project directory but event though I was getting error. Solution was to add exclude property to...
Read more >eslint throws exception when no configuration file found.
When no configuration file is present, eslint prints an exception backtrace to the console and returns an exit status of 1 . This...
Read more >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 >no-console - ESLint - Pluggable JavaScript Linter
This rule disallows calls or assignments to methods of the console object. Examples of incorrect code for this rule: /* eslint no-console: "error"...
Read more >no-unreachable - ESLint - Pluggable JavaScript Linter
The "extends": "eslint:recommended" property in a configuration file enables this rule ... console.log("done"); } function bar() { throw new Error("Oops!
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
Actually, having
--check-config
or '–show-config-location` option in ESLint that prints location of configuration file of showing notice that there is no configuration is best solution to this problem. In the case that there is configuration, we can still be using ESLint as default JS checker in Emacs and keep ESLint as first JS checker. If there is no configuration we know that using ESLint can not be used. In that case we can fallback to JSHint or something else.@platinumazure, is implementing this an option for ESLint team?
Nope, it seems like we’ve resolved what we can resolve.