@aarongoldenthal/eslint-config-standard 20.1.0 → 22.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -10
- package/eslint-comments-config.js +28 -0
- package/index.js +263 -49
- package/jest-config.js +13 -12
- package/jsdoc-config.js +12 -6
- package/node-config.js +1 -1
- package/package.json +14 -13
- package/playwright-config.js +2 -2
- package/promise-config.js +1 -1
- package/recommended.js +1 -0
- package/unicorn-config.js +115 -112
package/README.md
CHANGED
|
@@ -2,21 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
## Summary
|
|
4
4
|
|
|
5
|
-
Custom standard ESLint configuration for all projects. Includes configurations
|
|
5
|
+
Custom standard ESLint configuration for all projects. Includes configurations
|
|
6
|
+
for `eslint`, `@eslint-community/eslint-plugin-eslint-comments` (formerly
|
|
7
|
+
`eslint-plugin-eslint-comments`), `eslint-plugin-jest`, `eslint-plugin-jsdoc`,
|
|
8
|
+
`eslint-plugin-n` (formerly `eslint-plugin-node`), `eslint-plugin-playwright`,
|
|
9
|
+
`eslint-plugin-promise`, `eslint-plugin-sonarjs`, and `eslint-plugin-unicorn`.
|
|
10
|
+
This package defines all required configurations as `dependencies` so they are
|
|
11
|
+
installed and do not have to be defined in each project.
|
|
6
12
|
|
|
7
|
-
Per recommended best practices, the following configurations include `overrides`
|
|
13
|
+
Per recommended best practices, the following configurations include `overrides`
|
|
14
|
+
so they are only applicable to a subset of files:
|
|
8
15
|
|
|
9
16
|
- `jest-config`: applicable to files matching `['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)']`,
|
|
10
17
|
which is the [default filter for Jest test files](https://jestjs.io/docs/configuration#testmatch-arraystring).
|
|
11
|
-
- `playwright-config`: applicable to files matching `['**/*.pwtest.[jt]s']`,
|
|
18
|
+
- `playwright-config`: applicable to files matching `['**/*.pwtest.[jt]s']`,
|
|
19
|
+
which differentiates them from Jest test files.
|
|
12
20
|
|
|
13
|
-
The configuration as-defined includes a number of formatting rules. The
|
|
21
|
+
The configuration as-defined includes a number of formatting rules. The
|
|
22
|
+
`eslint-config-prettier` package is included as well, and can be added to the
|
|
23
|
+
config if `prettier` is also being used so it takes priority for formatting.
|
|
14
24
|
|
|
15
|
-
There is also an `esm-config` included with overrides for projects using ES
|
|
25
|
+
There is also an `esm-config` included with overrides for projects using ES
|
|
26
|
+
modules instead of Common JS modules.
|
|
16
27
|
|
|
17
28
|
### Usage
|
|
18
29
|
|
|
19
|
-
There is a `recommended` configuration with all plugin configurations enabled
|
|
30
|
+
There is a `recommended` configuration with all plugin configurations enabled
|
|
31
|
+
except `esm-config` (but including `prettier`). To configure .eslintrc.json
|
|
32
|
+
with this configuration:
|
|
20
33
|
|
|
21
34
|
```json
|
|
22
35
|
{
|
|
@@ -24,11 +37,13 @@ There is a `recommended` configuration with all plugin configurations enabled ex
|
|
|
24
37
|
}
|
|
25
38
|
```
|
|
26
39
|
|
|
27
|
-
To configure .eslintrc.json with individual plugins, use the appropriate subset
|
|
40
|
+
To configure .eslintrc.json with individual plugins, use the appropriate subset
|
|
41
|
+
of the options below:
|
|
28
42
|
|
|
29
43
|
```json
|
|
30
44
|
{
|
|
31
45
|
"extends": [
|
|
46
|
+
"@aarongoldenthal/eslint-config-standard/eslint-comments-config.js",
|
|
32
47
|
"@aarongoldenthal/eslint-config-standard/jest-config",
|
|
33
48
|
"@aarongoldenthal/eslint-config-standard/jsdoc-config",
|
|
34
49
|
"@aarongoldenthal/eslint-config-standard/node-config",
|
|
@@ -45,6 +60,10 @@ To configure .eslintrc.json with individual plugins, use the appropriate subset
|
|
|
45
60
|
|
|
46
61
|
Notes:
|
|
47
62
|
|
|
48
|
-
- If used, the `@aarongoldenthal/eslint-config-standard` config should be
|
|
49
|
-
|
|
50
|
-
|
|
63
|
+
- If used, the `@aarongoldenthal/eslint-config-standard` config should be
|
|
64
|
+
included after any other `@aarongoldenthal/eslint-config-standard/*`
|
|
65
|
+
configurations except `esm-config` so those settings take precedence.
|
|
66
|
+
- If used, the `esm-config` should be configured after all functional rules
|
|
67
|
+
to ensure the overridden settings take precedence.
|
|
68
|
+
- If used, the `prettier` should be included last to take priority in disabling
|
|
69
|
+
the applicable rules from all other configurations.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
plugins: ['@eslint-community/eslint-comments'],
|
|
5
|
+
rules: {
|
|
6
|
+
'@eslint-community/eslint-comments/disable-enable-pair': [
|
|
7
|
+
'error',
|
|
8
|
+
{ allowWholeFile: true }
|
|
9
|
+
],
|
|
10
|
+
'@eslint-community/eslint-comments/no-aggregating-enable': 'error',
|
|
11
|
+
'@eslint-community/eslint-comments/no-duplicate-disable': 'error',
|
|
12
|
+
'@eslint-community/eslint-comments/no-unlimited-disable': 'error',
|
|
13
|
+
'@eslint-community/eslint-comments/no-unused-disable': 'error',
|
|
14
|
+
'@eslint-community/eslint-comments/no-unused-enable': 'error',
|
|
15
|
+
'@eslint-community/eslint-comments/no-use': [
|
|
16
|
+
'error',
|
|
17
|
+
{
|
|
18
|
+
allow: [
|
|
19
|
+
'eslint-disable',
|
|
20
|
+
'eslint-disable-line',
|
|
21
|
+
'eslint-disable-next-line',
|
|
22
|
+
'eslint-enable'
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
'@eslint-community/eslint-comments/require-description': 'error'
|
|
27
|
+
}
|
|
28
|
+
};
|
package/index.js
CHANGED
|
@@ -1,48 +1,149 @@
|
|
|
1
|
+
/* eslint-disable max-lines -- required given number of rules */
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
|
-
const tabSpaces = 4;
|
|
4
4
|
const complexityThreshold = 20;
|
|
5
|
-
const maxLinesThreshold = 300;
|
|
6
5
|
const maxFunctionLinesThreshold = 30;
|
|
6
|
+
const maxLinesThreshold = 300;
|
|
7
|
+
const maxParametersThreshold = 3;
|
|
8
|
+
const maxStatementsPerLineThreshold = 1;
|
|
9
|
+
const maxStatementsThreshold = 50;
|
|
7
10
|
const nestedThreshold = 5;
|
|
11
|
+
const tabSpaces = 4;
|
|
8
12
|
|
|
9
13
|
module.exports = {
|
|
10
14
|
env: {
|
|
11
15
|
es2022: true,
|
|
12
16
|
node: true
|
|
13
17
|
},
|
|
14
|
-
|
|
18
|
+
overrides: [
|
|
19
|
+
{
|
|
20
|
+
files: [
|
|
21
|
+
// Patterns for jest-config
|
|
22
|
+
'**/__tests__/**/*.[jt]s?(x)',
|
|
23
|
+
'**/?(*.)+(spec|test).[jt]s?(x)',
|
|
24
|
+
// Pattern for playwright-config
|
|
25
|
+
'**/*.pwtest.[jt]s'
|
|
26
|
+
],
|
|
27
|
+
rules: {
|
|
28
|
+
// Assuming 1 test file per module, it can exceed limit
|
|
29
|
+
'max-lines': 'off',
|
|
30
|
+
// Describes are functions and frequently exceed limit
|
|
31
|
+
'max-lines-per-function': 'off',
|
|
32
|
+
// Tests frequently use indices and counts
|
|
33
|
+
'no-magic-numbers': 'off',
|
|
34
|
+
// Undefined is a common value to test no value
|
|
35
|
+
'no-undefined': 'off',
|
|
36
|
+
// Tests frequently check array elements, destructuring is
|
|
37
|
+
// les intuitive
|
|
38
|
+
'prefer-destructuring': 'off',
|
|
39
|
+
// Regexes in tests frequently check for match patterns, but
|
|
40
|
+
// groups are not captured
|
|
41
|
+
'prefer-named-capture-group': 'off',
|
|
42
|
+
// Async tests frequently return promises, which the test
|
|
43
|
+
// runner awaits implicitly
|
|
44
|
+
'require-await': 'off'
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
],
|
|
15
48
|
parserOptions: {
|
|
16
49
|
ecmaVersion: 2022,
|
|
17
50
|
sourceType: 'script'
|
|
18
51
|
},
|
|
19
52
|
reportUnusedDisableDirectives: true,
|
|
20
53
|
rules: {
|
|
21
|
-
|
|
54
|
+
// Possible problems
|
|
22
55
|
'array-callback-return': 'error',
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
56
|
+
'constructor-super': 'error', // Recommended
|
|
57
|
+
'for-direction': 'error', // Recommended
|
|
58
|
+
'getter-return': 'error', // Recommended
|
|
59
|
+
'no-async-promise-executor': 'error', // Recommended
|
|
60
|
+
'no-await-in-loop': 'error',
|
|
61
|
+
'no-class-assign': 'error', // Recommended
|
|
62
|
+
'no-compare-neg-zero': 'error', // Recommended
|
|
63
|
+
'no-cond-assign': 'error', // Recommended
|
|
64
|
+
'no-const-assign': 'error', // Recommended
|
|
65
|
+
'no-constant-binary-expression': 'error',
|
|
66
|
+
'no-constant-condition': 'error', // Recommended
|
|
67
|
+
'no-constructor-return': 'error',
|
|
68
|
+
'no-control-regex': 'error', // Recommended
|
|
69
|
+
'no-debugger': 'error', // Recommended
|
|
70
|
+
'no-dupe-args': 'error', // Recommended
|
|
71
|
+
'no-dupe-class-members': 'error', // Recommended
|
|
72
|
+
'no-dupe-else-if': 'error', // Recommended
|
|
73
|
+
'no-dupe-keys': 'error', // Recommended
|
|
74
|
+
'no-duplicate-case': 'error', // Recommended
|
|
75
|
+
'no-duplicate-imports': 'error',
|
|
76
|
+
'no-empty-character-class': 'error', // Recommended
|
|
77
|
+
'no-empty-pattern': 'error', // Recommended
|
|
78
|
+
'no-ex-assign': 'error', // Recommended
|
|
79
|
+
'no-fallthrough': 'error', // Recommended
|
|
80
|
+
'no-func-assign': 'error', // Recommended
|
|
81
|
+
'no-import-assign': 'error', // Recommended
|
|
82
|
+
'no-inner-declarations': 'error', // Recommended
|
|
83
|
+
'no-invalid-regexp': 'error', // Recommended
|
|
84
|
+
'no-irregular-whitespace': ['error', { skipStrings: true }], // Recommended
|
|
85
|
+
'no-loss-of-precision': 'error', // Recommended
|
|
86
|
+
'no-misleading-character-class': 'error', // Recommended
|
|
87
|
+
'no-new-native-nonconstructor': 'error',
|
|
88
|
+
'no-new-symbol': 'error', // Recommended
|
|
89
|
+
'no-obj-calls': 'error', // Recommended
|
|
90
|
+
'no-promise-executor-return': 'error',
|
|
91
|
+
'no-prototype-builtins': 'error', // Recommended
|
|
92
|
+
'no-self-assign': 'error', // Recommended
|
|
93
|
+
'no-self-compare': 'error',
|
|
94
|
+
'no-setter-return': 'error', // Recommended
|
|
95
|
+
'no-sparse-arrays': 'error', // Recommended
|
|
96
|
+
'no-template-curly-in-string': 'error',
|
|
97
|
+
'no-this-before-super': 'error', // Recommended
|
|
98
|
+
'no-undef': 'error', // Recommended
|
|
99
|
+
'no-unexpected-multiline': 'error', // Recommended, Prettier
|
|
100
|
+
'no-unmodified-loop-condition': 'error',
|
|
101
|
+
'no-unreachable': 'error', // Recommended
|
|
102
|
+
'no-unreachable-loop': 'error',
|
|
103
|
+
'no-unsafe-finally': 'error', // Recommended
|
|
104
|
+
'no-unsafe-negation': 'error', // Recommended
|
|
105
|
+
'no-unsafe-optional-chaining': 'error', // Recommended
|
|
106
|
+
'no-unused-private-class-members': 'error',
|
|
107
|
+
'no-unused-vars': 'error', // Recommended
|
|
108
|
+
'no-use-before-define': ['error', { functions: false }],
|
|
109
|
+
'no-useless-backreference': 'error', // Recommended
|
|
110
|
+
'require-atomic-updates': 'error',
|
|
111
|
+
'use-isnan': 'error', // Recommended
|
|
112
|
+
'valid-typeof': 'error', // Recommended
|
|
113
|
+
|
|
114
|
+
// Suggestions
|
|
115
|
+
// eslint-disable-next-line sort-keys -- match eslint docs
|
|
116
|
+
'accessor-pairs': 'error',
|
|
117
|
+
'arrow-body-style': ['error', 'as-needed'],
|
|
118
|
+
'block-scoped-var': 'error',
|
|
27
119
|
camelcase: 'error',
|
|
28
|
-
'
|
|
29
|
-
|
|
120
|
+
'capitalized-comments': [
|
|
121
|
+
'error',
|
|
122
|
+
'always',
|
|
123
|
+
{ ignoreConsecutiveComments: true, ignorePattern: 'nosemgrep' }
|
|
124
|
+
],
|
|
125
|
+
'class-methods-use-this': 'error',
|
|
30
126
|
complexity: ['error', complexityThreshold],
|
|
31
|
-
'
|
|
32
|
-
|
|
127
|
+
'consistent-return': 'error',
|
|
128
|
+
// Disabled due to 'unicorn/no-this-assignment
|
|
129
|
+
'consistent-this': 'off',
|
|
130
|
+
curly: 'error', // Prettier
|
|
33
131
|
'default-case': 'error',
|
|
34
132
|
'default-case-last': 'error',
|
|
35
133
|
'default-param-last': 'error',
|
|
36
|
-
'
|
|
134
|
+
'dot-notation': ['error', { allowPattern: '^[a-z]+(_[a-z]+)+$' }],
|
|
37
135
|
eqeqeq: ['error', 'always'],
|
|
38
|
-
'func-
|
|
136
|
+
'func-name-matching': 'off',
|
|
137
|
+
'func-names': 'off',
|
|
138
|
+
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
|
|
39
139
|
'grouped-accessor-pairs': ['error', 'getBeforeSet'],
|
|
40
|
-
|
|
41
|
-
'
|
|
42
|
-
'
|
|
43
|
-
'
|
|
44
|
-
'
|
|
140
|
+
'guard-for-in': 'error',
|
|
141
|
+
'id-denylist': 'off',
|
|
142
|
+
'id-length': 'off',
|
|
143
|
+
'id-match': 'off',
|
|
144
|
+
'init-declarations': 'off',
|
|
45
145
|
'logical-assignment-operators': ['error', 'always'],
|
|
146
|
+
'max-classes-per-file': ['error', 1],
|
|
46
147
|
'max-depth': ['error', { max: nestedThreshold }],
|
|
47
148
|
'max-lines': ['error', maxLinesThreshold],
|
|
48
149
|
'max-lines-per-function': [
|
|
@@ -54,90 +155,203 @@ module.exports = {
|
|
|
54
155
|
}
|
|
55
156
|
],
|
|
56
157
|
'max-nested-callbacks': ['error', { max: nestedThreshold }],
|
|
57
|
-
'
|
|
158
|
+
'max-params': ['error', { max: maxParametersThreshold }],
|
|
159
|
+
'max-statements': ['error', { max: maxStatementsThreshold }],
|
|
160
|
+
'multiline-comment-style': ['error', 'separate-lines'],
|
|
161
|
+
'new-cap': 'error',
|
|
58
162
|
'no-alert': 'error',
|
|
59
163
|
'no-array-constructor': 'error',
|
|
164
|
+
'no-bitwise': 'error',
|
|
165
|
+
'no-caller': 'error',
|
|
166
|
+
'no-case-declarations': 'error', // Recommended
|
|
167
|
+
'no-confusing-arrow': 'error', // Prettier
|
|
60
168
|
'no-console': 'off',
|
|
61
|
-
'no-
|
|
62
|
-
'no-
|
|
169
|
+
'no-continue': 'error',
|
|
170
|
+
'no-delete-var': 'error', // Recommended
|
|
63
171
|
'no-div-regex': 'error',
|
|
64
|
-
'no-duplicate-imports': 'error',
|
|
65
172
|
'no-else-return': 'error',
|
|
173
|
+
'no-empty': 'error', // Recommended
|
|
174
|
+
'no-empty-function': ['error', { allow: ['arrowFunctions'] }],
|
|
66
175
|
'no-empty-static-block': 'error',
|
|
67
176
|
'no-eq-null': 'error',
|
|
68
177
|
'no-eval': 'error',
|
|
69
178
|
'no-extend-native': 'error',
|
|
70
179
|
'no-extra-bind': 'error',
|
|
180
|
+
'no-extra-boolean-cast': 'error', // Recommended
|
|
181
|
+
'no-extra-label': 'error',
|
|
182
|
+
'no-extra-semi': 'error', // Recommended, Prettier
|
|
183
|
+
'no-floating-decimal': 'error', // Prettier
|
|
184
|
+
'no-global-assign': 'error', // Recommended
|
|
71
185
|
'no-implicit-coercion': 'error',
|
|
72
186
|
'no-implicit-globals': 'off',
|
|
73
187
|
'no-implied-eval': 'error',
|
|
188
|
+
'no-inline-comments': 'off',
|
|
189
|
+
'no-invalid-this': 'error',
|
|
190
|
+
'no-iterator': 'error',
|
|
191
|
+
'no-label-var': 'error',
|
|
192
|
+
'no-labels': 'error',
|
|
74
193
|
'no-lone-blocks': 'error',
|
|
75
194
|
'no-lonely-if': 'error',
|
|
76
195
|
'no-loop-func': 'error',
|
|
77
196
|
'no-magic-numbers': ['error', { ignore: [-1, 0, 1] }],
|
|
78
|
-
'no-mixed-
|
|
197
|
+
'no-mixed-operators': 'error', // Prettier
|
|
79
198
|
'no-multi-assign': 'error',
|
|
80
|
-
'no-multi-spaces': 'error',
|
|
81
199
|
'no-multi-str': 'error',
|
|
200
|
+
// Disabled in favor of unicorn/no-negated-condition
|
|
201
|
+
'no-negated-condition': 'off',
|
|
82
202
|
// Disabled in favor of unicorn/no-nested-ternary
|
|
83
203
|
'no-nested-ternary': 'off',
|
|
84
204
|
'no-new': 'error',
|
|
85
205
|
'no-new-func': 'error',
|
|
86
|
-
'no-new-native-nonconstructor': 'error',
|
|
87
206
|
'no-new-object': 'error',
|
|
88
207
|
'no-new-wrappers': 'error',
|
|
208
|
+
'no-nonoctal-decimal-escape': 'error', // Recommended
|
|
209
|
+
'no-octal': 'error', // Recommended
|
|
210
|
+
'no-octal-escape': 'error',
|
|
89
211
|
'no-param-reassign': ['error', { props: false }],
|
|
90
|
-
'no-
|
|
212
|
+
'no-plusplus': 'off',
|
|
213
|
+
'no-proto': 'error',
|
|
214
|
+
'no-redeclare': 'error', // Recommended
|
|
215
|
+
'no-regex-spaces': 'error', // Recommended
|
|
216
|
+
'no-restricted-exports': 'off',
|
|
217
|
+
'no-restricted-globals': 'off',
|
|
218
|
+
'no-restricted-imports': 'off',
|
|
219
|
+
'no-restricted-properties': 'off',
|
|
220
|
+
'no-restricted-syntax': 'off',
|
|
91
221
|
'no-return-assign': 'error',
|
|
92
222
|
'no-return-await': 'error',
|
|
93
223
|
'no-script-url': 'error',
|
|
94
|
-
'no-self-compare': 'error',
|
|
95
224
|
'no-sequences': ['error', { allowInParentheses: false }],
|
|
96
225
|
'no-shadow': 'error',
|
|
97
|
-
'no-
|
|
226
|
+
'no-shadow-restricted-names': 'error', // Recommended
|
|
227
|
+
'no-ternary': 'off',
|
|
98
228
|
'no-throw-literal': 'error',
|
|
99
|
-
'no-
|
|
229
|
+
'no-undef-init': 'error',
|
|
230
|
+
'no-undefined': 'error',
|
|
100
231
|
'no-underscore-dangle': 'error',
|
|
101
232
|
'no-unneeded-ternary': 'error',
|
|
102
|
-
'no-
|
|
103
|
-
|
|
233
|
+
'no-unused-expressions': [
|
|
234
|
+
'error',
|
|
235
|
+
{ allowShortCircuit: true, allowTernary: true }
|
|
236
|
+
],
|
|
237
|
+
'no-unused-labels': 'error', // Recommended
|
|
238
|
+
'no-useless-call': 'error',
|
|
239
|
+
'no-useless-catch': 'error', // Recommended
|
|
240
|
+
'no-useless-computed-key': 'error',
|
|
104
241
|
'no-useless-concat': 'error',
|
|
105
242
|
'no-useless-constructor': 'error',
|
|
243
|
+
'no-useless-escape': 'error', // Recommended
|
|
244
|
+
'no-useless-rename': 'error',
|
|
106
245
|
'no-useless-return': 'error',
|
|
107
246
|
'no-var': 'error',
|
|
247
|
+
'no-void': 'error',
|
|
108
248
|
'no-warning-comments': 'error',
|
|
109
|
-
'no-
|
|
110
|
-
'object-curly-spacing': ['error', 'always'],
|
|
249
|
+
'no-with': 'error', // Recommended
|
|
111
250
|
'object-shorthand': 'error',
|
|
251
|
+
'one-var': 'off',
|
|
252
|
+
'one-var-declaration-per-line': 'off', // Prettier
|
|
112
253
|
'operator-assignment': 'error',
|
|
113
|
-
'
|
|
254
|
+
'prefer-arrow-callback': 'error',
|
|
114
255
|
'prefer-const': 'error',
|
|
115
256
|
'prefer-destructuring': ['error', { array: true, object: true }],
|
|
257
|
+
'prefer-exponentiation-operator': 'error',
|
|
258
|
+
'prefer-named-capture-group': 'error',
|
|
259
|
+
'prefer-numeric-literals': 'error',
|
|
260
|
+
'prefer-object-has-own': 'error',
|
|
116
261
|
'prefer-object-spread': ['error'],
|
|
117
262
|
'prefer-promise-reject-errors': 'error',
|
|
118
263
|
'prefer-regex-literals': 'error',
|
|
119
264
|
'prefer-rest-params': 'error',
|
|
120
265
|
'prefer-spread': 'error',
|
|
121
266
|
'prefer-template': 'error',
|
|
122
|
-
|
|
267
|
+
'quote-props': 'off', // Prettier
|
|
268
|
+
radix: ['error', 'as-needed'],
|
|
123
269
|
'require-await': 'error',
|
|
124
|
-
'
|
|
125
|
-
'
|
|
126
|
-
|
|
127
|
-
'
|
|
270
|
+
'require-unicode-regexp': 'off',
|
|
271
|
+
'require-yield': 'error', // Recommended
|
|
272
|
+
'sort-imports': ['error', { allowSeparatedGroups: true }],
|
|
273
|
+
'sort-keys': ['error', 'asc', { caseSensitive: true, natural: true }],
|
|
274
|
+
'sort-vars': 'error',
|
|
275
|
+
'spaced-comment': ['error', 'always'],
|
|
276
|
+
strict: 'error',
|
|
277
|
+
'symbol-description': 'error',
|
|
278
|
+
// Disabled due to no-var
|
|
279
|
+
'vars-on-top': 'off',
|
|
280
|
+
yoda: 'error',
|
|
281
|
+
|
|
282
|
+
// Layout & Formatting
|
|
283
|
+
// eslint-disable-next-line sort-keys -- match eslint docs
|
|
284
|
+
'array-bracket-newline': 'off', // Prettier
|
|
285
|
+
'array-bracket-spacing': 'off', // Prettier
|
|
286
|
+
'array-element-newline': 'off', // Prettier
|
|
287
|
+
'arrow-parens': ['error', 'always'], // Prettier
|
|
288
|
+
'arrow-spacing': 'error', // Prettier
|
|
289
|
+
'block-spacing': 'error', // Prettier
|
|
290
|
+
'brace-style': ['error', 'stroustrup'], // Prettier
|
|
291
|
+
'comma-dangle': ['error', 'never'], // Prettier
|
|
292
|
+
'comma-spacing': ['error', { after: true, before: false }], // Prettier
|
|
293
|
+
'comma-style': 'off', // Prettier
|
|
294
|
+
'computed-property-spacing': ['error', 'never'], // Prettier
|
|
295
|
+
'dot-location': ['error', 'property'], // Prettier
|
|
296
|
+
'eol-last': ['error', 'always'], // Prettier
|
|
297
|
+
'func-call-spacing': ['error', 'never'], // Prettier
|
|
298
|
+
'function-call-argument-newline': 'off', // Prettier
|
|
299
|
+
'function-paren-newline': 'off', // Prettier
|
|
300
|
+
'generator-star-spacing': 'off', // Prettier
|
|
301
|
+
'implicit-arrow-linebreak': 'off', // Prettier
|
|
302
|
+
indent: ['error', tabSpaces, { SwitchCase: 1 }], // Prettier
|
|
303
|
+
'jsx-quotes': 'off', // Prettier
|
|
304
|
+
'key-spacing': 'error', // Prettier
|
|
305
|
+
'keyword-spacing': ['error', { after: true, before: true }], // Prettier
|
|
306
|
+
'line-comment-position': 'off',
|
|
307
|
+
'linebreak-style': ['error', 'unix'], // Prettier
|
|
308
|
+
'lines-around-comment': 'off', // Prettier
|
|
309
|
+
'lines-between-class-members': ['error', 'always'],
|
|
310
|
+
'max-len': 'off', // Prettier
|
|
311
|
+
'max-statements-per-line': [
|
|
312
|
+
'error',
|
|
313
|
+
{ max: maxStatementsPerLineThreshold }
|
|
314
|
+
],
|
|
315
|
+
'multiline-ternary': 'off', // Prettier
|
|
316
|
+
'new-parens': 'error', // Prettier
|
|
317
|
+
'newline-per-chained-call': 'off', // Prettier
|
|
318
|
+
'no-extra-parens': 'off', // Prettier
|
|
319
|
+
'no-mixed-spaces-and-tabs': 'error', // Recommended, Prettier
|
|
320
|
+
'no-multi-spaces': 'error', // Prettier
|
|
321
|
+
'no-multiple-empty-lines': 'off', // Prettier
|
|
322
|
+
'no-tabs': 'off', // Prettier
|
|
323
|
+
'no-trailing-spaces': 'error', // Prettier
|
|
324
|
+
'no-whitespace-before-property': 'error', // Prettier
|
|
325
|
+
'nonblock-statement-body-position': 'off', // Prettier
|
|
326
|
+
'object-curly-newline': 'off', // Prettier
|
|
327
|
+
'object-curly-spacing': ['error', 'always'], // Prettier
|
|
328
|
+
'object-property-newline': 'off', // Prettier
|
|
329
|
+
'operator-linebreak': 'off', // Prettier
|
|
330
|
+
'padded-blocks': ['error', 'never'], // Prettier
|
|
331
|
+
'padding-line-between-statements': 'off',
|
|
332
|
+
quotes: ['error', 'single'], // Prettier
|
|
333
|
+
'rest-spread-spacing': 'error', // Prettier
|
|
334
|
+
semi: ['error', 'always'], // Prettier
|
|
335
|
+
'semi-spacing': 'error', // Prettier
|
|
336
|
+
'semi-style': ['error', 'last'], // Prettier
|
|
337
|
+
'space-before-blocks': ['error', 'always'], // Prettier
|
|
128
338
|
'space-before-function-paren': [
|
|
129
339
|
'error',
|
|
130
340
|
{
|
|
131
341
|
anonymous: 'always',
|
|
132
|
-
|
|
133
|
-
|
|
342
|
+
asyncArrow: 'always',
|
|
343
|
+
named: 'never'
|
|
134
344
|
}
|
|
135
|
-
],
|
|
136
|
-
'space-in-parens': ['error', 'never'],
|
|
137
|
-
'
|
|
138
|
-
|
|
139
|
-
'
|
|
140
|
-
'
|
|
141
|
-
|
|
345
|
+
], // Prettier
|
|
346
|
+
'space-in-parens': ['error', 'never'], // Prettier
|
|
347
|
+
'space-infix-ops': 'off', // Prettier
|
|
348
|
+
'space-unary-ops': 'off', // Prettier
|
|
349
|
+
'switch-colon-spacing': 'off', // Prettier
|
|
350
|
+
'template-curly-spacing': 'error', // Prettier
|
|
351
|
+
'template-tag-spacing': 'off', // Prettier
|
|
352
|
+
'unicode-bom': 'off', // Prettier
|
|
353
|
+
'wrap-iife': 'error', // Prettier
|
|
354
|
+
'wrap-regex': 'off', // Prettier
|
|
355
|
+
'yield-star-spacing': 'off' // Prettier
|
|
142
356
|
}
|
|
143
357
|
};
|
package/jest-config.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
overrides: [
|
|
5
5
|
{
|
|
6
|
+
env: {
|
|
7
|
+
jest: true
|
|
8
|
+
},
|
|
6
9
|
files: [
|
|
7
10
|
'**/__tests__/**/*.[jt]s?(x)',
|
|
8
11
|
'**/?(*.)+(spec|test).[jt]s?(x)'
|
|
9
12
|
],
|
|
10
|
-
env: {
|
|
11
|
-
jest: true
|
|
12
|
-
},
|
|
13
13
|
plugins: ['jest'],
|
|
14
14
|
rules: {
|
|
15
15
|
'jest/consistent-test-it': [
|
|
@@ -38,21 +38,22 @@ module.exports = {
|
|
|
38
38
|
'jest/no-restricted-matchers': [
|
|
39
39
|
'error',
|
|
40
40
|
{
|
|
41
|
-
|
|
41
|
+
'not.toBeFalsy': 'Avoid `not.toBeFalsy`',
|
|
42
42
|
'not.toBeTruthy': 'Avoid `not.toBeTruthy`',
|
|
43
|
-
'
|
|
44
|
-
|
|
45
|
-
'resolves.not.toBeTruthy':
|
|
46
|
-
'Avoid `resolves.not.toBeTruthy`',
|
|
43
|
+
'rejects.not.toBeFalsy':
|
|
44
|
+
'Avoid `rejects.not.toBeFalsy`',
|
|
47
45
|
'rejects.not.toBeTruthy':
|
|
48
46
|
'Avoid `rejects.not.toBeTruthy`',
|
|
49
|
-
toBeFalsy: 'Avoid `toBeFalsy`',
|
|
50
|
-
'not.toBeFalsy': 'Avoid `not.toBeFalsy`',
|
|
51
|
-
'resolves.toBeFalsy': 'Avoid `resolves.toBeFalsy`',
|
|
52
47
|
'rejects.toBeFalsy': 'Avoid `rejects.toBeFalsy`',
|
|
48
|
+
'rejects.toBeTruthy': 'Avoid `rejects.toBeTruthy`',
|
|
53
49
|
'resolves.not.toBeFalsy':
|
|
54
50
|
'Avoid `resolves.not.toBeFalsy`',
|
|
55
|
-
'
|
|
51
|
+
'resolves.not.toBeTruthy':
|
|
52
|
+
'Avoid `resolves.not.toBeTruthy`',
|
|
53
|
+
'resolves.toBeFalsy': 'Avoid `resolves.toBeFalsy`',
|
|
54
|
+
'resolves.toBeTruthy': 'Avoid `resolves.toBeTruthy`',
|
|
55
|
+
toBeFalsy: 'Avoid `toBeFalsy`',
|
|
56
|
+
toBeTruthy: 'Avoid `toBeTruthy`'
|
|
56
57
|
}
|
|
57
58
|
],
|
|
58
59
|
'jest/no-standalone-expect': 'error',
|
package/jsdoc-config.js
CHANGED
|
@@ -35,10 +35,11 @@ module.exports = {
|
|
|
35
35
|
'jsdoc/check-values': 'error', // Recommended
|
|
36
36
|
'jsdoc/empty-tags': 'error', // Recommended
|
|
37
37
|
'jsdoc/implements-on-classes': 'error', // Recommended
|
|
38
|
+
'jsdoc/informative-docs': 'error',
|
|
38
39
|
'jsdoc/match-description': 'error',
|
|
39
40
|
'jsdoc/multiline-blocks': 'error', // Recommended
|
|
40
|
-
'jsdoc/newline-after-description': 'error', // Recommended
|
|
41
41
|
'jsdoc/no-bad-blocks': 'error',
|
|
42
|
+
'jsdoc/no-blank-blocks': 'error',
|
|
42
43
|
'jsdoc/no-defaults': 'off',
|
|
43
44
|
'jsdoc/no-missing-syntax': 'off',
|
|
44
45
|
'jsdoc/no-multi-asterisks': 'error', // Recommended
|
|
@@ -46,8 +47,8 @@ module.exports = {
|
|
|
46
47
|
'jsdoc/no-types': 'off',
|
|
47
48
|
'jsdoc/no-undefined-types': 'error', // Recommended
|
|
48
49
|
'jsdoc/require-asterisk-prefix': 'error',
|
|
49
|
-
'jsdoc/require-description-complete-sentence': 'error',
|
|
50
50
|
'jsdoc/require-description': 'error',
|
|
51
|
+
'jsdoc/require-description-complete-sentence': 'error',
|
|
51
52
|
'jsdoc/require-example': 'off',
|
|
52
53
|
'jsdoc/require-file-overview': 'off',
|
|
53
54
|
'jsdoc/require-hyphen-before-param-description': ['error', 'never'],
|
|
@@ -64,23 +65,28 @@ module.exports = {
|
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
], // Recommended
|
|
68
|
+
'jsdoc/require-param': 'error', // Recommended
|
|
67
69
|
'jsdoc/require-param-description': 'error', // Recommended
|
|
68
70
|
'jsdoc/require-param-name': 'error', // Recommended
|
|
69
71
|
'jsdoc/require-param-type': 'error', // Recommended
|
|
70
|
-
'jsdoc/require-param': 'error', // Recommended
|
|
71
72
|
'jsdoc/require-property': 'error', // Recommended
|
|
72
73
|
'jsdoc/require-property-description': 'error', // Recommended
|
|
73
74
|
'jsdoc/require-property-name': 'error', // Recommended
|
|
74
75
|
'jsdoc/require-property-type': 'error', // Recommended
|
|
76
|
+
'jsdoc/require-returns': 'error', // Recommended
|
|
75
77
|
'jsdoc/require-returns-check': 'error', // Recommended
|
|
76
78
|
'jsdoc/require-returns-description': 'error', // Recommended
|
|
77
79
|
'jsdoc/require-returns-type': 'error', // Recommended
|
|
78
|
-
'jsdoc/require-
|
|
79
|
-
'jsdoc/require-throws': 'error', // Recommended
|
|
80
|
+
'jsdoc/require-throws': 'error',
|
|
80
81
|
'jsdoc/require-yields': 'error', // Recommended
|
|
81
82
|
'jsdoc/require-yields-check': 'error', // Recommended
|
|
82
83
|
'jsdoc/sort-tags': 'error',
|
|
83
|
-
'jsdoc/tag-lines':
|
|
84
|
+
'jsdoc/tag-lines': [
|
|
85
|
+
// Recommended
|
|
86
|
+
'error',
|
|
87
|
+
'never',
|
|
88
|
+
{ applyToEndTag: false, startLines: 1 }
|
|
89
|
+
],
|
|
84
90
|
'jsdoc/valid-types': 'error' // Recommended
|
|
85
91
|
}
|
|
86
92
|
};
|
package/node-config.js
CHANGED
|
@@ -37,8 +37,8 @@ module.exports = {
|
|
|
37
37
|
'n/prefer-global/process': ['error', 'always'],
|
|
38
38
|
'n/prefer-global/text-decoder': ['error', 'always'],
|
|
39
39
|
'n/prefer-global/text-encoder': ['error', 'always'],
|
|
40
|
-
'n/prefer-global/url-search-params': ['error', 'always'],
|
|
41
40
|
'n/prefer-global/url': ['error', 'always'],
|
|
41
|
+
'n/prefer-global/url-search-params': ['error', 'always'],
|
|
42
42
|
'n/prefer-promises/dns': 'error',
|
|
43
43
|
'n/prefer-promises/fs': 'error',
|
|
44
44
|
'n/process-exit-as-throw': 'error',
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aarongoldenthal/eslint-config-standard",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.0.0",
|
|
4
4
|
"description": "Standard ESLint configuration settings",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"hooks-pre-commit": "npm run lint && npm run prettier-check",
|
|
8
8
|
"hooks-pre-push": "npm audit --audit-level=high && npm test",
|
|
9
9
|
"lint": "npm run lint-js && npm run lint-md",
|
|
10
|
-
"lint-js": "eslint
|
|
11
|
-
"lint-md": "markdownlint **/*.md
|
|
10
|
+
"lint-js": "eslint .",
|
|
11
|
+
"lint-md": "markdownlint-cli2 \"**/*.md\" \"#node_modules\"",
|
|
12
12
|
"prettier-check": "prettier --check --ignore-path=.gitignore .",
|
|
13
13
|
"prettier-fix": "prettier --write --ignore-path=.gitignore .",
|
|
14
14
|
"test": "jest --ci"
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"author": "Aaron Goldenthal <npm@aarongoldenthal.com>",
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"engines": {
|
|
26
|
-
"node": "^
|
|
26
|
+
"node": "^16.13.0 || ^18.12.0 || >=20.0.0"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"index.js",
|
|
@@ -35,21 +35,22 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://gitlab.com/gitlab-ci-utils/eslint-config-standard",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"eslint-
|
|
38
|
+
"@eslint-community/eslint-plugin-eslint-comments": "3.2.1",
|
|
39
|
+
"eslint-config-prettier": "8.8.0",
|
|
39
40
|
"eslint-plugin-jest": "27.2.1",
|
|
40
|
-
"eslint-plugin-jsdoc": "
|
|
41
|
-
"eslint-plugin-n": "15.
|
|
41
|
+
"eslint-plugin-jsdoc": "44.2.3",
|
|
42
|
+
"eslint-plugin-n": "15.7.0",
|
|
42
43
|
"eslint-plugin-playwright": "0.12.0",
|
|
43
44
|
"eslint-plugin-promise": "6.1.1",
|
|
44
|
-
"eslint-plugin-sonarjs": "0.
|
|
45
|
-
"eslint-plugin-unicorn": "
|
|
45
|
+
"eslint-plugin-sonarjs": "0.19.0",
|
|
46
|
+
"eslint-plugin-unicorn": "47.0.0"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"eslint": "^8.
|
|
49
|
+
"eslint": "^8.40.0",
|
|
49
50
|
"jest": "^29.5.0",
|
|
50
|
-
"jest-junit": "^
|
|
51
|
-
"markdownlint-
|
|
52
|
-
"prettier": "^2.8.
|
|
51
|
+
"jest-junit": "^16.0.0",
|
|
52
|
+
"markdownlint-cli2": "^0.7.1",
|
|
53
|
+
"prettier": "^2.8.8"
|
|
53
54
|
},
|
|
54
55
|
"peerDependencies": {
|
|
55
56
|
"eslint": "^8.27.0"
|
package/playwright-config.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
module.exports = {
|
|
4
4
|
overrides: [
|
|
5
5
|
{
|
|
6
|
-
files: ['**/*.pwtest.[jt]s'],
|
|
7
|
-
plugins: ['playwright'],
|
|
8
6
|
env: {
|
|
9
7
|
'shared-node-browser': true
|
|
10
8
|
},
|
|
9
|
+
files: ['**/*.pwtest.[jt]s'],
|
|
10
|
+
plugins: ['playwright'],
|
|
11
11
|
rules: {
|
|
12
12
|
'playwright/max-nested-describe': 'error',
|
|
13
13
|
'playwright/missing-playwright-await': 'error',
|
package/promise-config.js
CHANGED
|
@@ -16,7 +16,7 @@ module.exports = {
|
|
|
16
16
|
'promise/no-return-wrap': 'error',
|
|
17
17
|
'promise/param-names': [
|
|
18
18
|
'error',
|
|
19
|
-
{
|
|
19
|
+
{ rejectPattern: '^reject$', resolvePattern: '^resolve$' }
|
|
20
20
|
],
|
|
21
21
|
'promise/prefer-await-to-callbacks': 'error',
|
|
22
22
|
'promise/prefer-await-to-then': 'error',
|
package/recommended.js
CHANGED
package/unicorn-config.js
CHANGED
|
@@ -1,107 +1,118 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
+
overrides: [
|
|
5
|
+
{
|
|
6
|
+
files: ['*.test.js'],
|
|
7
|
+
rules: {
|
|
8
|
+
// Tests utility functions are more readable when they are
|
|
9
|
+
// nested with the tests
|
|
10
|
+
'unicorn/consistent-function-scoping': 'off'
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
],
|
|
4
14
|
plugins: ['unicorn'],
|
|
5
15
|
rules: {
|
|
6
|
-
'unicorn/better-regex': 'error',
|
|
7
|
-
'unicorn/catch-error-name': 'error',
|
|
8
|
-
'unicorn/consistent-destructuring': 'error',
|
|
9
|
-
'unicorn/consistent-function-scoping': 'error',
|
|
16
|
+
'unicorn/better-regex': 'error', // Recommended
|
|
17
|
+
'unicorn/catch-error-name': 'error', // Recommended
|
|
18
|
+
'unicorn/consistent-destructuring': 'error', // Recommended
|
|
19
|
+
'unicorn/consistent-function-scoping': 'error', // Recommended
|
|
10
20
|
'unicorn/custom-error-definition': 'error',
|
|
11
|
-
'unicorn/empty-brace-spaces': 'off',
|
|
12
|
-
'unicorn/error-message': 'error',
|
|
13
|
-
'unicorn/escape-case': 'error',
|
|
14
|
-
'unicorn/expiring-todo-comments': 'off',
|
|
15
|
-
'unicorn/explicit-length-check': 'error',
|
|
16
|
-
'unicorn/filename-case': ['error', { case: 'kebabCase' }],
|
|
17
|
-
'unicorn/import-style': 'off',
|
|
18
|
-
'unicorn/new-for-builtins': 'error',
|
|
19
|
-
'unicorn/no-abusive-eslint-disable': 'error',
|
|
20
|
-
'unicorn/no-array-callback-reference': 'error',
|
|
21
|
-
'unicorn/no-array-for-each': 'error',
|
|
22
|
-
'unicorn/no-array-method-this-argument': 'off',
|
|
23
|
-
'unicorn/no-array-push-push': 'error',
|
|
24
|
-
'unicorn/no-array-reduce': 'error',
|
|
25
|
-
'unicorn/no-await-expression-member': 'error',
|
|
26
|
-
'unicorn/no-console-spaces': 'error',
|
|
27
|
-
'unicorn/no-document-cookie': 'error',
|
|
28
|
-
'unicorn/no-empty-file': 'error',
|
|
29
|
-
'unicorn/no-for-loop': 'error',
|
|
30
|
-
'unicorn/no-hex-escape': 'error',
|
|
31
|
-
'unicorn/no-instanceof-array': 'error',
|
|
32
|
-
'unicorn/no-invalid-remove-event-listener': 'error',
|
|
33
|
-
'unicorn/no-keyword-prefix': 'off',
|
|
34
|
-
'unicorn/no-lonely-if': 'error',
|
|
35
|
-
'unicorn/no-negated-condition': 'error',
|
|
36
|
-
'unicorn/no-nested-ternary': 'error',
|
|
37
|
-
'unicorn/no-new-array': 'error',
|
|
38
|
-
'unicorn/no-new-buffer': 'off',
|
|
39
|
-
'unicorn/no-null': 'error',
|
|
40
|
-
'unicorn/no-object-as-default-parameter': 'error',
|
|
41
|
-
'unicorn/no-process-exit': 'error',
|
|
42
|
-
'unicorn/no-static-only-class': 'error',
|
|
43
|
-
'unicorn/no-thenable': 'error',
|
|
44
|
-
'unicorn/no-this-assignment': 'error',
|
|
45
|
-
'unicorn/no-typeof-undefined': 'error',
|
|
46
|
-
'unicorn/no-unnecessary-await': 'error',
|
|
47
|
-
'unicorn/no-unreadable-array-destructuring': 'error',
|
|
48
|
-
'unicorn/no-unreadable-iife': 'error',
|
|
21
|
+
'unicorn/empty-brace-spaces': 'off', // Recommended, Prettier
|
|
22
|
+
'unicorn/error-message': 'error', // Recommended
|
|
23
|
+
'unicorn/escape-case': 'error', // Recommended
|
|
24
|
+
'unicorn/expiring-todo-comments': 'off', // Recommended
|
|
25
|
+
'unicorn/explicit-length-check': 'error', // Recommended
|
|
26
|
+
'unicorn/filename-case': ['error', { case: 'kebabCase' }], // Recommended
|
|
27
|
+
'unicorn/import-style': 'off', // Recommended
|
|
28
|
+
'unicorn/new-for-builtins': 'error', // Recommended
|
|
29
|
+
'unicorn/no-abusive-eslint-disable': 'error', // Recommended
|
|
30
|
+
'unicorn/no-array-callback-reference': 'error', // Recommended
|
|
31
|
+
'unicorn/no-array-for-each': 'error', // Recommended
|
|
32
|
+
'unicorn/no-array-method-this-argument': 'off', // Recommended
|
|
33
|
+
'unicorn/no-array-push-push': 'error', // Recommended
|
|
34
|
+
'unicorn/no-array-reduce': 'error', // Recommended
|
|
35
|
+
'unicorn/no-await-expression-member': 'error', // Recommended
|
|
36
|
+
'unicorn/no-console-spaces': 'error', // Recommended
|
|
37
|
+
'unicorn/no-document-cookie': 'error', // Recommended
|
|
38
|
+
'unicorn/no-empty-file': 'error', // Recommended
|
|
39
|
+
'unicorn/no-for-loop': 'error', // Recommended
|
|
40
|
+
'unicorn/no-hex-escape': 'error', // Recommended
|
|
41
|
+
'unicorn/no-instanceof-array': 'error', // Recommended
|
|
42
|
+
'unicorn/no-invalid-remove-event-listener': 'error', // Recommended
|
|
43
|
+
'unicorn/no-keyword-prefix': 'off', // Recommended
|
|
44
|
+
'unicorn/no-lonely-if': 'error', // Recommended
|
|
45
|
+
'unicorn/no-negated-condition': 'error', // Recommended
|
|
46
|
+
'unicorn/no-nested-ternary': 'error', // Recommended, Prettier
|
|
47
|
+
'unicorn/no-new-array': 'error', // Recommended
|
|
48
|
+
'unicorn/no-new-buffer': 'off', // Recommended
|
|
49
|
+
'unicorn/no-null': 'error', // Recommended
|
|
50
|
+
'unicorn/no-object-as-default-parameter': 'error', // Recommended
|
|
51
|
+
'unicorn/no-process-exit': 'error', // Recommended
|
|
52
|
+
'unicorn/no-static-only-class': 'error', // Recommended
|
|
53
|
+
'unicorn/no-thenable': 'error', // Recommended
|
|
54
|
+
'unicorn/no-this-assignment': 'error', // Recommended
|
|
55
|
+
'unicorn/no-typeof-undefined': 'error', // Recommended
|
|
56
|
+
'unicorn/no-unnecessary-await': 'error', // Recommended
|
|
57
|
+
'unicorn/no-unreadable-array-destructuring': 'error', // Recommended
|
|
58
|
+
'unicorn/no-unreadable-iife': 'error', // Recommended
|
|
49
59
|
'unicorn/no-unsafe-regex': 'error',
|
|
50
60
|
'unicorn/no-unused-properties': 'error',
|
|
51
|
-
'unicorn/no-useless-fallback-in-spread': 'error',
|
|
52
|
-
'unicorn/no-useless-length-check': 'error',
|
|
53
|
-
'unicorn/no-useless-promise-resolve-reject': 'error',
|
|
54
|
-
'unicorn/no-useless-spread': 'error',
|
|
55
|
-
'unicorn/no-useless-switch-case': 'error',
|
|
56
|
-
'unicorn/no-useless-undefined': 'error',
|
|
57
|
-
'unicorn/no-zero-fractions': 'error',
|
|
58
|
-
'unicorn/number-literal-case': 'error',
|
|
59
|
-
'unicorn/numeric-separators-style': 'error',
|
|
60
|
-
'unicorn/prefer-add-event-listener': 'error',
|
|
61
|
-
'unicorn/prefer-array-find': 'error',
|
|
62
|
-
'unicorn/prefer-array-flat': 'error',
|
|
63
|
-
'unicorn/prefer-array-flat-map': 'error',
|
|
64
|
-
'unicorn/prefer-array-index-of': 'error',
|
|
65
|
-
'unicorn/prefer-array-some': 'error',
|
|
66
|
-
'unicorn/prefer-at': '
|
|
67
|
-
'unicorn/prefer-
|
|
68
|
-
'unicorn/prefer-
|
|
69
|
-
'unicorn/prefer-
|
|
70
|
-
'unicorn/prefer-
|
|
71
|
-
'unicorn/prefer-dom-node-
|
|
72
|
-
'unicorn/prefer-dom-node-
|
|
73
|
-
'unicorn/prefer-dom-node-
|
|
74
|
-
'unicorn/prefer-
|
|
75
|
-
'unicorn/prefer-
|
|
76
|
-
'unicorn/prefer-
|
|
61
|
+
'unicorn/no-useless-fallback-in-spread': 'error', // Recommended
|
|
62
|
+
'unicorn/no-useless-length-check': 'error', // Recommended
|
|
63
|
+
'unicorn/no-useless-promise-resolve-reject': 'error', // Recommended
|
|
64
|
+
'unicorn/no-useless-spread': 'error', // Recommended
|
|
65
|
+
'unicorn/no-useless-switch-case': 'error', // Recommended
|
|
66
|
+
'unicorn/no-useless-undefined': 'error', // Recommended
|
|
67
|
+
'unicorn/no-zero-fractions': 'error', // Recommended
|
|
68
|
+
'unicorn/number-literal-case': 'error', // Prettier // Recommended
|
|
69
|
+
'unicorn/numeric-separators-style': 'error', // Recommended
|
|
70
|
+
'unicorn/prefer-add-event-listener': 'error', // Recommended
|
|
71
|
+
'unicorn/prefer-array-find': 'error', // Recommended
|
|
72
|
+
'unicorn/prefer-array-flat': 'error', // Recommended
|
|
73
|
+
'unicorn/prefer-array-flat-map': 'error', // Recommended
|
|
74
|
+
'unicorn/prefer-array-index-of': 'error', // Recommended
|
|
75
|
+
'unicorn/prefer-array-some': 'error', // Recommended
|
|
76
|
+
'unicorn/prefer-at': 'error', // Recommended
|
|
77
|
+
'unicorn/prefer-blob-reading-methods': 'error', // Recommended
|
|
78
|
+
'unicorn/prefer-code-point': 'error', // Recommended
|
|
79
|
+
'unicorn/prefer-date-now': 'error', // Recommended
|
|
80
|
+
'unicorn/prefer-default-parameters': 'error', // Recommended
|
|
81
|
+
'unicorn/prefer-dom-node-append': 'error', // Recommended
|
|
82
|
+
'unicorn/prefer-dom-node-dataset': 'error', // Recommended
|
|
83
|
+
'unicorn/prefer-dom-node-remove': 'error', // Recommended
|
|
84
|
+
'unicorn/prefer-dom-node-text-content': 'error', // Recommended
|
|
85
|
+
'unicorn/prefer-event-target': 'error', // Recommended
|
|
86
|
+
'unicorn/prefer-export-from': 'off', // Recommended
|
|
87
|
+
'unicorn/prefer-includes': 'error', // Recommended
|
|
77
88
|
'unicorn/prefer-json-parse-buffer': 'off',
|
|
78
|
-
'unicorn/prefer-keyboard-event-key': 'error',
|
|
79
|
-
'unicorn/prefer-logical-operator-over-ternary': 'error',
|
|
80
|
-
'unicorn/prefer-math-trunc': 'off',
|
|
81
|
-
'unicorn/prefer-modern-dom-apis': 'error',
|
|
82
|
-
'unicorn/prefer-modern-math-apis': 'error',
|
|
83
|
-
'unicorn/prefer-module': 'off',
|
|
84
|
-
'unicorn/prefer-native-coercion-functions': 'error',
|
|
85
|
-
'unicorn/prefer-negative-index': 'error',
|
|
86
|
-
'unicorn/prefer-node-protocol': 'off',
|
|
87
|
-
'unicorn/prefer-number-properties': 'error',
|
|
88
|
-
'unicorn/prefer-object-from-entries': 'off',
|
|
89
|
-
'unicorn/prefer-optional-catch-binding': 'error',
|
|
90
|
-
'unicorn/prefer-prototype-methods': 'off',
|
|
91
|
-
'unicorn/prefer-query-selector': 'error',
|
|
92
|
-
'unicorn/prefer-reflect-apply': 'off',
|
|
93
|
-
'unicorn/prefer-regexp-test': 'error',
|
|
94
|
-
'unicorn/prefer-set-has': 'error',
|
|
95
|
-
'unicorn/prefer-set-size': 'error',
|
|
96
|
-
'unicorn/prefer-spread': 'error',
|
|
97
|
-
'unicorn/prefer-string-replace-all': '
|
|
98
|
-
'unicorn/prefer-string-slice': 'error',
|
|
99
|
-
'unicorn/prefer-string-starts-ends-with': 'error',
|
|
100
|
-
'unicorn/prefer-string-trim-start-end': 'error',
|
|
101
|
-
'unicorn/prefer-switch': 'error',
|
|
102
|
-
'unicorn/prefer-ternary': 'error',
|
|
103
|
-
'unicorn/prefer-top-level-await': 'off',
|
|
104
|
-
'unicorn/prefer-type-error': 'error',
|
|
89
|
+
'unicorn/prefer-keyboard-event-key': 'error', // Recommended
|
|
90
|
+
'unicorn/prefer-logical-operator-over-ternary': 'error', // Recommended
|
|
91
|
+
'unicorn/prefer-math-trunc': 'off', // Recommended
|
|
92
|
+
'unicorn/prefer-modern-dom-apis': 'error', // Recommended
|
|
93
|
+
'unicorn/prefer-modern-math-apis': 'error', // Recommended
|
|
94
|
+
'unicorn/prefer-module': 'off', // Recommended
|
|
95
|
+
'unicorn/prefer-native-coercion-functions': 'error', // Recommended
|
|
96
|
+
'unicorn/prefer-negative-index': 'error', // Recommended
|
|
97
|
+
'unicorn/prefer-node-protocol': 'off', // Recommended
|
|
98
|
+
'unicorn/prefer-number-properties': 'error', // Recommended
|
|
99
|
+
'unicorn/prefer-object-from-entries': 'off', // Recommended
|
|
100
|
+
'unicorn/prefer-optional-catch-binding': 'error', // Recommended
|
|
101
|
+
'unicorn/prefer-prototype-methods': 'off', // Recommended
|
|
102
|
+
'unicorn/prefer-query-selector': 'error', // Recommended
|
|
103
|
+
'unicorn/prefer-reflect-apply': 'off', // Recommended
|
|
104
|
+
'unicorn/prefer-regexp-test': 'error', // Recommended
|
|
105
|
+
'unicorn/prefer-set-has': 'error', // Recommended
|
|
106
|
+
'unicorn/prefer-set-size': 'error', // Recommended
|
|
107
|
+
'unicorn/prefer-spread': 'error', // Recommended
|
|
108
|
+
'unicorn/prefer-string-replace-all': 'error', // Recommended
|
|
109
|
+
'unicorn/prefer-string-slice': 'error', // Recommended
|
|
110
|
+
'unicorn/prefer-string-starts-ends-with': 'error', // Recommended
|
|
111
|
+
'unicorn/prefer-string-trim-start-end': 'error', // Recommended
|
|
112
|
+
'unicorn/prefer-switch': 'error', // Recommended
|
|
113
|
+
'unicorn/prefer-ternary': 'error', // Recommended
|
|
114
|
+
'unicorn/prefer-top-level-await': 'off', // Recommended
|
|
115
|
+
'unicorn/prefer-type-error': 'error', // Recommended
|
|
105
116
|
'unicorn/prevent-abbreviations': [
|
|
106
117
|
'error',
|
|
107
118
|
{
|
|
@@ -112,23 +123,15 @@ module.exports = {
|
|
|
112
123
|
pkg: true
|
|
113
124
|
}
|
|
114
125
|
}
|
|
115
|
-
],
|
|
116
|
-
'unicorn/relative-url-style': 'error',
|
|
117
|
-
'unicorn/require-array-join-separator': 'error',
|
|
118
|
-
'unicorn/require-number-to-fixed-digits-argument': 'error',
|
|
126
|
+
], // Recommended
|
|
127
|
+
'unicorn/relative-url-style': 'error', // Recommended
|
|
128
|
+
'unicorn/require-array-join-separator': 'error', // Recommended
|
|
129
|
+
'unicorn/require-number-to-fixed-digits-argument': 'error', // Recommended
|
|
119
130
|
'unicorn/require-post-message-target-origin': 'off',
|
|
120
131
|
'unicorn/string-content': 'off',
|
|
121
|
-
'unicorn/switch-case-braces': ['error', 'always'],
|
|
122
|
-
'unicorn/template-indent': 'off',
|
|
123
|
-
'unicorn/text-encoding-identifier-case': 'error',
|
|
124
|
-
'unicorn/throw-new-error': 'error'
|
|
125
|
-
}
|
|
126
|
-
overrides: [
|
|
127
|
-
{
|
|
128
|
-
files: ['*.test.js'],
|
|
129
|
-
rules: {
|
|
130
|
-
'unicorn/consistent-function-scoping': 'off'
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
]
|
|
132
|
+
'unicorn/switch-case-braces': ['error', 'always'], // Recommended
|
|
133
|
+
'unicorn/template-indent': 'off', // Recommended
|
|
134
|
+
'unicorn/text-encoding-identifier-case': 'error', // Recommended
|
|
135
|
+
'unicorn/throw-new-error': 'error' // Recommended
|
|
136
|
+
}
|
|
134
137
|
};
|