Skip to content

Commit 49d3ee7

Browse files
authored
feat!: update default ecmaVersion to 2021 (#96)
according to node.green, Node.js 16.0.0 supports all ES2021 features. refs: #42
1 parent 075f0c5 commit 49d3ee7

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ npm install --save-dev eslint eslint-plugin-n
2121
{
2222
"extends": ["eslint:recommended", "plugin:n/recommended"],
2323
"parserOptions": {
24-
// Only ESLint 6.2.0 and later support ES2020.
25-
"ecmaVersion": 2020
24+
"ecmaVersion": 2021
2625
},
2726
"rules": {
2827
"n/exports-style": ["error", "module.exports"],
@@ -155,7 +154,7 @@ These preset configs:
155154

156155
- 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()`.
157156
- enable plugin rules which are given ✅ in the above table.
158-
- add `{ecmaVersion: 2019}` and etc into `parserOptions`.
157+
- add `{ecmaVersion: 2021}` and etc into `parserOptions`.
159158
- add proper globals into `globals`.
160159
- add this plugin into `plugins`.
161160

lib/configs/recommended-module.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = {
1313
},
1414
parserOptions: {
1515
ecmaFeatures: { globalReturn: false },
16-
ecmaVersion: 2019,
16+
ecmaVersion: 2021,
1717
sourceType: "module",
1818
},
1919
plugins: ["n"],

lib/configs/recommended-script.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = {
1313
},
1414
parserOptions: {
1515
ecmaFeatures: { globalReturn: true },
16-
ecmaVersion: 2019,
16+
ecmaVersion: 2021,
1717
sourceType: "script",
1818
},
1919
plugins: ["n"],

0 commit comments

Comments
 (0)