Environment
Environment Info:
Node version: v18.18.2
npm version: v9.8.1
Local ESLint version: v9.0.0 (Currently used)
Global ESLint version: Not found
Operating System: darwin 22.5.0
What parser are you using?
Default (Espree)
What did you do?
I initialized node.js project with:
I added index.js file with the following content:
I initialized eslint via npm init @eslint/config which generated the following .eslintrc.json (I added "no-unused-vars" rule):
{
"env": {
"browser": true,
"commonjs": true,
"es2021": true
},
"overrides": [],
"parserOptions": {
"ecmaVersion": "latest"
},
"rules": {
"no-unused-vars": "warn"
}
}
Then I tried to run npx eslint index.js which resulted in the following error:
Oops! Something went wrong! :(
ESLint: 9.0.0
Error: Could not find config file.
at locateConfigFileToUse (/Users/branislav/Documents/code/t/eslint-test/node_modules/eslint/lib/eslint/eslint.js:349:21)
at async calculateConfigArray (/Users/branislav/Documents/code/t/eslint-test/node_modules/eslint/lib/eslint/eslint.js:384:49)
at async ESLint.lintFiles (/Users/branislav/Documents/code/t/eslint-test/node_modules/eslint/lib/eslint/eslint.js:814:25)
at async Object.execute (/Users/branislav/Documents/code/t/eslint-test/node_modules/eslint/lib/cli.js:461:23)
at async main (/Users/branislav/Documents/code/t/eslint-test/node_modules/eslint/bin/eslint.js:165:22)
Downgrading the eslint to 8.57.0 fixes the issue - running the npx eslint index.js gives:
1:7 warning 'a' is assigned a value but never used no-unused-vars
✖ 1 problem (0 errors, 1 warning)
What did you expect to happen?
Running eslint should not error out.
What actually happened?
Running eslint returned the following error:
Oops! Something went wrong! :(
ESLint: 9.0.0
Error: Could not find config file.
at locateConfigFileToUse (/Users/branislav/Documents/code/t/eslint-test/node_modules/eslint/lib/eslint/eslint.js:349:21)
at async calculateConfigArray (/Users/branislav/Documents/code/t/eslint-test/node_modules/eslint/lib/eslint/eslint.js:384:49)
at async ESLint.lintFiles (/Users/branislav/Documents/code/t/eslint-test/node_modules/eslint/lib/eslint/eslint.js:814:25)
at async Object.execute (/Users/branislav/Documents/code/t/eslint-test/node_modules/eslint/lib/cli.js:461:23)
at async main (/Users/branislav/Documents/code/t/eslint-test/node_modules/eslint/bin/eslint.js:165:22)
Link to Minimal Reproducible Example
https://github.com/branislavbrincko/eslint-test
Participation
Additional comments
No response
Environment
Environment Info:
Node version: v18.18.2
npm version: v9.8.1
Local ESLint version: v9.0.0 (Currently used)
Global ESLint version: Not found
Operating System: darwin 22.5.0
What parser are you using?
Default (Espree)
What did you do?
I initialized
node.jsproject with:I added
index.jsfile with the following content:I initialized
eslintvianpm init @eslint/configwhich generated the following.eslintrc.json(I added"no-unused-vars"rule):{ "env": { "browser": true, "commonjs": true, "es2021": true }, "overrides": [], "parserOptions": { "ecmaVersion": "latest" }, "rules": { "no-unused-vars": "warn" } }Then I tried to run
npx eslint index.jswhich resulted in the following error:Downgrading the
eslintto8.57.0fixes the issue - running thenpx eslint index.jsgives:1:7 warning 'a' is assigned a value but never used no-unused-vars ✖ 1 problem (0 errors, 1 warning)What did you expect to happen?
Running
eslintshould not error out.What actually happened?
Running
eslintreturned the following error:Link to Minimal Reproducible Example
https://github.com/branislavbrincko/eslint-test
Participation
Additional comments
No response