Error `Environment key "es2021" is unknown` or `0:0 error Parsing error: Invalid ecmaVersion`
See original GitHub issueTell us about your environment
Node version: v12.20.1 npm version: v6.14.11 Local ESLint version: v7.18.0
What parser (default, @babel/eslint-parser
, @typescript-eslint/parser
, etc.) are you using?
default
Please show your full configuration:
Configuration
module.exports = {
env: {
commonjs: true,
es2021: true,
node: true,
},
extends: 'eslint:recommended',
parserOptions: {
ecmaVersion: 12,
},
rules: {},
};
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
eslint ./file.js
What did you expect to happen? File should be linted.
What actually happened? Please include the actual, raw output from ESLint.
Error Environment key "es2021" is unknown
or 0:0 error Parsing error: Invalid ecmaVersion
if i remove the key.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Environment key "es2021" is unknown - Stack Overflow
After I've got the error Parsing error: Invalid ecmaVersion I've changed "ecmaVersion": 12 , into "ecmaVersion": 11 ,; And the last one I've ......
Read more >Language Options - ESLint - Pluggable JavaScript Linter
An environment provides predefined global variables. ... ECMAScript 2020 globals and automatically sets the ecmaVersion parser option to 11. es2021 - adds ...
Read more >ESLint | WebStorm Documentation - JetBrains
WebStorm shows warnings and errors reported by ESLint right in the editor, as you type. With ESLint, you can also use JavaScript Standard ......
Read more >eslint | Yarn - Package Manager
A bug fix in a rule that results in ESLint reporting fewer linting errors. A bug fix to the CLI or core (including...
Read more >parsing error: 'const declarations' require an initialization ...
/home/user/project/test.ts 0:0 error Parsing error: Invalid value for lib provided: es2021 ✖ 1 problem (1 error, 0 warnings). Additional Info.
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
It worked! Thank you so much for the fast response 😃
Closing this issue as it looks like the question has been answered. If you still need help, please send a message to our mailing list or chatroom. Thanks!