@todesktop/dev-config 1.0.27 → 1.0.28
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 +102 -33
- package/eslint/configs/base.js +39 -5
- package/eslint/configs/data/console.js +47 -0
- package/eslint/configs/react.js +26 -13
- package/eslint/configs/reactStrict.js +10 -2
- package/eslint/configs/strict.js +27 -2
- package/eslint/configs/ts.js +15 -0
- package/eslint/configs/tsStrict.js +0 -15
- package/eslint/index.js +0 -1
- package/oxlint/configs/base.ts +721 -0
- package/oxlint/configs/browser.ts +5 -0
- package/oxlint/configs/data/globals.ts +18 -0
- package/oxlint/configs/esm.ts +20 -0
- package/oxlint/configs/jest.ts +6 -0
- package/oxlint/configs/node.ts +33 -0
- package/oxlint/configs/nodeCommonJs.ts +14 -0
- package/oxlint/configs/perfectionist.ts +126 -0
- package/oxlint/configs/react.ts +220 -0
- package/oxlint/configs/reactStrict.ts +45 -0
- package/oxlint/configs/strict.ts +482 -0
- package/oxlint/configs/ts.ts +147 -0
- package/oxlint/configs/tsStrict.ts +35 -0
- package/oxlint/configs/unicorn.ts +365 -0
- package/oxlint/configs/vitest.ts +6 -0
- package/oxlint/index.ts +104 -0
- package/oxlint.config.ts +11 -0
- package/package.json +12 -22
- package/tsconfig.base.json +11 -0
- package/tsconfig.json +5 -5
- package/CHANGELOG.md +0 -163
- package/eslint.config.mjs +0 -8
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
2
|
+
export default {
|
|
3
|
+
plugins: ['unicorn'],
|
|
4
|
+
rules: {
|
|
5
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/consistent-assert.html
|
|
6
|
+
'unicorn/consistent-assert': 'error',
|
|
7
|
+
|
|
8
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/consistent-date-clone.html
|
|
9
|
+
'unicorn/consistent-date-clone': 'error',
|
|
10
|
+
|
|
11
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/consistent-empty-array-spread.html
|
|
12
|
+
'unicorn/consistent-empty-array-spread': 'error',
|
|
13
|
+
|
|
14
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/consistent-existence-index-check.html
|
|
15
|
+
'unicorn/consistent-existence-index-check': 'error',
|
|
16
|
+
|
|
17
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/empty-brace-spaces.html
|
|
18
|
+
'unicorn/empty-brace-spaces': 'error',
|
|
19
|
+
|
|
20
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/error-message.html
|
|
21
|
+
'unicorn/error-message': 'error',
|
|
22
|
+
|
|
23
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/escape-case.html
|
|
24
|
+
'unicorn/escape-case': 'error',
|
|
25
|
+
|
|
26
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/expiring-todo-comments.html
|
|
27
|
+
'unicorn/expiring-todo-comments': 'error',
|
|
28
|
+
|
|
29
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/explicit-length-check.html
|
|
30
|
+
'unicorn/explicit-length-check': 'error',
|
|
31
|
+
|
|
32
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/import-style.html
|
|
33
|
+
'unicorn/import-style': 'error',
|
|
34
|
+
|
|
35
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/new-for-builtins.html
|
|
36
|
+
'unicorn/new-for-builtins': 'error',
|
|
37
|
+
|
|
38
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-abusive-eslint-disable.html
|
|
39
|
+
'unicorn/no-abusive-eslint-disable': 'error',
|
|
40
|
+
|
|
41
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-accessor-recursion.html
|
|
42
|
+
'unicorn/no-accessor-recursion': 'error',
|
|
43
|
+
|
|
44
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-anonymous-default-export.html
|
|
45
|
+
'unicorn/no-anonymous-default-export': 'error',
|
|
46
|
+
|
|
47
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-array-callback-reference.html
|
|
48
|
+
'unicorn/no-array-callback-reference': 'error',
|
|
49
|
+
|
|
50
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-array-for-each.html
|
|
51
|
+
'unicorn/no-array-for-each': 'error',
|
|
52
|
+
|
|
53
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-array-method-this-argument.html
|
|
54
|
+
'unicorn/no-array-method-this-argument': 'error',
|
|
55
|
+
|
|
56
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-array-reduce.html
|
|
57
|
+
'unicorn/no-array-reduce': 'error',
|
|
58
|
+
|
|
59
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-array-reverse.html
|
|
60
|
+
'unicorn/no-array-reverse': 'error',
|
|
61
|
+
|
|
62
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-array-sort.html
|
|
63
|
+
'unicorn/no-array-sort': 'error',
|
|
64
|
+
|
|
65
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-await-expression-member.html
|
|
66
|
+
'unicorn/no-await-expression-member': 'error',
|
|
67
|
+
|
|
68
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-await-in-promise-methods.html
|
|
69
|
+
'unicorn/no-await-in-promise-methods': 'error',
|
|
70
|
+
|
|
71
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-console-spaces.html
|
|
72
|
+
'unicorn/no-console-spaces': 'error',
|
|
73
|
+
|
|
74
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-document-cookie.html
|
|
75
|
+
'unicorn/no-document-cookie': 'error',
|
|
76
|
+
|
|
77
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-empty-file.html
|
|
78
|
+
'unicorn/no-empty-file': 'error',
|
|
79
|
+
|
|
80
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-for-loop.html
|
|
81
|
+
'unicorn/no-for-loop': 'error',
|
|
82
|
+
|
|
83
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-hex-escape.html
|
|
84
|
+
'unicorn/no-hex-escape': 'error',
|
|
85
|
+
|
|
86
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-instanceof-builtins.html
|
|
87
|
+
'unicorn/no-instanceof-builtins': 'error',
|
|
88
|
+
|
|
89
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-invalid-fetch-options.html
|
|
90
|
+
'unicorn/no-invalid-fetch-options': 'error',
|
|
91
|
+
|
|
92
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-invalid-remove-event-listener.html
|
|
93
|
+
'unicorn/no-invalid-remove-event-listener': 'error',
|
|
94
|
+
|
|
95
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-lonely-if.html
|
|
96
|
+
'unicorn/no-lonely-if': 'error',
|
|
97
|
+
|
|
98
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-magic-array-flat-depth.html
|
|
99
|
+
'unicorn/no-magic-array-flat-depth': 'error',
|
|
100
|
+
|
|
101
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-named-default.html
|
|
102
|
+
'unicorn/no-named-default': 'error',
|
|
103
|
+
|
|
104
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-negated-condition.md
|
|
105
|
+
'unicorn/no-negated-condition': 'error',
|
|
106
|
+
|
|
107
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-negation-in-equality-check.html
|
|
108
|
+
'unicorn/no-negation-in-equality-check': 'error',
|
|
109
|
+
|
|
110
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-nested-ternary.html
|
|
111
|
+
'unicorn/no-nested-ternary': 'error',
|
|
112
|
+
|
|
113
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-new-array.html
|
|
114
|
+
'unicorn/no-new-array': 'error',
|
|
115
|
+
|
|
116
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-new-buffer.html
|
|
117
|
+
'unicorn/no-new-buffer': 'error',
|
|
118
|
+
|
|
119
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-null.html
|
|
120
|
+
'unicorn/no-null': 'error',
|
|
121
|
+
|
|
122
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-object-as-default-parameter.html
|
|
123
|
+
'unicorn/no-object-as-default-parameter': 'error',
|
|
124
|
+
|
|
125
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-single-promise-in-promise-methods.html
|
|
126
|
+
'unicorn/no-single-promise-in-promise-methods': 'error',
|
|
127
|
+
|
|
128
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-static-only-class.html
|
|
129
|
+
'unicorn/no-static-only-class': 'error',
|
|
130
|
+
|
|
131
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-thenable.html
|
|
132
|
+
'unicorn/no-thenable': 'error',
|
|
133
|
+
|
|
134
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-this-assignment.html
|
|
135
|
+
'unicorn/no-this-assignment': 'error',
|
|
136
|
+
|
|
137
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-typeof-undefined.html
|
|
138
|
+
'unicorn/no-typeof-undefined': 'error',
|
|
139
|
+
|
|
140
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-unnecessary-array-flat-depth.html
|
|
141
|
+
'unicorn/no-unnecessary-array-flat-depth': 'error',
|
|
142
|
+
|
|
143
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-unnecessary-array-splice-count.html
|
|
144
|
+
'unicorn/no-unnecessary-array-splice-count': 'error',
|
|
145
|
+
|
|
146
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-unnecessary-polyfills.html
|
|
147
|
+
'unicorn/no-unnecessary-polyfills': 'error',
|
|
148
|
+
|
|
149
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-unnecessary-await.html
|
|
150
|
+
'unicorn/no-unnecessary-await': 'error',
|
|
151
|
+
|
|
152
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-unnecessary-slice-end.html
|
|
153
|
+
'unicorn/no-unnecessary-slice-end': 'error',
|
|
154
|
+
|
|
155
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-unreadable-array-destructuring.html
|
|
156
|
+
'unicorn/no-unreadable-array-destructuring': 'error',
|
|
157
|
+
|
|
158
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-unreadable-iife.html
|
|
159
|
+
'unicorn/no-unreadable-iife': 'error',
|
|
160
|
+
|
|
161
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-useless-error-capture-stack-trace.html
|
|
162
|
+
'unicorn/no-useless-error-capture-stack-trace': 'error',
|
|
163
|
+
|
|
164
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-useless-fallback-in-spread.html
|
|
165
|
+
'unicorn/no-useless-fallback-in-spread': 'error',
|
|
166
|
+
|
|
167
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-useless-length-check.html
|
|
168
|
+
'unicorn/no-useless-length-check': 'error',
|
|
169
|
+
|
|
170
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-useless-promise-resolve-reject.html
|
|
171
|
+
'unicorn/no-useless-promise-resolve-reject': 'error',
|
|
172
|
+
|
|
173
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-useless-spread.html
|
|
174
|
+
'unicorn/no-useless-spread': 'error',
|
|
175
|
+
|
|
176
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-useless-switch-case.html
|
|
177
|
+
'unicorn/no-useless-switch-case': 'error',
|
|
178
|
+
|
|
179
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/no-zero-fractions.html
|
|
180
|
+
'unicorn/no-zero-fractions': 'error',
|
|
181
|
+
|
|
182
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/number-literal-case.html
|
|
183
|
+
'unicorn/number-literal-case': 'error',
|
|
184
|
+
|
|
185
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/numeric-separators-style.html
|
|
186
|
+
'unicorn/numeric-separators-style': 'error',
|
|
187
|
+
|
|
188
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-add-event-listener.html
|
|
189
|
+
'unicorn/prefer-add-event-listener': 'error',
|
|
190
|
+
|
|
191
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-array-find.html
|
|
192
|
+
'unicorn/prefer-array-find': 'error',
|
|
193
|
+
|
|
194
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-array-flat.html
|
|
195
|
+
'unicorn/prefer-array-flat': 'error',
|
|
196
|
+
|
|
197
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-array-flat-map.html
|
|
198
|
+
'unicorn/prefer-array-flat-map': 'error',
|
|
199
|
+
|
|
200
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-array-index-of.html
|
|
201
|
+
'unicorn/prefer-array-index-of': 'error',
|
|
202
|
+
|
|
203
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-array-some.html
|
|
204
|
+
'unicorn/prefer-array-some': 'error',
|
|
205
|
+
|
|
206
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-at.html
|
|
207
|
+
'unicorn/prefer-at': 'error',
|
|
208
|
+
|
|
209
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-bigint-literals.html
|
|
210
|
+
'unicorn/prefer-bigint-literals': 'error',
|
|
211
|
+
|
|
212
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-blob-reading-methods.html
|
|
213
|
+
'unicorn/prefer-blob-reading-methods': 'error',
|
|
214
|
+
|
|
215
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-class-fields.html
|
|
216
|
+
'unicorn/prefer-class-fields': 'error',
|
|
217
|
+
|
|
218
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-classlist-toggle.html
|
|
219
|
+
'unicorn/prefer-classlist-toggle': 'error',
|
|
220
|
+
|
|
221
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-code-point.html
|
|
222
|
+
'unicorn/prefer-code-point': 'error',
|
|
223
|
+
|
|
224
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-date-now.html
|
|
225
|
+
'unicorn/prefer-date-now': 'error',
|
|
226
|
+
|
|
227
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-default-parameters.html
|
|
228
|
+
'unicorn/prefer-default-parameters': 'error',
|
|
229
|
+
|
|
230
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-dom-node-append.html
|
|
231
|
+
'unicorn/prefer-dom-node-append': 'error',
|
|
232
|
+
|
|
233
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-dom-node-dataset.html
|
|
234
|
+
'unicorn/prefer-dom-node-dataset': 'error',
|
|
235
|
+
|
|
236
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-dom-node-remove.html
|
|
237
|
+
'unicorn/prefer-dom-node-remove': 'error',
|
|
238
|
+
|
|
239
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-dom-node-text-content.html
|
|
240
|
+
'unicorn/prefer-dom-node-text-content': 'error',
|
|
241
|
+
|
|
242
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-event-target.html
|
|
243
|
+
'unicorn/prefer-event-target': 'error',
|
|
244
|
+
|
|
245
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-export-from.html
|
|
246
|
+
'unicorn/prefer-export-from': 'error',
|
|
247
|
+
|
|
248
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-global-this.html
|
|
249
|
+
'unicorn/prefer-global-this': 'error',
|
|
250
|
+
|
|
251
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-includes.html
|
|
252
|
+
'unicorn/prefer-includes': 'error',
|
|
253
|
+
|
|
254
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-keyboard-event-key.html
|
|
255
|
+
'unicorn/prefer-keyboard-event-key': 'error',
|
|
256
|
+
|
|
257
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-logical-operator-over-ternary.html
|
|
258
|
+
'unicorn/prefer-logical-operator-over-ternary': 'error',
|
|
259
|
+
|
|
260
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-math-min-max.html
|
|
261
|
+
'unicorn/prefer-math-min-max': 'error',
|
|
262
|
+
|
|
263
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-math-trunc.html
|
|
264
|
+
'unicorn/prefer-math-trunc': 'error',
|
|
265
|
+
|
|
266
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-modern-dom-apis.html
|
|
267
|
+
'unicorn/prefer-modern-dom-apis': 'error',
|
|
268
|
+
|
|
269
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-modern-math-apis.html
|
|
270
|
+
'unicorn/prefer-modern-math-apis': 'error',
|
|
271
|
+
|
|
272
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-native-coercion-functions.html
|
|
273
|
+
'unicorn/prefer-native-coercion-functions': 'error',
|
|
274
|
+
|
|
275
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-negative-index.html
|
|
276
|
+
'unicorn/prefer-negative-index': 'error',
|
|
277
|
+
|
|
278
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-number-properties.html
|
|
279
|
+
'unicorn/prefer-number-properties': 'error',
|
|
280
|
+
|
|
281
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-object-from-entries.html
|
|
282
|
+
'unicorn/prefer-object-from-entries': 'error',
|
|
283
|
+
|
|
284
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-optional-catch-binding.html
|
|
285
|
+
'unicorn/prefer-optional-catch-binding': 'error',
|
|
286
|
+
|
|
287
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-prototype-methods.html
|
|
288
|
+
'unicorn/prefer-prototype-methods': 'error',
|
|
289
|
+
|
|
290
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-query-selector.html
|
|
291
|
+
'unicorn/prefer-query-selector': 'error',
|
|
292
|
+
|
|
293
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-reflect-apply.html
|
|
294
|
+
'unicorn/prefer-reflect-apply': 'error',
|
|
295
|
+
|
|
296
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-regexp-test.html
|
|
297
|
+
'unicorn/prefer-regexp-test': 'error',
|
|
298
|
+
|
|
299
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-set-has.html
|
|
300
|
+
'unicorn/prefer-set-has': 'error',
|
|
301
|
+
|
|
302
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-set-size.html
|
|
303
|
+
'unicorn/prefer-set-size': 'error',
|
|
304
|
+
|
|
305
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-single-call.html
|
|
306
|
+
'unicorn/prefer-single-call': 'error',
|
|
307
|
+
|
|
308
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-spread.html
|
|
309
|
+
'unicorn/prefer-spread': 'error',
|
|
310
|
+
|
|
311
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-string-raw.html
|
|
312
|
+
'unicorn/prefer-string-raw': 'error',
|
|
313
|
+
|
|
314
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-string-replace-all.html
|
|
315
|
+
'unicorn/prefer-string-replace-all': 'error',
|
|
316
|
+
|
|
317
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-string-slice.html
|
|
318
|
+
'unicorn/prefer-string-slice': 'error',
|
|
319
|
+
|
|
320
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-string-starts-ends-with.html
|
|
321
|
+
'unicorn/prefer-string-starts-ends-with': 'error',
|
|
322
|
+
|
|
323
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-string-trim-start-end.html
|
|
324
|
+
'unicorn/prefer-string-trim-start-end': 'error',
|
|
325
|
+
|
|
326
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-structured-clone.html
|
|
327
|
+
'unicorn/prefer-structured-clone': 'error',
|
|
328
|
+
|
|
329
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-switch.html
|
|
330
|
+
'unicorn/prefer-switch': 'error',
|
|
331
|
+
|
|
332
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-ternary.html
|
|
333
|
+
'unicorn/prefer-ternary': 'error',
|
|
334
|
+
|
|
335
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/prefer-type-error.html
|
|
336
|
+
'unicorn/prefer-type-error': 'error',
|
|
337
|
+
|
|
338
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/relative-url-style.html
|
|
339
|
+
'unicorn/relative-url-style': 'error',
|
|
340
|
+
|
|
341
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/require-array-join-separator.html
|
|
342
|
+
'unicorn/require-array-join-separator': 'error',
|
|
343
|
+
|
|
344
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/require-module-attributes.html
|
|
345
|
+
'unicorn/require-module-attributes': 'error',
|
|
346
|
+
|
|
347
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/require-module-specifiers.html
|
|
348
|
+
'unicorn/require-module-specifiers': 'error',
|
|
349
|
+
|
|
350
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/require-number-to-fixed-digits-argument.html
|
|
351
|
+
'unicorn/require-number-to-fixed-digits-argument': 'error',
|
|
352
|
+
|
|
353
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/switch-case-braces.html
|
|
354
|
+
'unicorn/switch-case-braces': 'error',
|
|
355
|
+
|
|
356
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/text-encoding-identifier-case.html
|
|
357
|
+
'unicorn/text-encoding-identifier-case': 'error',
|
|
358
|
+
|
|
359
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/template-indent.html
|
|
360
|
+
'unicorn/template-indent': 'error',
|
|
361
|
+
|
|
362
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/unicorn/throw-new-error.html
|
|
363
|
+
'unicorn/throw-new-error': 'error',
|
|
364
|
+
},
|
|
365
|
+
} as const;
|
package/oxlint/index.ts
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineConfig as defineConfigBase,
|
|
3
|
+
type OxlintConfig,
|
|
4
|
+
type OxlintGlobals,
|
|
5
|
+
} from 'oxlint';
|
|
6
|
+
import base from './configs/base.ts';
|
|
7
|
+
import browser from './configs/browser.ts';
|
|
8
|
+
import esm from './configs/esm.ts';
|
|
9
|
+
import jest from './configs/jest.ts';
|
|
10
|
+
import node from './configs/node.ts';
|
|
11
|
+
import nodeCommonJs from './configs/nodeCommonJs.ts';
|
|
12
|
+
import perfectionist from './configs/perfectionist.ts';
|
|
13
|
+
import react from './configs/react.ts';
|
|
14
|
+
import reactStrict from './configs/reactStrict.ts';
|
|
15
|
+
import strict from './configs/strict.ts';
|
|
16
|
+
import ts from './configs/ts.ts';
|
|
17
|
+
import tsStrict from './configs/tsStrict.ts';
|
|
18
|
+
import unicorn from './configs/unicorn.ts';
|
|
19
|
+
import vitest from './configs/vitest.ts';
|
|
20
|
+
|
|
21
|
+
export function defineConfig(cfg: RootConfig) {
|
|
22
|
+
let overrides = cfg.overrides || [];
|
|
23
|
+
|
|
24
|
+
if (Array.isArray(overrides)) {
|
|
25
|
+
overrides = overrides.map((override) => ({
|
|
26
|
+
files: [
|
|
27
|
+
'**/*.js',
|
|
28
|
+
'**/*.cjs',
|
|
29
|
+
'**/*.mjs',
|
|
30
|
+
'**/*.jsx',
|
|
31
|
+
'**/*.ts',
|
|
32
|
+
'**/*.cts',
|
|
33
|
+
'**/*.mts',
|
|
34
|
+
'**/*.tsx',
|
|
35
|
+
],
|
|
36
|
+
...override,
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return defineConfigBase({ ...cfg, overrides } as unknown as OxlintConfig);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const configs = {
|
|
44
|
+
// Mostly Airbnb base rules
|
|
45
|
+
base,
|
|
46
|
+
|
|
47
|
+
// Browser globals
|
|
48
|
+
browser,
|
|
49
|
+
|
|
50
|
+
// JS, ESModules
|
|
51
|
+
esm,
|
|
52
|
+
|
|
53
|
+
// Jest globals
|
|
54
|
+
jest,
|
|
55
|
+
|
|
56
|
+
// Modern Node.js
|
|
57
|
+
node,
|
|
58
|
+
|
|
59
|
+
// Legacy Node.js + CommonJS rules
|
|
60
|
+
nodeCommonJs,
|
|
61
|
+
|
|
62
|
+
// Sorts imports, objects, and types
|
|
63
|
+
perfectionist,
|
|
64
|
+
|
|
65
|
+
// React + React Hooks rules
|
|
66
|
+
react,
|
|
67
|
+
|
|
68
|
+
// Strict React rules — extends react
|
|
69
|
+
reactStrict,
|
|
70
|
+
|
|
71
|
+
// A bit more strict and contains less autofixes than the base config
|
|
72
|
+
strict,
|
|
73
|
+
|
|
74
|
+
// Base TypeScript rules
|
|
75
|
+
ts,
|
|
76
|
+
|
|
77
|
+
// Strict TypeScript rules — extends ts
|
|
78
|
+
tsStrict,
|
|
79
|
+
|
|
80
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
81
|
+
unicorn,
|
|
82
|
+
|
|
83
|
+
// Vitest globals
|
|
84
|
+
vitest,
|
|
85
|
+
} as const;
|
|
86
|
+
|
|
87
|
+
interface BaseConfig {
|
|
88
|
+
categories?: Readonly<Record<string, unknown>>;
|
|
89
|
+
env?: Readonly<Record<string, boolean>>;
|
|
90
|
+
extends?: ReadonlyArray<string>;
|
|
91
|
+
globals?: OxlintGlobals;
|
|
92
|
+
ignorePatterns?: string[];
|
|
93
|
+
jsPlugins?: ReadonlyArray<string>;
|
|
94
|
+
plugins?: ReadonlyArray<string>;
|
|
95
|
+
rules?: Readonly<Record<string, unknown>>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
interface OverrideConfig extends BaseConfig {
|
|
99
|
+
files?: string[];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
interface RootConfig extends BaseConfig {
|
|
103
|
+
overrides?: ReadonlyArray<OverrideConfig>;
|
|
104
|
+
}
|
package/oxlint.config.ts
ADDED
package/package.json
CHANGED
|
@@ -1,36 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@todesktop/dev-config",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"description": "Shared dev configs for ESLint, Prettier, TypeScript, etc",
|
|
5
5
|
"author": "ToDesktop <hello@todesktop.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
|
-
"scripts": {
|
|
9
|
-
"format": "prettier . --write && eslint --fix",
|
|
10
|
-
"lint": "prettier . --check && eslint"
|
|
11
|
-
},
|
|
12
8
|
"exports": {
|
|
13
9
|
"./*": "./*",
|
|
14
10
|
"./eslint": "./eslint/index.js",
|
|
15
|
-
"./
|
|
11
|
+
"./oxlint": "./oxlint/index.ts",
|
|
12
|
+
"./prettier": "./prettier/index.js",
|
|
13
|
+
"./tsconfig.base.json": "./tsconfig.base.json"
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"format": "env NODE_NO_WARNINGS=1 oxfmt && env NODE_NO_WARNINGS=1 oxlint --fix",
|
|
17
|
+
"lint": "env NODE_NO_WARNINGS=1 oxfmt --check && env NODE_NO_WARNINGS=1 oxlint",
|
|
18
|
+
"typecheck": "tsgo"
|
|
16
19
|
},
|
|
17
20
|
"dependencies": {
|
|
18
|
-
"
|
|
19
|
-
"eslint-config-airbnb-extended": "^2.3.2",
|
|
20
|
-
"eslint-config-prettier": "^10.1.8",
|
|
21
|
-
"eslint-import-resolver-typescript": "^4.4.4",
|
|
22
|
-
"eslint-plugin-import-x": "^4.16.1",
|
|
23
|
-
"eslint-plugin-n": "^17.23.1",
|
|
24
|
-
"eslint-plugin-perfectionist": "^4.15.1",
|
|
25
|
-
"eslint-plugin-prettier": "^5.5.4",
|
|
26
|
-
"eslint-plugin-react": "^7.37.5",
|
|
27
|
-
"eslint-plugin-react-hooks": "^7.0.0",
|
|
28
|
-
"eslint-plugin-unicorn": "^61.0.2",
|
|
21
|
+
"eslint-plugin-perfectionist": "^5.7.0",
|
|
29
22
|
"globals": "^15.15.0",
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"eslint": "^9.37.0",
|
|
34
|
-
"prettier": "^3.6.2"
|
|
23
|
+
"oxfmt": "catalog:",
|
|
24
|
+
"oxlint": "catalog:"
|
|
35
25
|
}
|
|
36
26
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "./tsconfig.base.json",
|
|
2
3
|
"compilerOptions": {
|
|
3
|
-
"allowJs": true,
|
|
4
4
|
"allowImportingTsExtensions": true,
|
|
5
|
-
"
|
|
6
|
-
"module": "
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"module": "Node16",
|
|
7
7
|
"moduleResolution": "Node16",
|
|
8
8
|
"noEmit": true,
|
|
9
|
-
"skipLibCheck": true,
|
|
10
9
|
"strict": true,
|
|
11
10
|
"target": "es2022"
|
|
12
|
-
}
|
|
11
|
+
},
|
|
12
|
+
"include": ["./oxlint/**/*.ts"]
|
|
13
13
|
}
|