New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: running eslint --init generates a .eslint.json file with parserOptions.ecmaversion set to 13 #15159
Comments
thanks for the report! 13 is an allowed value in eslint v8(but the docs was not updated somehow, should be fixed by #15162 ) you can:
|
This is also a bug in
This installs ESLint v7.32.0, and produces a config file that doesn't work with v7.32.0. {
"env": {
"commonjs": true,
"es2021": true,
"node": true
},
"extends": [
"standard"
],
"parserOptions": {
"ecmaVersion": 13
},
"rules": {
}
} |
well, it will be fixed in #15150, by setting ecmaVersion to "latest". 😄 |
Fix that has landed in latest version kinda missing |
@aladdin-add What is the status? I see that #15162 was merged but at least from VS Code the warning still continues. |
Update: rm eslint auto config refs: https://github.com/aladdin-add/rfcs/blob/bdc12aa062750d837e5a3bbbf2f6e5e3a98da388/designs/2021-init-command-eslint-cli/README.md#1-remove-eslint-auto-config Update: mv eslint --init to another package moved `lib/init/config-rule` to tools, as it is also used by some others refs: https://github.com/aladdin-add/rfcs/blob/bdc12aa062750d837e5a3bbbf2f6e5e3a98da388/designs/2021-init-command-eslint-cli/README.md#2-move-eslint---init-related-files-to-a-separate-repo chore: fix imports to make test passing todo: use the new eslint api fix: use the new eslint api (async) fix: remove espree from deps chore: fix a failing test fix: a failing test chore: cleanup TODOs fix: allow to use local-installed eslint wip: fix one-var chore: lib => esm chore: tests => esm todo: proxyquire => td chore: update deps to latest fix: should write a file through fs when a ${fileType} path is passed replaced proxyquire & sinon => td fix: should include a newline character at EOF chore: add testdouble --wip-- [skip ci] chore: remove package @eslint/create-eslint feat: update npm --init to run `npm init @eslint/config` docs: update getting-started Update README.md Update getting-started.md chore: rm init fixtures fix: `npm init @eslint/config` output chore: rm unused files chore: rm unused deps Update bin/eslint.js Co-authored-by: Brandon Mills <btmills@users.noreply.github.com> chore: fix typo
fixes eslint#14768, fixes eslint#15159 Update: rm eslint auto config refs: https://github.com/aladdin-add/rfcs/blob/bdc12aa062750d837e5a3bbbf2f6e5e3a98da388/designs/2021-init-command-eslint-cli/README.md#1-remove-eslint-auto-config Update: mv eslint --init to another package moved `lib/init/config-rule` to tools, as it is also used by some others refs: https://github.com/aladdin-add/rfcs/blob/bdc12aa062750d837e5a3bbbf2f6e5e3a98da388/designs/2021-init-command-eslint-cli/README.md#2-move-eslint---init-related-files-to-a-separate-repo chore: fix imports to make test passing todo: use the new eslint api fix: use the new eslint api (async) fix: remove espree from deps chore: fix a failing test fix: a failing test chore: cleanup TODOs fix: allow to use local-installed eslint wip: fix one-var chore: lib => esm chore: tests => esm todo: proxyquire => td chore: update deps to latest fix: should write a file through fs when a ${fileType} path is passed replaced proxyquire & sinon => td fix: should include a newline character at EOF chore: add testdouble --wip-- [skip ci] chore: remove package @eslint/create-eslint feat: update npm --init to run `npm init @eslint/config` docs: update getting-started Update README.md Update getting-started.md chore: rm init fixtures fix: `npm init @eslint/config` output chore: rm unused files chore: rm unused deps Update bin/eslint.js Co-authored-by: Brandon Mills <btmills@users.noreply.github.com> chore: fix typo
fixes eslint#14768, fixes eslint#15159 Update: rm eslint auto config refs: https://github.com/aladdin-add/rfcs/blob/bdc12aa062750d837e5a3bbbf2f6e5e3a98da388/designs/2021-init-command-eslint-cli/README.md#1-remove-eslint-auto-config Update: mv eslint --init to another package moved `lib/init/config-rule` to tools, as it is also used by some others refs: https://github.com/aladdin-add/rfcs/blob/bdc12aa062750d837e5a3bbbf2f6e5e3a98da388/designs/2021-init-command-eslint-cli/README.md#2-move-eslint---init-related-files-to-a-separate-repo chore: fix imports to make test passing todo: use the new eslint api fix: use the new eslint api (async) fix: remove espree from deps chore: fix a failing test fix: a failing test chore: cleanup TODOs fix: allow to use local-installed eslint wip: fix one-var chore: lib => esm chore: tests => esm todo: proxyquire => td chore: update deps to latest fix: should write a file through fs when a ${fileType} path is passed replaced proxyquire & sinon => td fix: should include a newline character at EOF chore: add testdouble --wip-- [skip ci] chore: remove package @eslint/create-eslint feat: update npm --init to run `npm init @eslint/config` docs: update getting-started Update README.md Update getting-started.md chore: rm init fixtures fix: `npm init @eslint/config` output chore: rm unused files chore: rm unused deps Update bin/eslint.js Co-authored-by: Brandon Mills <btmills@users.noreply.github.com> chore: fix typo
@aladdin-add From now on should we use |
yes, I think the issue has been fixed in the new package, and the docs will be updated in #15150 (likely to be merged soon). |
Environment
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
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 forparserOptions.ecmaVersion
are 3, 5 (default), 6, 7, 8, 9, 10, 11, or 12 .What actually happened?
npx eslint --init
generated an.eslintrc
file withparserOptions.ecmaVersion
set to 13.Participation
Additional comments
Would love to help if anything. Just not sure where to start.
The text was updated successfully, but these errors were encountered: