question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error `Environment key "es2021" is unknown` or `0:0 error Parsing error: Invalid ecmaVersion`

See original GitHub issue

Tell 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:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
luisfelipesdn12commented, Jan 29, 2021

@aladdin-add so your local-installed eslint is v5.16.0; please upgrade eslint to latest, and retry.

It worked! Thank you so much for the fast response 😃

0reactions
aladdin-addcommented, Jan 29, 2021

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found