Skip to content

Commit 4edad89

Browse files
committed
7.16 initial
1 parent 672de6c commit 4edad89

File tree

7 files changed

+39
-13
lines changed

7 files changed

+39
-13
lines changed

.eslintrc-base.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ module.exports = {
77
'block-spacing': 2,
88
'brace-style': [2, '1tbs', { allowSingleLine: true }],
99
'camelcase': 2,
10+
'comma-dangle': [2, 'always-multiline'],
1011
'comma-spacing': 2,
1112
'comma-style': 2,
1213
'complexity': 1,
13-
'computed-property-spacing': 2,
1414
'curly': 2,
15+
'default-case-last': 2,
1516
'dot-location': [2, 'property'],
1617
'dot-notation': 2,
1718
'eol-last': 2,
@@ -48,6 +49,7 @@ module.exports = {
4849
'no-lone-blocks': 2,
4950
'no-lonely-if': 2,
5051
'no-loop-func': 2,
52+
'no-loss-of-precision': 2,
5153
'no-mixed-operators': 2,
5254
'no-mixed-requires': [2, { allowCall: false }],
5355
'no-mixed-spaces-and-tabs': [2, 'smart-tabs'],
@@ -72,12 +74,15 @@ module.exports = {
7274
'no-undef-init': 2,
7375
'no-unmodified-loop-condition': 2,
7476
'no-unneeded-ternary': [2, { defaultAssignment: false }],
77+
'no-unreachable-loop': 2,
7578
'no-unused-expressions': 2,
7679
'no-unsafe-negation': [2, { enforceForOrderingRelations: true }],
7780
'no-use-before-define': [2, { functions: false, variables: false }],
81+
'no-useless-backreference': 2,
7882
'no-useless-call': 2,
7983
'no-useless-concat': 2,
8084
'no-useless-return': 2,
85+
'no-void': [2, { allowAsStatement: true }],
8186
'no-whitespace-before-property': 2,
8287
'object-curly-newline': [2, { multiline: true, consistent: true }],
8388
'object-curly-spacing': [2, 'always'],

.eslintrc-es6plus.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
module.exports = {
22
parserOptions: {
3-
'ecmaVersion': 10, // 2019
3+
'ecmaVersion': 11, // 2020
44
},
55
env: {
66
'es6': true,
77
},
88
rules: {
9-
'arrow-parens': [2, 'as-needed', { requireForBlockBody: true }],
9+
'arrow-parens': [2, 'as-needed'],
1010
'arrow-spacing': 2,
1111
'class-methods-use-this': 1,
12-
'computed-property-spacing': [2, 'never', { enforceForClassMembers: true }],
12+
'computed-property-spacing': [2, 'never'],
1313
'consistent-this': [2, 'self'],
1414
'default-param-last': 2,
1515
'generator-star-spacing': [2, { before: false, after: true }],
@@ -18,7 +18,10 @@ module.exports = {
1818
'no-buffer-constructor': 2,
1919
'no-confusing-arrow': 2,
2020
'no-duplicate-imports': [2, { includeExports: true }],
21+
'no-nonoctal-decimal-escape': 2,
22+
'no-promise-executor-return': 2,
2123
'no-template-curly-in-string': 2,
24+
'no-unsafe-optional-chaining': 2,
2225
'no-useless-computed-key': 2,
2326
'no-useless-constructor': 2,
2427
'no-useless-rename': 2,

.eslintrc-node.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
rules: {
3+
'node/handle-callback-err': 2,
4+
'node/no-callback-literal': 2,
5+
'node/no-new-require': 2,
6+
'node/no-path-concat': 2,
7+
'node/no-process-exit': 2,
8+
},
9+
};

.eslintrc.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
/* eslint-version 6.8 */
1+
/* eslint-version 7.16 */
22
module.exports = {
33
root: true,
44
parserOptions: {
55
sourceType: 'script',
66
},
77
plugins: [
8+
'node',
89
'jest',
910
],
1011
extends: [
1112
'eslint:recommended',
1213
'.eslintrc-base.js',
1314
'.eslintrc-es6plus.js',
15+
'plugin:node/recommended',
16+
'.eslintrc-node.js',
1417
],
1518
env: {
1619
'node': true,
17-
}
20+
},
1821
};

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
## 7.16-r0 / 2020-12-20
2+
* Update rules for ESLint 7.16.
3+
* Add module for **eslint-plugin-node**.
4+
15
## 6.8-r0 / 2020-12-20
26
* Add baseline rules for the last ESLint version to support Node.js 8 LTS.

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22
These are the ESLint rules I prefer. They're split into files to make it easy to use different sets of rules depending on what components the project has and what versions it expects.
33

44
## Versions
5-
These rules are configured to be used with the following versions.
5+
These rules are configured to be used with the following versions.
66

7-
| Name | Version | Notes |
7+
| Name | Version | Description |
88
|------|---------|-------------|
9-
| [ESLint](https://eslint.org/) | [6.8.0](https://eslint.org/blog/2019/12/eslint-v6.8.0-released) | Includes rules and expects the **recommended** configuration from this version.<br/>**6.8.0** is the last version to support **Node.js 8 LTS**. |
10-
| [Node.js](https://nodejs.org/) | [^8.9.0](https://nodejs.org/en/download/releases/) | **Node.js 8 LTS** started at version **8.9.0**. |
11-
| [V8](https://v8.dev/) | [6.1](https://v8.dev/blog/v8-release-61) <br/> [6.2](https://v8.dev/blog/v8-release-62) | **Node.js 8 LTS** started with **V8 6.1** and updated to **V8 6.2** at version **8.10.0**. |
9+
| [ESLint](https://eslint.org/) | [7.16.x](https://eslint.org/blog/2020/12/eslint-v7.16.0-released) | Includes rules and expects the **recommended** configuration from this version. |
10+
| [Node.js](https://nodejs.org/) | [^14.15.0](https://nodejs.org/en/download/releases/) | **Node.js 14 LTS** started at version **14.15.0**. |
11+
| [V8](https://v8.dev/) | [8.4.x](https://v8.dev/blog/v8-release-84) | **Node.js 14 LTS** uses **V8 8.4**. |
12+
| [ECMAScript](https://www.ecma-international.org/publications/standards/Ecma-262.htm) | [11 (2020)](https://www.ecma-international.org/ecma-262/11.0/index.html#title) | ESLint supports the [nullish coalescing operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator) from [v7.2.0](https://eslint.org/blog/2020/06/eslint-v7.2.0-released) and the [optional chaining operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining) from [v7.5.0](https://eslint.org/blog/2020/07/eslint-v7.5.0-released). |
1213

1314
# Files
1415
| File | Description |
1516
|------|-------------|
1617
| `.eslintrc.js` | The root file which includes other modular files. |
1718
| `.eslintrc-base.js` | Includes all rules that don't relate to ES6+ language features. |
1819
| `.eslintrc-es6plus.js` | Includes all rules that relate to ES6+ language features. |
20+
| `.eslintrc-node.js` | Includes rules from [eslint-plugin-node](https://github.com/mysticatea/eslint-plugin-node) removed from ESLint core in [v7.0.0](https://eslint.org/blog/2020/05/eslint-v7.0.0-released).
1921
| `test/.eslintrc.js` | Rules for test files, including Jest-specific rules. |

test/.eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
extends: [
33
'plugin:jest/recommended',
4-
'plugin:jest/style'
4+
'plugin:jest/style',
55
],
66
env: {
77
jest: true,
@@ -29,5 +29,5 @@ module.exports = {
2929
'jest/prefer-todo': 2,
3030
'jest/require-to-throw-message': 2,
3131
'jest/valid-title': 2,
32-
}
32+
},
3333
};

0 commit comments

Comments
 (0)