Skip to content

Commit

Permalink
feat!: update default ecmaVersion to 2021 (mysticatea#96)
Browse files Browse the repository at this point in the history
according to node.green, Node.js 16.0.0 supports all ES2021 features.

refs: eslint-community#42
  • Loading branch information
aladdin-add authored Apr 23, 2023
1 parent 075f0c5 commit 49d3ee7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ npm install --save-dev eslint eslint-plugin-n
{
"extends": ["eslint:recommended", "plugin:n/recommended"],
"parserOptions": {
// Only ESLint 6.2.0 and later support ES2020.
"ecmaVersion": 2020
"ecmaVersion": 2021
},
"rules": {
"n/exports-style": ["error", "module.exports"],
Expand Down Expand Up @@ -155,7 +154,7 @@ These preset configs:

- enable [no-process-exit](http://eslint.org/docs/rules/no-process-exit) rule because [the official document](https://nodejs.org/api/process.html#process_process_exit_code) does not recommend a use of `process.exit()`.
- enable plugin rules which are given ✅ in the above table.
- add `{ecmaVersion: 2019}` and etc into `parserOptions`.
- add `{ecmaVersion: 2021}` and etc into `parserOptions`.
- add proper globals into `globals`.
- add this plugin into `plugins`.

Expand Down
2 changes: 1 addition & 1 deletion lib/configs/recommended-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
},
parserOptions: {
ecmaFeatures: { globalReturn: false },
ecmaVersion: 2019,
ecmaVersion: 2021,
sourceType: "module",
},
plugins: ["n"],
Expand Down
2 changes: 1 addition & 1 deletion lib/configs/recommended-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
},
parserOptions: {
ecmaFeatures: { globalReturn: true },
ecmaVersion: 2019,
ecmaVersion: 2021,
sourceType: "script",
},
plugins: ["n"],
Expand Down

0 comments on commit 49d3ee7

Please sign in to comment.