@pob/eslint-config 56.0.0 → 57.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/CHANGELOG.md +24 -1
- package/lib/_base.js +39 -15
- package/lib/base/commonjs.js +8 -4
- package/lib/base/module.js +22 -4
- package/lib/index.js +67 -13
- package/lib/node/_base.js +10 -18
- package/lib/node/commonjs.js +13 -23
- package/lib/node/module.js +21 -30
- package/lib/plugins/import/import-base.js +105 -72
- package/lib/plugins/import/import-commonjs.js +1 -3
- package/lib/plugins/import/import-module.js +1 -3
- package/lib/plugins/unicorn.js +238 -239
- package/lib/rules/best-practices.js +11 -5
- package/lib/rules/code-quality.js +1 -3
- package/lib/rules/dev-only.js +3 -3
- package/lib/rules/errors.js +1 -3
- package/lib/rules/style.js +1 -3
- package/package.json +9 -8
- package/utils.js +1 -3
- package/lib/.eslintrc.json +0 -4
- package/lib/node-commonjs.js +0 -25
- package/lib/node-module.js +0 -25
- package/lib/root-commonjs.js +0 -6
- package/lib/root-module.js +0 -6
- package/lib/rules/modules/base.js +0 -8
- package/lib/rules/modules/commonjs.js +0 -11
- package/lib/rules/modules/esm.js +0 -25
package/lib/plugins/unicorn.js
CHANGED
|
@@ -1,350 +1,349 @@
|
|
|
1
|
-
|
|
1
|
+
import eslintPluginUnicorn from "eslint-plugin-unicorn";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
export default [
|
|
4
|
+
{
|
|
5
|
+
plugins: { unicorn: eslintPluginUnicorn },
|
|
6
|
+
rules: {
|
|
7
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/catch-error-name.md
|
|
8
|
+
"unicorn/catch-error-name": "error",
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/explicit-length-check.md
|
|
11
|
+
"unicorn/explicit-length-check": "error",
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/filename-case.md
|
|
14
|
+
"unicorn/filename-case": "off",
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-abusive-eslint-disable.md
|
|
17
|
+
"unicorn/no-abusive-eslint-disable": "error",
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-process-exit.md
|
|
20
|
+
"unicorn/no-process-exit": "error",
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/throw-new-error.md
|
|
23
|
+
"unicorn/throw-new-error": "error",
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/number-literal-case.md
|
|
26
|
+
"unicorn/number-literal-case": "error",
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/escape-case.md
|
|
29
|
+
"unicorn/escape-case": "error",
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-instanceof-array.md
|
|
32
|
+
"unicorn/no-instanceof-array": "error",
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-buffer.md
|
|
35
|
+
"unicorn/no-new-buffer": "error",
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-hex-escape.md
|
|
38
|
+
"unicorn/no-hex-escape": "error",
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/custom-error-definition.md
|
|
41
|
+
"unicorn/custom-error-definition": "error",
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-starts-ends-with.md
|
|
44
|
+
"unicorn/prefer-string-starts-ends-with": "error",
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-error.md
|
|
47
|
+
"unicorn/prefer-type-error": "error",
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-callback-reference.md
|
|
50
|
+
"unicorn/no-array-callback-reference": "off",
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/import-index.md
|
|
53
|
+
"unicorn/import-index": "error",
|
|
53
54
|
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/new-for-builtins.md
|
|
56
|
+
"unicorn/new-for-builtins": "error",
|
|
56
57
|
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/better-regex.md
|
|
59
|
+
"unicorn/better-regex": "error",
|
|
59
60
|
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-spread.md
|
|
62
|
+
"unicorn/prefer-spread": "error",
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/error-message.md
|
|
65
|
+
"unicorn/error-message": "error",
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-add-event-listener.md
|
|
68
|
+
"unicorn/prefer-add-event-listener": "error",
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-query-selector.md
|
|
71
|
+
"unicorn/prefer-query-selector": "off",
|
|
71
72
|
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-append.md
|
|
74
|
+
"unicorn/prefer-dom-node-append": "error",
|
|
74
75
|
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-remove.md
|
|
77
|
+
"unicorn/prefer-dom-node-remove": "error",
|
|
77
78
|
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unused-properties.md
|
|
80
|
+
"unicorn/no-unused-properties": "off",
|
|
80
81
|
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-array-destructuring.md
|
|
83
|
+
"unicorn/no-unreadable-array-destructuring": "off",
|
|
83
84
|
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-console-spaces.md
|
|
86
|
+
"unicorn/no-console-spaces": "off",
|
|
86
87
|
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prevent-abbreviations.md
|
|
89
|
+
"unicorn/prevent-abbreviations": "off",
|
|
89
90
|
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-for-loop.md
|
|
92
|
+
"unicorn/no-for-loop": "off",
|
|
92
93
|
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-zero-fractions.md
|
|
95
|
+
"unicorn/no-zero-fractions": "off",
|
|
95
96
|
|
|
96
|
-
|
|
97
|
-
|
|
97
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-includes.md
|
|
98
|
+
"unicorn/prefer-includes": "error",
|
|
98
99
|
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-text-content.md
|
|
101
|
+
"unicorn/prefer-dom-node-text-content": "error",
|
|
101
102
|
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-keyboard-event-key.md
|
|
104
|
+
"unicorn/prefer-keyboard-event-key": "off",
|
|
104
105
|
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-flat-map.md
|
|
107
|
+
"unicorn/prefer-array-flat-map": "error",
|
|
107
108
|
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-keyword-prefix.md
|
|
110
|
+
"unicorn/no-keyword-prefix": "off",
|
|
110
111
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/expiring-todo-comments.md
|
|
113
|
+
"unicorn/expiring-todo-comments": [
|
|
114
|
+
"error",
|
|
115
|
+
{
|
|
116
|
+
allowWarningComments: true,
|
|
117
|
+
},
|
|
118
|
+
],
|
|
118
119
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-nested-ternary.md
|
|
121
|
+
"no-nested-ternary": "off",
|
|
122
|
+
"unicorn/no-nested-ternary": "error",
|
|
122
123
|
|
|
123
|
-
|
|
124
|
-
|
|
124
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-function-scoping.md
|
|
125
|
+
"unicorn/consistent-function-scoping": "off",
|
|
125
126
|
|
|
126
|
-
|
|
127
|
-
|
|
127
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-reflect-apply.md
|
|
128
|
+
"unicorn/prefer-reflect-apply": "off",
|
|
128
129
|
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-dataset.md
|
|
131
|
+
"unicorn/prefer-dom-node-dataset": "error",
|
|
131
132
|
|
|
132
|
-
|
|
133
|
-
|
|
133
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-slice.md
|
|
134
|
+
"unicorn/prefer-string-slice": "error",
|
|
134
135
|
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-trim-start-end.md
|
|
137
|
+
"unicorn/prefer-string-trim-start-end": "error",
|
|
137
138
|
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-negative-index.md
|
|
140
|
+
"unicorn/prefer-negative-index": "error",
|
|
140
141
|
|
|
141
|
-
|
|
142
|
-
|
|
142
|
+
// https://github.com/sindr esorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-dom-apis.md
|
|
143
|
+
"unicorn/prefer-modern-dom-apis": "error",
|
|
143
144
|
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-replace-all.md
|
|
146
|
+
"unicorn/prefer-string-replace-all": "off",
|
|
146
147
|
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/string-content.md
|
|
149
|
+
"unicorn/string-content": "off",
|
|
149
150
|
|
|
150
|
-
|
|
151
|
-
|
|
151
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-number-properties.md
|
|
152
|
+
"unicorn/prefer-number-properties": "off",
|
|
152
153
|
|
|
153
|
-
|
|
154
|
-
|
|
154
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-set-has.md
|
|
155
|
+
"unicorn/prefer-set-has": "off",
|
|
155
156
|
|
|
156
|
-
|
|
157
|
-
|
|
157
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-optional-catch-binding.md
|
|
158
|
+
"unicorn/prefer-optional-catch-binding": "error",
|
|
158
159
|
|
|
159
|
-
|
|
160
|
-
|
|
160
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-undefined.md
|
|
161
|
+
"unicorn/no-useless-undefined": "off",
|
|
161
162
|
|
|
162
|
-
|
|
163
|
-
|
|
163
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-find.md
|
|
164
|
+
"unicorn/prefer-array-find": "error",
|
|
164
165
|
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-reduce.md
|
|
167
|
+
"unicorn/no-array-reduce": "error",
|
|
167
168
|
|
|
168
|
-
|
|
169
|
-
|
|
169
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/import-style.md
|
|
170
|
+
"unicorn/import-style": "off",
|
|
170
171
|
|
|
171
|
-
|
|
172
|
-
|
|
172
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-trunc.md
|
|
173
|
+
"unicorn/prefer-math-trunc": "error",
|
|
173
174
|
|
|
174
|
-
|
|
175
|
-
|
|
175
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/numeric-separators-style.md
|
|
176
|
+
"unicorn/numeric-separators-style": "error",
|
|
176
177
|
|
|
177
|
-
|
|
178
|
-
|
|
178
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-ternary.md
|
|
179
|
+
"unicorn/prefer-ternary": "off",
|
|
179
180
|
|
|
180
|
-
|
|
181
|
-
|
|
181
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-lonely-if.md
|
|
182
|
+
"unicorn/no-lonely-if": "off",
|
|
182
183
|
|
|
183
|
-
|
|
184
|
-
|
|
184
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/empty-brace-spaces.md
|
|
185
|
+
"unicorn/empty-brace-spaces": "off",
|
|
185
186
|
|
|
186
|
-
|
|
187
|
-
|
|
187
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-date-now.md
|
|
188
|
+
"unicorn/prefer-date-now": "error",
|
|
188
189
|
|
|
189
|
-
|
|
190
|
-
|
|
190
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-some.md
|
|
191
|
+
"unicorn/prefer-array-some": "error",
|
|
191
192
|
|
|
192
|
-
|
|
193
|
-
|
|
193
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-default-parameters.md
|
|
194
|
+
"unicorn/prefer-default-parameters": "error",
|
|
194
195
|
|
|
195
|
-
|
|
196
|
-
|
|
196
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-array.md
|
|
197
|
+
"unicorn/no-new-array": "error",
|
|
197
198
|
|
|
198
|
-
|
|
199
|
-
|
|
199
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-index-of.md
|
|
200
|
+
"unicorn/prefer-array-index-of": "error",
|
|
200
201
|
|
|
201
|
-
|
|
202
|
-
|
|
202
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-regexp-test.md
|
|
203
|
+
"unicorn/prefer-regexp-test": "error",
|
|
203
204
|
|
|
204
|
-
|
|
205
|
-
|
|
205
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-destructuring.md
|
|
206
|
+
"unicorn/consistent-destructuring": "off",
|
|
206
207
|
|
|
207
|
-
|
|
208
|
-
|
|
208
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-for-each.md
|
|
209
|
+
"unicorn/no-array-for-each": "off",
|
|
209
210
|
|
|
210
|
-
|
|
211
|
-
|
|
211
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-push-push.md
|
|
212
|
+
"unicorn/no-array-push-push": "error",
|
|
212
213
|
|
|
213
|
-
|
|
214
|
-
|
|
214
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-this-assignment.md
|
|
215
|
+
"unicorn/no-this-assignment": "error",
|
|
215
216
|
|
|
216
|
-
|
|
217
|
-
|
|
217
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-static-only-class.md
|
|
218
|
+
"unicorn/no-static-only-class": "error",
|
|
218
219
|
|
|
219
|
-
|
|
220
|
-
|
|
220
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-flat.md
|
|
221
|
+
"unicorn/prefer-array-flat": "error",
|
|
221
222
|
|
|
222
|
-
|
|
223
|
-
|
|
223
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-switch.md
|
|
224
|
+
"unicorn/prefer-switch": "error",
|
|
224
225
|
|
|
225
|
-
|
|
226
|
-
|
|
226
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
|
|
227
|
+
"unicorn/prefer-node-protocol": "error",
|
|
227
228
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
229
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-module.md
|
|
230
|
+
// unicorn/prefer-module is enabled in node configs.
|
|
231
|
+
"unicorn/prefer-module": "off",
|
|
231
232
|
|
|
232
|
-
|
|
233
|
-
|
|
233
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-document-cookie.md
|
|
234
|
+
"unicorn/no-document-cookie": "error",
|
|
234
235
|
|
|
235
|
-
|
|
236
|
-
|
|
236
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-array-join-separator.md
|
|
237
|
+
"unicorn/require-array-join-separator": "error",
|
|
237
238
|
|
|
238
|
-
|
|
239
|
-
|
|
239
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-number-to-fixed-digits-argument.md
|
|
240
|
+
"unicorn/require-number-to-fixed-digits-argument": "error",
|
|
240
241
|
|
|
241
|
-
|
|
242
|
-
|
|
242
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-prototype-methods.md
|
|
243
|
+
"unicorn/prefer-prototype-methods": "error",
|
|
243
244
|
|
|
244
|
-
|
|
245
|
-
|
|
245
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-object-has-own.md
|
|
246
|
+
"unicorn/prefer-object-has-own": "error",
|
|
246
247
|
|
|
247
|
-
|
|
248
|
-
|
|
248
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-method-this-argument.md
|
|
249
|
+
"unicorn/no-array-method-this-argument": "error",
|
|
249
250
|
|
|
250
|
-
|
|
251
|
-
|
|
251
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/require-post-message-target-origin.md
|
|
252
|
+
"unicorn/require-post-message-target-origin": "error",
|
|
252
253
|
|
|
253
|
-
|
|
254
|
-
|
|
254
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-top-level-await.md
|
|
255
|
+
"unicorn/prefer-top-level-await": "error",
|
|
255
256
|
|
|
256
|
-
|
|
257
|
-
|
|
257
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-at.md
|
|
258
|
+
"unicorn/prefer-at": "error",
|
|
258
259
|
|
|
259
|
-
|
|
260
|
-
|
|
260
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-object-from-entries.md
|
|
261
|
+
"unicorn/prefer-object-from-entries": "error",
|
|
261
262
|
|
|
262
|
-
|
|
263
|
-
|
|
263
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-length-check.md
|
|
264
|
+
"unicorn/no-useless-length-check": "error",
|
|
264
265
|
|
|
265
|
-
|
|
266
|
-
|
|
266
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-spread.md
|
|
267
|
+
"unicorn/no-useless-spread": "error",
|
|
267
268
|
|
|
268
|
-
|
|
269
|
-
|
|
269
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-fallback-in-spread.md
|
|
270
|
+
"unicorn/no-useless-fallback-in-spread": "error",
|
|
270
271
|
|
|
271
|
-
|
|
272
|
-
|
|
272
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-remove-event-listener.md
|
|
273
|
+
"unicorn/no-invalid-remove-event-listener": "error",
|
|
273
274
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
275
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/template-indent.md
|
|
276
|
+
// prettier does that
|
|
277
|
+
"unicorn/template-indent": "off",
|
|
277
278
|
|
|
278
|
-
|
|
279
|
-
|
|
279
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-empty-file.md
|
|
280
|
+
"unicorn/no-empty-file": "off",
|
|
280
281
|
|
|
281
|
-
|
|
282
|
-
|
|
282
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-export-from.md
|
|
283
|
+
"unicorn/prefer-export-from": "error",
|
|
283
284
|
|
|
284
|
-
|
|
285
|
-
|
|
285
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-code-point.md
|
|
286
|
+
"unicorn/prefer-code-point": "error",
|
|
286
287
|
|
|
287
|
-
|
|
288
|
-
|
|
288
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-await-expression-member.md
|
|
289
|
+
"unicorn/no-await-expression-member": "error",
|
|
289
290
|
|
|
290
|
-
|
|
291
|
-
|
|
291
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-thenable.md
|
|
292
|
+
"unicorn/no-thenable": "off",
|
|
292
293
|
|
|
293
|
-
|
|
294
|
-
|
|
294
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-promise-resolve-reject.md
|
|
295
|
+
"unicorn/no-useless-promise-resolve-reject": "error",
|
|
295
296
|
|
|
296
|
-
|
|
297
|
-
|
|
297
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/relative-url-style.md
|
|
298
|
+
"unicorn/relative-url-style": ["error", "always"],
|
|
298
299
|
|
|
299
|
-
|
|
300
|
-
|
|
300
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-json-parse-buffer.md
|
|
301
|
+
"unicorn/prefer-json-parse-buffer": "error",
|
|
301
302
|
|
|
302
|
-
|
|
303
|
-
|
|
303
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/text-encoding-identifier-case.md
|
|
304
|
+
"unicorn/text-encoding-identifier-case": "error",
|
|
304
305
|
|
|
305
|
-
|
|
306
|
-
|
|
306
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-native-coercion-functions.md
|
|
307
|
+
"unicorn/prefer-native-coercion-functions": "error",
|
|
307
308
|
|
|
308
|
-
|
|
309
|
-
|
|
309
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-iife.md
|
|
310
|
+
"unicorn/no-unreadable-iife": "error",
|
|
310
311
|
|
|
311
|
-
|
|
312
|
-
|
|
312
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-math-apis.md
|
|
313
|
+
"unicorn/prefer-modern-math-apis": "warn",
|
|
313
314
|
|
|
314
|
-
|
|
315
|
-
|
|
315
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-switch-case.md
|
|
316
|
+
"unicorn/no-useless-switch-case": "off",
|
|
316
317
|
|
|
317
|
-
|
|
318
|
-
|
|
318
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-logical-operator-over-ternary.md
|
|
319
|
+
"unicorn/prefer-logical-operator-over-ternary": "error",
|
|
319
320
|
|
|
320
|
-
|
|
321
|
-
|
|
321
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-event-target.md
|
|
322
|
+
"unicorn/prefer-event-target": "error",
|
|
322
323
|
|
|
323
|
-
|
|
324
|
-
|
|
324
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-await.md
|
|
325
|
+
"unicorn/no-unnecessary-await": "error",
|
|
325
326
|
|
|
326
|
-
|
|
327
|
-
|
|
327
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/switch-case-braces.md
|
|
328
|
+
"unicorn/switch-case-braces": "off",
|
|
328
329
|
|
|
329
|
-
|
|
330
|
-
|
|
330
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-typeof-undefined.md
|
|
331
|
+
"unicorn/no-typeof-undefined": "error",
|
|
331
332
|
|
|
332
|
-
|
|
333
|
-
|
|
333
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-negated-condition.md
|
|
334
|
+
"unicorn/no-negated-condition": "off",
|
|
334
335
|
|
|
335
|
-
|
|
336
|
-
|
|
336
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-set-size.md
|
|
337
|
+
"unicorn/prefer-set-size": "error",
|
|
337
338
|
|
|
338
|
-
|
|
339
|
-
|
|
339
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-blob-reading-methods.md
|
|
340
|
+
"unicorn/prefer-blob-reading-methods": "error",
|
|
341
|
+
},
|
|
340
342
|
},
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
{
|
|
344
|
-
|
|
345
|
-
rules: {
|
|
346
|
-
"unicorn/no-process-exit": "off",
|
|
347
|
-
},
|
|
343
|
+
{
|
|
344
|
+
files: ["scripts/**"],
|
|
345
|
+
rules: {
|
|
346
|
+
"unicorn/no-process-exit": "off",
|
|
348
347
|
},
|
|
349
|
-
|
|
350
|
-
|
|
348
|
+
},
|
|
349
|
+
];
|