Skip to content
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

ESLint Error: Environment key "es2021" is unknown #83

Open
huan opened this issue Sep 18, 2021 · 3 comments
Open

ESLint Error: Environment key "es2021" is unknown #83

huan opened this issue Sep 18, 2021 · 3 comments

Comments

@huan
Copy link
Member

huan commented Sep 18, 2021

Related to

ESLint error log

[Error - 12:07:00 PM] ESLint stack trace:
[Error - 12:07:00 PM] Error: .eslintrc.cjs » @chatie/eslint-config » eslint-config-standard:
	Environment key "es2021" is unknown

    at /Users/huan/git/huan/ducks/node_modules/eslint/lib/shared/config-validator.js:169:19
    at Array.forEach (<anonymous>)
    at validateEnvironment (/Users/huan/git/huan/ducks/node_modules/eslint/lib/shared/config-validator.js:163:30)
    at validateConfigArray (/Users/huan/git/huan/ducks/node_modules/eslint/lib/shared/config-validator.js:334:9)
    at CascadingConfigArrayFactory._finalizeConfigArray (/Users/huan/git/huan/ducks/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:417:13)
    at CascadingConfigArrayFactory.getConfigArrayForFile (/Users/huan/git/huan/ducks/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:271:21)
    at CLIEngine.isPathIgnored (/Users/huan/git/huan/ducks/node_modules/eslint/lib/cli-engine/cli-engine.js:951:18)
    at CLIEngine.executeOnText (/Users/huan/git/huan/ducks/node_modules/eslint/lib/cli-engine/cli-engine.js:868:38)
    at _e.lintText (/Users/huan/.vscode/extensions/dbaeumer.vscode-eslint-2.1.25/server/out/eslintServer.js:1:177327)
    at /Users/huan/.vscode/extensions/dbaeumer.vscode-eslint-2.1.25/server/out/eslintServer.js:1:171074

NPM versions

ducks@0.11.1 /Users/huan/git/huan/ducks
└─┬ @chatie/eslint-config@0.14.1
  ├─┬ @typescript-eslint/eslint-plugin-tslint@4.31.1
  │ ├─┬ @typescript-eslint/experimental-utils@4.31.1
  │ │ ├─┬ eslint-utils@3.0.0
  │ │ │ └── eslint@7.32.0 deduped
  │ │ └── eslint@7.32.0 deduped
  │ └── eslint@7.32.0 deduped
  ├─┬ @typescript-eslint/eslint-plugin@4.31.1
  │ └── eslint@7.32.0 deduped
  ├─┬ @typescript-eslint/parser@4.31.1
  │ └── eslint@7.32.0 deduped
  ├─┬ babel-eslint@10.1.0
  │ └── eslint@7.32.0 deduped
  ├─┬ eslint-config-standard@16.0.3
  │ └── eslint@7.32.0 deduped
  ├─┬ eslint-plugin-import@2.24.2
  │ └── eslint@7.32.0 deduped
  ├─┬ eslint-plugin-node@11.1.0
  │ ├─┬ eslint-plugin-es@3.0.1
  │ │ └── eslint@7.32.0 deduped
  │ └── eslint@7.32.0 deduped
  ├─┬ eslint-plugin-promise@5.1.0
  │ └── eslint@7.32.0 deduped
  ├─┬ eslint-plugin-standard@5.0.0
  │ └── eslint@7.32.0 deduped
  └── eslint@7.32.0

✔ ~/git/huan/ducks [esm ↑·5|✚ 8] 
12:06 $ npx eslint --version
v7.32.0
✔ ~/git/huan/ducks [esm ↑·5|✚ 8] 
12:09 $ npm ls eslint-config-standard
ducks@0.11.1 /Users/huan/git/huan/ducks
└─┬ @chatie/eslint-config@0.14.1
  └── eslint-config-standard@16.0.3

✔ ~/git/huan/ducks [esm ↑·5|✚ 8] 
12:09 $ eslint --version
bash: eslint: command not found
✘-127 ~/git/huan/ducks [esm ↑·5|✚ 8] 
12:09 $ esli^C
✘-INT ~/git/huan/ducks [esm ↑·5|✚ 8] 
12:09 $ npx eslint --version
v7.32.0
✔ ~/git/huan/ducks [esm ↑·5|✚ 8] 
12:09 $ eslint --version
bash: eslint: command not found

Reproducible repo

https://github.com/huan/ducks

BTW: the above error only shows in vscode, but I can run eslint without any problem in command line.

@sarai2525
Copy link

same here

@jandppw
Copy link

jandppw commented May 4, 2022

For future reference, in my case, prettier-standard turned out to be the culprit. It is was behind standard, nowadays.

@mahanandyadav
Copy link

i also run into this issue.

it seems it is related to global and local installation of eslint .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants