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

feat!: update default ecmaVersion to 2021 #96

Merged
merged 1 commit into from Apr 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
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
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
Expand Up @@ -13,7 +13,7 @@ module.exports = {
},
parserOptions: {
ecmaFeatures: { globalReturn: true },
ecmaVersion: 2019,
ecmaVersion: 2021,
sourceType: "script",
},
plugins: ["n"],
Expand Down