Chatie / eslint-config

ESLint Sharable Rules in TypeScript for Chatie Standard Style
https://npmjs.com/package/@chatie/eslint-config
Apache License 2.0
1 stars 0 forks source link

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

Open huan opened 3 years ago

huan commented 3 years ago

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 commented 2 years ago

same here

jandppw commented 2 years ago

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

mahanandyadav commented 1 year ago

i also run into this issue.

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