@ornikar/eslint-config 22.7.3 → 22.7.4
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/CHANGELOG.md +8 -0
- package/README.md +62 -33
- package/_shared.js +9 -11
- package/graphql.js +12 -10
- package/index.js +24 -16
- package/node-module-override.js +12 -6
- package/node.js +5 -3
- package/package.json +4 -3
- package/rollup.js +9 -5
- package/root.js +17 -14
- package/rules/best-practices.js +11 -9
- package/rules/imports.js +10 -8
- package/rules/jest.js +13 -7
- package/rules/node-override.js +25 -23
- package/rules/node.js +28 -32
- package/rules/ornikar.js +8 -4
- package/rules/prettier.js +13 -10
- package/rules/security.js +21 -19
- package/rules/sort-imports-exports.js +15 -11
- package/rules/style.js +33 -31
- package/rules/unicorn.js +218 -214
- package/tests-override.js +17 -18
- package/.eslintrc.json +0 -4
package/rules/unicorn.js
CHANGED
|
@@ -1,58 +1,61 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
plugins: ['unicorn'],
|
|
5
|
-
rules: {
|
|
6
|
-
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/catch-error-name.md
|
|
7
|
-
'unicorn/catch-error-name': 'error',
|
|
3
|
+
const unicornPlugin = require('eslint-plugin-unicorn');
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
module.exports = [
|
|
6
|
+
{
|
|
7
|
+
plugins: { unicorn: unicornPlugin },
|
|
8
|
+
rules: {
|
|
9
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/catch-error-name.md
|
|
10
|
+
'unicorn/catch-error-name': 'error',
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/explicit-length-check.md
|
|
13
|
+
'unicorn/explicit-length-check': 'error',
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md
|
|
16
|
+
'unicorn/filename-case': 'off',
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-abusive-eslint-disable.md
|
|
19
|
+
'unicorn/no-abusive-eslint-disable': 'error',
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-process-exit.md
|
|
22
|
+
'unicorn/no-process-exit': 'error',
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/throw-new-error.md
|
|
25
|
+
'unicorn/throw-new-error': 'error',
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/number-literal-case.md
|
|
28
|
+
'unicorn/number-literal-case': 'error',
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/escape-case.md
|
|
31
|
+
'unicorn/escape-case': 'error',
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-instanceof-array.md
|
|
34
|
+
'unicorn/no-instanceof-array': 'error',
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-buffer.md
|
|
37
|
+
'unicorn/no-new-buffer': 'error',
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-hex-escape.md
|
|
40
|
+
'unicorn/no-hex-escape': 'error',
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/custom-error-definition.md
|
|
43
|
+
'unicorn/custom-error-definition': 'error',
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-starts-ends-with.md
|
|
46
|
+
'unicorn/prefer-string-starts-ends-with': 'error',
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-error.md
|
|
49
|
+
'unicorn/prefer-type-error': 'error',
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-keyboard-event-key.md
|
|
52
|
+
'unicorn/prefer-keyboard-event-key': 'off',
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-flat-map.md
|
|
55
|
+
'unicorn/prefer-array-flat-map': 'error',
|
|
56
|
+
|
|
57
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-callback-reference.md
|
|
58
|
+
/* Can cause issues:
|
|
56
59
|
```
|
|
57
60
|
const formTree = shallow(tree.find(FormWithApiCall).prop('children')());
|
|
58
61
|
```
|
|
@@ -63,262 +66,263 @@ results in:
|
|
|
63
66
|
const formTree = shallow(tree.find(x => FormWithApiCall(x)).prop('children')());
|
|
64
67
|
```
|
|
65
68
|
*/
|
|
66
|
-
|
|
69
|
+
'unicorn/no-array-callback-reference': 'off',
|
|
67
70
|
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/import-index.md
|
|
72
|
+
'unicorn/import-index': 'error',
|
|
70
73
|
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/new-for-builtins.md
|
|
75
|
+
'unicorn/new-for-builtins': 'error',
|
|
73
76
|
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/regex-shorthand.md
|
|
78
|
+
'unicorn/regex-shorthand': 'error',
|
|
76
79
|
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-spread.md
|
|
81
|
+
'unicorn/prefer-spread': 'error',
|
|
79
82
|
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/error-message.md
|
|
84
|
+
'unicorn/error-message': 'error',
|
|
82
85
|
|
|
83
|
-
|
|
84
|
-
|
|
86
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener.md
|
|
87
|
+
'unicorn/prefer-add-event-listener': 'error',
|
|
85
88
|
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-exponentiation-operator.md
|
|
90
|
+
'unicorn/prefer-exponentiation-operator': 'error',
|
|
88
91
|
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prevent-abbreviations.md
|
|
93
|
+
'unicorn/prevent-abbreviations': 'off',
|
|
91
94
|
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-for-loop.md
|
|
96
|
+
'unicorn/no-for-loop': 'off',
|
|
94
97
|
|
|
95
|
-
|
|
96
|
-
|
|
98
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-zero-fractions.md
|
|
99
|
+
'unicorn/no-zero-fractions': 'error',
|
|
97
100
|
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-includes.md
|
|
102
|
+
'unicorn/prefer-includes': 'error',
|
|
100
103
|
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-text-content.md
|
|
105
|
+
'unicorn/prefer-dom-node-text-content': 'error',
|
|
103
106
|
|
|
104
|
-
|
|
105
|
-
|
|
107
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-remove.md
|
|
108
|
+
'unicorn/prefer-node-remove': 'error',
|
|
106
109
|
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-keyword-prefix.md
|
|
111
|
+
'unicorn/no-keyword-prefix': 'off',
|
|
109
112
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
113
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/expiring-todo-comments.md
|
|
114
|
+
'unicorn/expiring-todo-comments': [
|
|
115
|
+
'error',
|
|
116
|
+
{
|
|
117
|
+
allowWarningComments: false,
|
|
118
|
+
ignoreDatesOnPullRequests: true,
|
|
119
|
+
ignore: [
|
|
120
|
+
/(\[https:\/\/ornikar.atlassian.net\/browse\/[A-Z]+-\d+])/i, // JIRA issue format (ex: https://ornikar.atlassian.net/browse/DR-123)
|
|
121
|
+
// TODO [eslint-plugin-unicorn>=64]: remove both lines. This is a known bug where Unicorn flags lowercase and every other todo as errors (https://github.com/sindresorhus/eslint-plugin-unicorn/pull/2828).
|
|
122
|
+
/^\s*eslint-(?:disable|enable)/,
|
|
123
|
+
/github\.com\/sindresorhus\/eslint-plugin-unicorn/,
|
|
124
|
+
],
|
|
125
|
+
date: '9999-12-31', // invalidates all expiring dates <9999-12-31
|
|
126
|
+
},
|
|
127
|
+
],
|
|
125
128
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-nested-ternary.md
|
|
130
|
+
'no-nested-ternary': 'off',
|
|
131
|
+
'unicorn/no-nested-ternary': 'error',
|
|
129
132
|
|
|
130
|
-
|
|
131
|
-
|
|
133
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-function-scoping.md
|
|
134
|
+
'unicorn/consistent-function-scoping': 'off',
|
|
132
135
|
|
|
133
|
-
|
|
134
|
-
|
|
136
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-reflect-apply.md
|
|
137
|
+
'unicorn/prefer-reflect-apply': 'off',
|
|
135
138
|
|
|
136
|
-
|
|
137
|
-
|
|
139
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-dataset.md
|
|
140
|
+
'unicorn/prefer-dom-node-dataset': 'error',
|
|
138
141
|
|
|
139
|
-
|
|
140
|
-
|
|
142
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-slice.md
|
|
143
|
+
'unicorn/prefer-string-slice': 'error',
|
|
141
144
|
|
|
142
|
-
|
|
143
|
-
|
|
145
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-trim-start-end.md
|
|
146
|
+
'unicorn/prefer-string-trim-start-end': 'error',
|
|
144
147
|
|
|
145
|
-
|
|
146
|
-
|
|
148
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-negative-index.md
|
|
149
|
+
'unicorn/prefer-negative-index': 'error',
|
|
147
150
|
|
|
148
|
-
|
|
151
|
+
/* Decide to enable or not */
|
|
149
152
|
|
|
150
|
-
|
|
151
|
-
|
|
153
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-dom-apis.md
|
|
154
|
+
'unicorn/prefer-modern-dom-apis': 'off',
|
|
152
155
|
|
|
153
|
-
|
|
154
|
-
|
|
156
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-replace-all.md
|
|
157
|
+
'unicorn/prefer-string-replace-all': 'off',
|
|
155
158
|
|
|
156
|
-
|
|
157
|
-
|
|
159
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/string-content.md
|
|
160
|
+
'unicorn/string-content': 'off',
|
|
158
161
|
|
|
159
|
-
|
|
160
|
-
|
|
162
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-number-properties.md
|
|
163
|
+
'unicorn/prefer-number-properties': 'off',
|
|
161
164
|
|
|
162
|
-
|
|
163
|
-
|
|
165
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-set-has.md
|
|
166
|
+
'unicorn/prefer-set-has': 'off',
|
|
164
167
|
|
|
165
|
-
|
|
166
|
-
|
|
168
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-optional-catch-binding.md
|
|
169
|
+
'unicorn/prefer-optional-catch-binding': 'off',
|
|
167
170
|
|
|
168
|
-
|
|
169
|
-
|
|
171
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-undefined.md
|
|
172
|
+
'unicorn/no-useless-undefined': 'off',
|
|
170
173
|
|
|
171
|
-
|
|
172
|
-
|
|
174
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-find.md
|
|
175
|
+
'unicorn/prefer-array-find': 'off',
|
|
173
176
|
|
|
174
|
-
|
|
175
|
-
|
|
177
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-reduce.md
|
|
178
|
+
'unicorn/no-array-reduce': ['error', { allowSimpleOperations: true }],
|
|
176
179
|
|
|
177
|
-
|
|
178
|
-
|
|
180
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/import-style.md
|
|
181
|
+
'unicorn/import-style': 'off',
|
|
179
182
|
|
|
180
|
-
|
|
181
|
-
|
|
183
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-trunc.md
|
|
184
|
+
'unicorn/prefer-math-trunc': 'off',
|
|
182
185
|
|
|
183
|
-
|
|
184
|
-
|
|
186
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/numeric-separators-style.md
|
|
187
|
+
'unicorn/numeric-separators-style': 'off',
|
|
185
188
|
|
|
186
|
-
|
|
187
|
-
|
|
189
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-ternary.md
|
|
190
|
+
'unicorn/prefer-ternary': 'off',
|
|
188
191
|
|
|
189
|
-
|
|
190
|
-
|
|
192
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-lonely-if.md
|
|
193
|
+
'unicorn/no-lonely-if': 'off',
|
|
191
194
|
|
|
192
|
-
|
|
193
|
-
|
|
195
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/empty-brace-spaces.md
|
|
196
|
+
'unicorn/empty-brace-spaces': 'off',
|
|
194
197
|
|
|
195
|
-
|
|
196
|
-
|
|
198
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-date-now.md
|
|
199
|
+
'unicorn/prefer-date-now': 'error',
|
|
197
200
|
|
|
198
|
-
|
|
199
|
-
|
|
201
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-some.md
|
|
202
|
+
'unicorn/prefer-array-some': 'error',
|
|
200
203
|
|
|
201
|
-
|
|
202
|
-
|
|
204
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-default-parameters.md
|
|
205
|
+
'unicorn/prefer-default-parameters': 'error',
|
|
203
206
|
|
|
204
|
-
|
|
205
|
-
|
|
207
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-array.md
|
|
208
|
+
'unicorn/no-new-array': 'error',
|
|
206
209
|
|
|
207
|
-
|
|
208
|
-
|
|
210
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-index-of.md
|
|
211
|
+
'unicorn/prefer-array-index-of': 'error',
|
|
209
212
|
|
|
210
|
-
|
|
211
|
-
|
|
213
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-regexp-test.md
|
|
214
|
+
'unicorn/prefer-regexp-test': 'error',
|
|
212
215
|
|
|
213
|
-
|
|
214
|
-
|
|
216
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-destructuring.md
|
|
217
|
+
'unicorn/consistent-destructuring': 'off',
|
|
215
218
|
|
|
216
|
-
|
|
217
|
-
|
|
219
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-for-each.md
|
|
220
|
+
'unicorn/no-array-for-each': 'off',
|
|
218
221
|
|
|
219
|
-
|
|
220
|
-
|
|
222
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-push-push.md
|
|
223
|
+
'unicorn/no-array-push-push': 'error',
|
|
221
224
|
|
|
222
|
-
|
|
223
|
-
|
|
225
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-this-assignment.md
|
|
226
|
+
'unicorn/no-this-assignment': 'off',
|
|
224
227
|
|
|
225
|
-
|
|
226
|
-
|
|
228
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-static-only-class.md
|
|
229
|
+
'unicorn/no-static-only-class': 'off',
|
|
227
230
|
|
|
228
|
-
|
|
229
|
-
|
|
231
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-flat.md
|
|
232
|
+
'unicorn/prefer-array-flat': 'off',
|
|
230
233
|
|
|
231
|
-
|
|
232
|
-
|
|
234
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-switch.md
|
|
235
|
+
'unicorn/prefer-switch': 'error',
|
|
233
236
|
|
|
234
|
-
|
|
235
|
-
|
|
237
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
|
|
238
|
+
'unicorn/prefer-node-protocol': 'error',
|
|
236
239
|
|
|
237
|
-
|
|
238
|
-
|
|
240
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-module.md
|
|
241
|
+
'unicorn/prefer-module': 'off',
|
|
239
242
|
|
|
240
|
-
|
|
241
|
-
|
|
243
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-at.md
|
|
244
|
+
'unicorn/prefer-at': 'off',
|
|
242
245
|
|
|
243
|
-
|
|
244
|
-
|
|
246
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-empty-file.md
|
|
247
|
+
'unicorn/no-empty-file': 'off',
|
|
245
248
|
|
|
246
|
-
|
|
247
|
-
|
|
249
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-export-from.md
|
|
250
|
+
'unicorn/prefer-export-from': 'error',
|
|
248
251
|
|
|
249
|
-
|
|
250
|
-
|
|
252
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-code-point.md
|
|
253
|
+
'unicorn/prefer-code-point': 'error',
|
|
251
254
|
|
|
252
|
-
|
|
253
|
-
|
|
255
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-await-expression-member.md
|
|
256
|
+
'unicorn/no-await-expression-member': 'off',
|
|
254
257
|
|
|
255
|
-
|
|
256
|
-
|
|
258
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-await.md
|
|
259
|
+
'unicorn/no-unnecessary-await': 'error',
|
|
257
260
|
|
|
258
|
-
|
|
259
|
-
|
|
261
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-object-from-entries.md
|
|
262
|
+
'unicorn/prefer-object-from-entries': 'error',
|
|
260
263
|
|
|
261
|
-
|
|
262
|
-
|
|
264
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-spread.md
|
|
265
|
+
'unicorn/no-useless-spread': 'error',
|
|
263
266
|
|
|
264
|
-
|
|
265
|
-
|
|
267
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-length-check.md
|
|
268
|
+
'unicorn/no-useless-length-check': 'error',
|
|
266
269
|
|
|
267
|
-
|
|
268
|
-
|
|
270
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-fallback-in-spread.md
|
|
271
|
+
'unicorn/no-useless-fallback-in-spread': 'error',
|
|
269
272
|
|
|
270
|
-
|
|
271
|
-
|
|
273
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-array-join-separator.md
|
|
274
|
+
'unicorn/require-array-join-separator': 'error',
|
|
272
275
|
|
|
273
|
-
|
|
274
|
-
|
|
276
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-thenable.md
|
|
277
|
+
'unicorn/no-thenable': 'error',
|
|
275
278
|
|
|
276
|
-
|
|
277
|
-
|
|
279
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-promise-resolve-reject.md
|
|
280
|
+
'unicorn/no-useless-promise-resolve-reject': 'error',
|
|
278
281
|
|
|
279
|
-
|
|
280
|
-
|
|
282
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/relative-url-style.md
|
|
283
|
+
'unicorn/relative-url-style': 'error',
|
|
281
284
|
|
|
282
|
-
|
|
283
|
-
|
|
285
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-json-parse-buffer.md
|
|
286
|
+
'unicorn/prefer-json-parse-buffer': 'error',
|
|
284
287
|
|
|
285
|
-
|
|
286
|
-
|
|
288
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/text-encoding-identifier-case.md
|
|
289
|
+
'unicorn/text-encoding-identifier-case': 'error',
|
|
287
290
|
|
|
288
|
-
|
|
289
|
-
|
|
291
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-switch-case.md
|
|
292
|
+
'unicorn/no-useless-switch-case': 'off',
|
|
290
293
|
|
|
291
|
-
|
|
292
|
-
|
|
294
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-math-apis.md
|
|
295
|
+
'unicorn/prefer-modern-math-apis': 'error',
|
|
293
296
|
|
|
294
|
-
|
|
295
|
-
|
|
297
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-iife.md
|
|
298
|
+
'unicorn/no-unreadable-iife': 'error',
|
|
296
299
|
|
|
297
|
-
|
|
298
|
-
|
|
300
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-native-coercion-functions.md
|
|
301
|
+
'unicorn/prefer-native-coercion-functions': 'error',
|
|
299
302
|
|
|
300
|
-
|
|
301
|
-
|
|
303
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-logical-operator-over-ternary.md
|
|
304
|
+
'unicorn/prefer-logical-operator-over-ternary': 'error',
|
|
302
305
|
|
|
303
|
-
|
|
304
|
-
|
|
306
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-method-this-argument.md
|
|
307
|
+
'unicorn/no-array-method-this-argument': 'error',
|
|
305
308
|
|
|
306
|
-
|
|
307
|
-
|
|
309
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-remove-event-listener.md
|
|
310
|
+
'unicorn/no-invalid-remove-event-listener': 'error',
|
|
308
311
|
|
|
309
|
-
|
|
310
|
-
|
|
312
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-number-to-fixed-digits-argument.md
|
|
313
|
+
'unicorn/require-number-to-fixed-digits-argument': 'error',
|
|
311
314
|
|
|
312
|
-
|
|
313
|
-
|
|
315
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-typeof-undefined.md
|
|
316
|
+
'unicorn/no-typeof-undefined': 'error',
|
|
314
317
|
|
|
315
|
-
|
|
316
|
-
|
|
318
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-negated-condition.md
|
|
319
|
+
'unicorn/no-negated-condition': 'off',
|
|
317
320
|
|
|
318
|
-
|
|
319
|
-
|
|
321
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-set-size.md
|
|
322
|
+
'unicorn/prefer-set-size': 'off',
|
|
320
323
|
|
|
321
|
-
|
|
322
|
-
|
|
324
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-blob-reading-methods.md
|
|
325
|
+
'unicorn/prefer-blob-reading-methods': 'off',
|
|
326
|
+
},
|
|
323
327
|
},
|
|
324
|
-
|
|
328
|
+
];
|
package/tests-override.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
env: {
|
|
5
|
-
jest: true,
|
|
6
|
-
},
|
|
7
|
-
|
|
8
|
-
extends: ['./rules/jest'].map(require.resolve),
|
|
3
|
+
const jestConfig = require('./rules/jest');
|
|
9
4
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
module.exports = [
|
|
6
|
+
...jestConfig,
|
|
7
|
+
{
|
|
8
|
+
rules: {
|
|
9
|
+
// Allow to use devDependencies
|
|
10
|
+
'import/no-extraneous-dependencies': [
|
|
11
|
+
'error',
|
|
12
|
+
{
|
|
13
|
+
devDependencies: true,
|
|
14
|
+
},
|
|
15
|
+
],
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
// Allow non-literal fs filename for tests
|
|
18
|
+
'security/detect-non-literal-fs-filename': 'off',
|
|
19
|
+
'security/detect-non-literal-require': 'off',
|
|
20
|
+
},
|
|
22
21
|
},
|
|
23
|
-
|
|
22
|
+
];
|
package/.eslintrc.json
DELETED