Bug: running eslint --init generates a .eslint.json file with parserOptions.ecmaversion set to 13
See original GitHub issueEnvironment
Node version: v14.17.5 npm version: 6.14.14 Local ESLint version: 7.32.0 Global ESLint version: – Operating System: Ubuntu Linux
What parser are you using?
Default (Espree)
What did you do?
Configuration
{
"env": {
"commonjs": true,
"es2021": true,
"node": true
},
"extends": [
"standard"
],
"parserOptions": {
"ecmaVersion": 13
},
"rules": {
}
}
function hello() {
console.log('hello')
}
Configuration is result from running npx eslint --init
after installing eslint locally in an empty project.
Eslint shows an error at the first line of function shown saying Parsing error: Invalid ecmaVersion.
What did you expect to happen?
When running npx eslint --init
I expect that it generates an .eslintrc
file with valid options. According to documentation, supported options for parserOptions.ecmaVersion
are 3, 5 (default), 6, 7, 8, 9, 10, 11, or 12 .
What actually happened?
npx eslint --init
generated an .eslintrc
file with parserOptions.ecmaVersion
set to 13.
Participation
- I am willing to submit a pull request for this issue.
Additional comments
Would love to help if anything. Just not sure where to start.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Language Options - ESLint - Pluggable JavaScript Linter
Parser options are set in your .eslintrc.* file with the parserOptions property. The available options are: ecmaVersion - set to 3, 5 (default) ......
Read more >ESLint - Error: Must use import to load ES Module
eslintrc, add "requireConfigFile": false, to the parserOptions section (underneath "ecmaVersion": 8, ) (I needed this or babel was looking for ...
Read more >Basic Features: ESLint - Next.js
js will automatically install eslint and eslint-config-next as development dependencies in your application and create an .eslintrc.json file in the root of ...
Read more >parseroptions.project has been set for @typescript-eslint/parser
Create a new tsconfig.eslint.json Add .eslintrc in .eslintignore Ensure that ... been set for @typescript-eslint/parser” arises when ESLint runs into a file ......
Read more >eslint/eslint - Gitter
Hello, any idea why I'm getting an invalid ecmaVersion when setting to 2020 ... 20 seconds to lint all our ~1.5k files. eslint...
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
yes, I think the issue has been fixed in the new package, and the docs will be updated in https://github.com/eslint/eslint/pull/15150 (likely to be merged soon).
@vicasas we are working on a new cli
@eslint/create-config
to replaceeslint --init
. it will be fixed in the new repo, please follow https://github.com/eslint/eslint/issues/14768 .