@todesktop/dev-config 1.0.1 → 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/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 -4
- package/eslint.config.mjs +0 -8
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
// A bit more strict and contains additional best-practice rules beyond base.
|
|
2
|
+
// Spread on top of base for library/utility packages.
|
|
3
|
+
export default {
|
|
4
|
+
plugins: ['import'],
|
|
5
|
+
rules: {
|
|
6
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/array-callback-return.html
|
|
7
|
+
'array-callback-return': [
|
|
8
|
+
'error',
|
|
9
|
+
{
|
|
10
|
+
allowImplicit: true,
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
|
|
14
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/block-scoped-var.html
|
|
15
|
+
'block-scoped-var': 'error',
|
|
16
|
+
|
|
17
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/class-methods-use-this.html
|
|
18
|
+
'class-methods-use-this': 'off',
|
|
19
|
+
|
|
20
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/consistent-return.html
|
|
21
|
+
'consistent-return': 'error',
|
|
22
|
+
|
|
23
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/curly.html
|
|
24
|
+
'curly': ['error', 'multi-line'],
|
|
25
|
+
|
|
26
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/default-case.html
|
|
27
|
+
'default-case': [
|
|
28
|
+
'error',
|
|
29
|
+
{
|
|
30
|
+
commentPattern: '^no default$',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
|
|
34
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/default-case.html-last
|
|
35
|
+
'default-case-last': 'error',
|
|
36
|
+
|
|
37
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/default-param-last.html
|
|
38
|
+
'default-param-last': 'error',
|
|
39
|
+
|
|
40
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/dot-notation.html
|
|
41
|
+
'dot-notation': [
|
|
42
|
+
'error',
|
|
43
|
+
{
|
|
44
|
+
allowKeywords: true,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
|
|
48
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/eqeqeq.html
|
|
49
|
+
'eqeqeq': [
|
|
50
|
+
'error',
|
|
51
|
+
'always',
|
|
52
|
+
{
|
|
53
|
+
null: 'ignore',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
|
|
57
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/grouped-accessor-pairs.html
|
|
58
|
+
'grouped-accessor-pairs': 'error',
|
|
59
|
+
|
|
60
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/guard-for-in.html
|
|
61
|
+
'guard-for-in': 'error',
|
|
62
|
+
|
|
63
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/max-classes-per-file.html
|
|
64
|
+
'max-classes-per-file': ['error', 1],
|
|
65
|
+
|
|
66
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-alert.html
|
|
67
|
+
'no-alert': 'warn',
|
|
68
|
+
|
|
69
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-await-in-loop.html
|
|
70
|
+
'no-await-in-loop': 'error',
|
|
71
|
+
|
|
72
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-caller.html
|
|
73
|
+
'no-caller': 'error',
|
|
74
|
+
|
|
75
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-case-declarations.html
|
|
76
|
+
'no-case-declarations': 'error',
|
|
77
|
+
|
|
78
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-console.html
|
|
79
|
+
// Upgrade from base: error in strict context
|
|
80
|
+
'no-console': [
|
|
81
|
+
'error',
|
|
82
|
+
{
|
|
83
|
+
allow: [
|
|
84
|
+
'assert',
|
|
85
|
+
'context',
|
|
86
|
+
'createTask',
|
|
87
|
+
'dir',
|
|
88
|
+
'dirxml',
|
|
89
|
+
'error',
|
|
90
|
+
'group',
|
|
91
|
+
'groupCollapsed',
|
|
92
|
+
'groupEnd',
|
|
93
|
+
'info',
|
|
94
|
+
'table',
|
|
95
|
+
'warn',
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
|
|
100
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-constructor-return.html
|
|
101
|
+
'no-constructor-return': 'error',
|
|
102
|
+
|
|
103
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-else-return.html
|
|
104
|
+
'no-else-return': [
|
|
105
|
+
'error',
|
|
106
|
+
{
|
|
107
|
+
allowElseIf: false,
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
|
|
111
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-empty-function.html
|
|
112
|
+
'no-empty-function': [
|
|
113
|
+
'error',
|
|
114
|
+
{
|
|
115
|
+
allow: ['arrowFunctions', 'functions', 'methods'],
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
|
|
119
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-empty-pattern.html
|
|
120
|
+
'no-empty-pattern': 'error',
|
|
121
|
+
|
|
122
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-eval.html
|
|
123
|
+
'no-eval': 'error',
|
|
124
|
+
|
|
125
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-extend-native.html
|
|
126
|
+
'no-extend-native': 'error',
|
|
127
|
+
|
|
128
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-extra-bind.html
|
|
129
|
+
'no-extra-bind': 'error',
|
|
130
|
+
|
|
131
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-extra-label.html
|
|
132
|
+
'no-extra-label': 'error',
|
|
133
|
+
|
|
134
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-fallthrough.html
|
|
135
|
+
'no-fallthrough': 'error',
|
|
136
|
+
|
|
137
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-global-assign.html
|
|
138
|
+
'no-global-assign': [
|
|
139
|
+
'error',
|
|
140
|
+
{
|
|
141
|
+
exceptions: [],
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
|
|
145
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-implied-eval.html
|
|
146
|
+
'no-implied-eval': 'error',
|
|
147
|
+
|
|
148
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-iterator.html
|
|
149
|
+
'no-iterator': 'error',
|
|
150
|
+
|
|
151
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-labels.html
|
|
152
|
+
'no-labels': [
|
|
153
|
+
'error',
|
|
154
|
+
{
|
|
155
|
+
allowLoop: false,
|
|
156
|
+
allowSwitch: false,
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
|
|
160
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-lone-blocks.html
|
|
161
|
+
'no-lone-blocks': 'error',
|
|
162
|
+
|
|
163
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-loop-func.html
|
|
164
|
+
'no-loop-func': 'error',
|
|
165
|
+
|
|
166
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-multi-str.html
|
|
167
|
+
'no-multi-str': 'error',
|
|
168
|
+
|
|
169
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-nested-ternary.html
|
|
170
|
+
// Upgrade from base warn to strict error
|
|
171
|
+
'no-nested-ternary': 'error',
|
|
172
|
+
|
|
173
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-new.html
|
|
174
|
+
'no-new': 'error',
|
|
175
|
+
|
|
176
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-new.html-func
|
|
177
|
+
'no-new-func': 'error',
|
|
178
|
+
|
|
179
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-new.html-wrappers
|
|
180
|
+
'no-new-wrappers': 'error',
|
|
181
|
+
|
|
182
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-nonoctal-decimal-escape.html
|
|
183
|
+
'no-nonoctal-decimal-escape': 'error',
|
|
184
|
+
|
|
185
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-octal.html
|
|
186
|
+
'no-octal': 'error',
|
|
187
|
+
|
|
188
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-octal-escape.html
|
|
189
|
+
'no-octal-escape': 'error',
|
|
190
|
+
|
|
191
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-param-reassign.html
|
|
192
|
+
'no-param-reassign': [
|
|
193
|
+
'error',
|
|
194
|
+
{
|
|
195
|
+
ignorePropertyModificationsFor: [
|
|
196
|
+
'acc',
|
|
197
|
+
'accumulator',
|
|
198
|
+
'e',
|
|
199
|
+
'ctx',
|
|
200
|
+
'context',
|
|
201
|
+
'req',
|
|
202
|
+
'request',
|
|
203
|
+
'res',
|
|
204
|
+
'response',
|
|
205
|
+
'$scope',
|
|
206
|
+
'staticContext',
|
|
207
|
+
],
|
|
208
|
+
props: true,
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
|
|
212
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-proto.html
|
|
213
|
+
'no-proto': 'error',
|
|
214
|
+
|
|
215
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-promise-executor-return.html
|
|
216
|
+
'no-promise-executor-return': 'error',
|
|
217
|
+
|
|
218
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-redeclare.html
|
|
219
|
+
'no-redeclare': 'error',
|
|
220
|
+
|
|
221
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-restricted-properties.html
|
|
222
|
+
'no-restricted-properties': [
|
|
223
|
+
'error',
|
|
224
|
+
{
|
|
225
|
+
message: 'arguments.callee is deprecated',
|
|
226
|
+
object: 'arguments',
|
|
227
|
+
property: 'callee',
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
message: 'Please use Number.isFinite instead',
|
|
231
|
+
object: 'global',
|
|
232
|
+
property: 'isFinite',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
message: 'Please use Number.isFinite instead',
|
|
236
|
+
object: 'self',
|
|
237
|
+
property: 'isFinite',
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
message: 'Please use Number.isFinite instead',
|
|
241
|
+
object: 'window',
|
|
242
|
+
property: 'isFinite',
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
message: 'Please use Number.isNaN instead',
|
|
246
|
+
object: 'global',
|
|
247
|
+
property: 'isNaN',
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
message: 'Please use Number.isNaN instead',
|
|
251
|
+
object: 'self',
|
|
252
|
+
property: 'isNaN',
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
message: 'Please use Number.isNaN instead',
|
|
256
|
+
object: 'window',
|
|
257
|
+
property: 'isNaN',
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
message: 'Please use Object.defineProperty instead.',
|
|
261
|
+
property: '__defineGetter__',
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
message: 'Please use Object.defineProperty instead.',
|
|
265
|
+
property: '__defineSetter__',
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
message: 'Use the exponentiation operator (**) instead.',
|
|
269
|
+
object: 'Math',
|
|
270
|
+
property: 'pow',
|
|
271
|
+
},
|
|
272
|
+
],
|
|
273
|
+
|
|
274
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-return-assign.html
|
|
275
|
+
'no-return-assign': ['error', 'always'],
|
|
276
|
+
|
|
277
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-script-url.html
|
|
278
|
+
'no-script-url': 'error',
|
|
279
|
+
|
|
280
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-self-assign.html
|
|
281
|
+
'no-self-assign': [
|
|
282
|
+
'error',
|
|
283
|
+
{
|
|
284
|
+
props: true,
|
|
285
|
+
},
|
|
286
|
+
],
|
|
287
|
+
|
|
288
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-self-compare.html
|
|
289
|
+
'no-self-compare': 'error',
|
|
290
|
+
|
|
291
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-sequences.html
|
|
292
|
+
'no-sequences': 'error',
|
|
293
|
+
|
|
294
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-shadow.html
|
|
295
|
+
'no-shadow': 'error',
|
|
296
|
+
|
|
297
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-throw-literal.html
|
|
298
|
+
'no-throw-literal': 'error',
|
|
299
|
+
|
|
300
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-unused-expressions.html
|
|
301
|
+
'no-unused-expressions': [
|
|
302
|
+
'error',
|
|
303
|
+
{
|
|
304
|
+
allowShortCircuit: false,
|
|
305
|
+
allowTaggedTemplates: false,
|
|
306
|
+
allowTernary: false,
|
|
307
|
+
},
|
|
308
|
+
],
|
|
309
|
+
|
|
310
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-unused-labels.html
|
|
311
|
+
'no-unused-labels': 'error',
|
|
312
|
+
|
|
313
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-useless-catch.html
|
|
314
|
+
'no-useless-catch': 'error',
|
|
315
|
+
|
|
316
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-useless-concat.html
|
|
317
|
+
'no-useless-concat': 'error',
|
|
318
|
+
|
|
319
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-useless-escape.html
|
|
320
|
+
'no-useless-escape': 'error',
|
|
321
|
+
|
|
322
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-useless-return.html
|
|
323
|
+
'no-useless-return': 'error',
|
|
324
|
+
|
|
325
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-void.html
|
|
326
|
+
'no-void': 'error',
|
|
327
|
+
|
|
328
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-with.html
|
|
329
|
+
'no-with': 'error',
|
|
330
|
+
|
|
331
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/prefer-object-has-own.html
|
|
332
|
+
'prefer-object-has-own': 'error',
|
|
333
|
+
|
|
334
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/prefer-promise-reject-errors.html
|
|
335
|
+
'prefer-promise-reject-errors': [
|
|
336
|
+
'error',
|
|
337
|
+
{
|
|
338
|
+
allowEmptyReject: true,
|
|
339
|
+
},
|
|
340
|
+
],
|
|
341
|
+
|
|
342
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/prefer-regex-literals.html
|
|
343
|
+
'prefer-regex-literals': [
|
|
344
|
+
'error',
|
|
345
|
+
{
|
|
346
|
+
disallowRedundantWrapping: true,
|
|
347
|
+
},
|
|
348
|
+
],
|
|
349
|
+
|
|
350
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/radix.html
|
|
351
|
+
'radix': 'error',
|
|
352
|
+
|
|
353
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/vars-on-top.html
|
|
354
|
+
'vars-on-top': 'error',
|
|
355
|
+
|
|
356
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/yoda.html
|
|
357
|
+
'yoda': 'error',
|
|
358
|
+
|
|
359
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/default.html
|
|
360
|
+
'import-x/default': 'error',
|
|
361
|
+
|
|
362
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/first.html
|
|
363
|
+
'import-x/first': 'error',
|
|
364
|
+
|
|
365
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/namespace.html
|
|
366
|
+
'import-x/namespace': 'error',
|
|
367
|
+
|
|
368
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-absolute-path.html
|
|
369
|
+
'import-x/no-absolute-path': 'error',
|
|
370
|
+
|
|
371
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-amd.html
|
|
372
|
+
'import-x/no-amd': 'error',
|
|
373
|
+
|
|
374
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-anonymous-default-export.html
|
|
375
|
+
'import-x/no-anonymous-default-export': [
|
|
376
|
+
'error',
|
|
377
|
+
{
|
|
378
|
+
allowArray: true,
|
|
379
|
+
allowObject: true,
|
|
380
|
+
},
|
|
381
|
+
],
|
|
382
|
+
|
|
383
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-cycle.html
|
|
384
|
+
'import-x/no-cycle': 'error',
|
|
385
|
+
|
|
386
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-duplicates.html
|
|
387
|
+
'import-x/no-duplicates': 'error',
|
|
388
|
+
|
|
389
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-dynamic-require.html
|
|
390
|
+
'import-x/no-dynamic-require': 'error',
|
|
391
|
+
|
|
392
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-empty-named-blocks.html
|
|
393
|
+
'import-x/no-empty-named-blocks': 'error',
|
|
394
|
+
|
|
395
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-mutable-exports.html
|
|
396
|
+
'import-x/no-mutable-exports': 'error',
|
|
397
|
+
|
|
398
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-named-as-default.html
|
|
399
|
+
'import-x/no-named-as-default': 'error',
|
|
400
|
+
|
|
401
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-named-as-default-member.html
|
|
402
|
+
'import-x/no-named-as-default-member': 'error',
|
|
403
|
+
|
|
404
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-named-default.html
|
|
405
|
+
'import-x/no-named-default': 'error',
|
|
406
|
+
|
|
407
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-self-import.html
|
|
408
|
+
'import-x/no-self-import': 'error',
|
|
409
|
+
|
|
410
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-webpack-loader-syntax.html
|
|
411
|
+
'import-x/no-webpack-loader-syntax': 'error',
|
|
412
|
+
|
|
413
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/export.html
|
|
414
|
+
'import-x/export': 'error',
|
|
415
|
+
|
|
416
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/named.html
|
|
417
|
+
'import-x/named': 'error',
|
|
418
|
+
|
|
419
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/newline-after-import.html
|
|
420
|
+
'import-x/newline-after-import': 'error',
|
|
421
|
+
|
|
422
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-extraneous-dependencies.html
|
|
423
|
+
'import-x/no-extraneous-dependencies': [
|
|
424
|
+
'error',
|
|
425
|
+
{
|
|
426
|
+
bundledDependencies: true,
|
|
427
|
+
devDependencies: [
|
|
428
|
+
'test/**',
|
|
429
|
+
'tests/**',
|
|
430
|
+
'spec/**',
|
|
431
|
+
'**/__tests__/**',
|
|
432
|
+
'**/__mocks__/**',
|
|
433
|
+
'test.{js,cjs,mjs}',
|
|
434
|
+
'test-*.{js,cjs,mjs}',
|
|
435
|
+
'**/*{.,_}{test,spec}.{js,cjs,mjs}',
|
|
436
|
+
'**/jest.config.{js,cjs,mjs}',
|
|
437
|
+
'**/jest.setup.{js,cjs,mjs}',
|
|
438
|
+
'**/vue.config.{js,cjs,mjs}',
|
|
439
|
+
'**/webpack.config.{js,cjs,mjs}',
|
|
440
|
+
'**/webpack.config.*.{js,cjs,mjs}',
|
|
441
|
+
'**/rollup.config.{js,cjs,mjs}',
|
|
442
|
+
'**/rollup.config.*.{js,cjs,mjs}',
|
|
443
|
+
'**/gulpfile.{js,cjs,mjs}',
|
|
444
|
+
'**/gulpfile.*.{js,cjs,mjs}',
|
|
445
|
+
'**/Gruntfile{,.{js,cjs,mjs}}',
|
|
446
|
+
'**/protractor.conf.{js,cjs,mjs}',
|
|
447
|
+
'**/protractor.conf.*.{js,cjs,mjs}',
|
|
448
|
+
'**/karma.conf.{js,cjs,mjs}',
|
|
449
|
+
'**/.eslintrc.{js,cjs,mjs}',
|
|
450
|
+
'**/*.eslint.{js,cjs,mjs}',
|
|
451
|
+
'**/eslint.config.{js,cjs,mjs}',
|
|
452
|
+
'**/prettier.config.{js,cjs,mjs}',
|
|
453
|
+
'**/vite.config.{js,cjs,mjs}',
|
|
454
|
+
'**/tailwind.config.{js,cjs,mjs}',
|
|
455
|
+
],
|
|
456
|
+
optionalDependencies: false,
|
|
457
|
+
peerDependencies: true,
|
|
458
|
+
whitelist: ['@todesktop/dev-config'],
|
|
459
|
+
},
|
|
460
|
+
],
|
|
461
|
+
|
|
462
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-import-module-exports.html
|
|
463
|
+
'import-x/no-import-module-exports': [
|
|
464
|
+
'error',
|
|
465
|
+
{
|
|
466
|
+
exceptions: [],
|
|
467
|
+
},
|
|
468
|
+
],
|
|
469
|
+
|
|
470
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-relative-packages.html
|
|
471
|
+
'import-x/no-relative-packages': 'error',
|
|
472
|
+
|
|
473
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/import/no-useless-path-segments.html
|
|
474
|
+
'import-x/no-useless-path-segments': [
|
|
475
|
+
'error',
|
|
476
|
+
{
|
|
477
|
+
commonjs: true,
|
|
478
|
+
noUselessIndex: true,
|
|
479
|
+
},
|
|
480
|
+
],
|
|
481
|
+
},
|
|
482
|
+
} as const;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// Rules from typescript-eslint (used in .ts/.tsx overrides)
|
|
2
|
+
export default {
|
|
3
|
+
plugins: ['typescript'],
|
|
4
|
+
rules: {
|
|
5
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/ban-ts-comment.html
|
|
6
|
+
'@typescript-eslint/ban-ts-comment': 'error',
|
|
7
|
+
|
|
8
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-array-constructor.html
|
|
9
|
+
'@typescript-eslint/no-array-constructor': 'error',
|
|
10
|
+
|
|
11
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-duplicate-enum-values.html
|
|
12
|
+
'@typescript-eslint/no-duplicate-enum-values': 'error',
|
|
13
|
+
|
|
14
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-empty-object-type.html
|
|
15
|
+
'@typescript-eslint/no-empty-object-type': 'error',
|
|
16
|
+
|
|
17
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-explicit-any.html
|
|
18
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
19
|
+
|
|
20
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-extra-non-null-assertion.html
|
|
21
|
+
'@typescript-eslint/no-extra-non-null-assertion': 'error',
|
|
22
|
+
|
|
23
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-misused-new.html
|
|
24
|
+
'@typescript-eslint/no-misused-new': 'error',
|
|
25
|
+
|
|
26
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-namespace.html
|
|
27
|
+
'@typescript-eslint/no-namespace': 'error',
|
|
28
|
+
|
|
29
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-non-null-asserted-optional-chain.html
|
|
30
|
+
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
|
|
31
|
+
|
|
32
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-require-imports.html
|
|
33
|
+
'@typescript-eslint/no-require-imports': 'error',
|
|
34
|
+
|
|
35
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-this-alias.html
|
|
36
|
+
'@typescript-eslint/no-this-alias': 'error',
|
|
37
|
+
|
|
38
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-unnecessary-type-constraint.html
|
|
39
|
+
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
|
|
40
|
+
|
|
41
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-unsafe-declaration-merging.html
|
|
42
|
+
'@typescript-eslint/no-unsafe-declaration-merging': 'error',
|
|
43
|
+
|
|
44
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-unsafe-function-type.html
|
|
45
|
+
'@typescript-eslint/no-unsafe-function-type': 'error',
|
|
46
|
+
|
|
47
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-unused-vars.html
|
|
48
|
+
'@typescript-eslint/no-unused-vars': [
|
|
49
|
+
'error',
|
|
50
|
+
{
|
|
51
|
+
args: 'all',
|
|
52
|
+
argsIgnorePattern: '^_',
|
|
53
|
+
caughtErrors: 'all',
|
|
54
|
+
caughtErrorsIgnorePattern: '^_',
|
|
55
|
+
destructuredArrayIgnorePattern: '^_',
|
|
56
|
+
ignoreRestSiblings: true,
|
|
57
|
+
varsIgnorePattern: '^_',
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
|
|
61
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-wrapper-object-types.html
|
|
62
|
+
'@typescript-eslint/no-wrapper-object-types': 'error',
|
|
63
|
+
|
|
64
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/prefer-as-const.html
|
|
65
|
+
'@typescript-eslint/prefer-as-const': 'error',
|
|
66
|
+
|
|
67
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/prefer-namespace-keyword.html
|
|
68
|
+
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
|
69
|
+
|
|
70
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/triple-slash-reference.html
|
|
71
|
+
'@typescript-eslint/triple-slash-reference': 'error',
|
|
72
|
+
|
|
73
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/constructor-super.html
|
|
74
|
+
'constructor-super': 'off',
|
|
75
|
+
|
|
76
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-class-assign.html
|
|
77
|
+
'no-class-assign': 'off',
|
|
78
|
+
|
|
79
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-const-assign.html
|
|
80
|
+
'no-const-assign': 'off',
|
|
81
|
+
|
|
82
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-dupe-class-members.html
|
|
83
|
+
'no-dupe-class-members': 'off',
|
|
84
|
+
|
|
85
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-dupe-keys.html
|
|
86
|
+
'no-dupe-keys': 'off',
|
|
87
|
+
|
|
88
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-func-assign.html
|
|
89
|
+
'no-func-assign': 'off',
|
|
90
|
+
|
|
91
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-import-assign.html
|
|
92
|
+
'no-import-assign': 'off',
|
|
93
|
+
|
|
94
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-new-native-nonconstructor.html
|
|
95
|
+
'no-new-native-nonconstructor': 'off',
|
|
96
|
+
|
|
97
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-obj-calls.html
|
|
98
|
+
'no-obj-calls': 'off',
|
|
99
|
+
|
|
100
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-redeclare.html
|
|
101
|
+
'no-redeclare': 'off',
|
|
102
|
+
|
|
103
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-setter-return.html
|
|
104
|
+
'no-setter-return': 'off',
|
|
105
|
+
|
|
106
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-this-before-super.html
|
|
107
|
+
'no-this-before-super': 'off',
|
|
108
|
+
|
|
109
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-unsafe-negation.html
|
|
110
|
+
'no-unsafe-negation': 'off',
|
|
111
|
+
|
|
112
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-unused-vars.html
|
|
113
|
+
'no-unused-vars': [
|
|
114
|
+
'error',
|
|
115
|
+
{
|
|
116
|
+
args: 'all',
|
|
117
|
+
argsIgnorePattern: '^_',
|
|
118
|
+
caughtErrors: 'all',
|
|
119
|
+
caughtErrorsIgnorePattern: '^_',
|
|
120
|
+
destructuredArrayIgnorePattern: '^_',
|
|
121
|
+
ignoreRestSiblings: true,
|
|
122
|
+
varsIgnorePattern: '^_',
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
|
|
126
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-var.html
|
|
127
|
+
'no-var': 'error',
|
|
128
|
+
|
|
129
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/no-with.html
|
|
130
|
+
'no-with': 'off',
|
|
131
|
+
|
|
132
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/prefer-rest-params.html
|
|
133
|
+
'prefer-rest-params': 'error',
|
|
134
|
+
|
|
135
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/prefer-spread.html
|
|
136
|
+
'prefer-spread': 'error',
|
|
137
|
+
|
|
138
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/eslint/prefer-const.html
|
|
139
|
+
'prefer-const': [
|
|
140
|
+
'error',
|
|
141
|
+
{
|
|
142
|
+
destructuring: 'any',
|
|
143
|
+
ignoreReadBeforeAssign: true,
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
},
|
|
147
|
+
} as const;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// TypeScript strict rules — extends ts, enables stricter TS-specific checks.
|
|
2
|
+
// Spread on top of ts for packages that need strict type safety enforcement.
|
|
3
|
+
export default {
|
|
4
|
+
plugins: ['typescript'],
|
|
5
|
+
rules: {
|
|
6
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-dynamic-delete.html
|
|
7
|
+
'@typescript-eslint/no-dynamic-delete': 'error',
|
|
8
|
+
|
|
9
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-explicit-any.html
|
|
10
|
+
// Upgrade from ts: error in strict context
|
|
11
|
+
'@typescript-eslint/no-explicit-any': 'error',
|
|
12
|
+
|
|
13
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-extraneous-class.html
|
|
14
|
+
'@typescript-eslint/no-extraneous-class': 'error',
|
|
15
|
+
|
|
16
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-invalid-void-type.html
|
|
17
|
+
'@typescript-eslint/no-invalid-void-type': 'error',
|
|
18
|
+
|
|
19
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-non-null-asserted-nullish-coalescing.html
|
|
20
|
+
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
|
|
21
|
+
|
|
22
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-non-null-assertion.html
|
|
23
|
+
'@typescript-eslint/no-non-null-assertion': 'error',
|
|
24
|
+
|
|
25
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/no-useless-constructor.html
|
|
26
|
+
// TS-specific version (replaces base no-useless-constructor in ts context)
|
|
27
|
+
'@typescript-eslint/no-useless-constructor': 'error',
|
|
28
|
+
|
|
29
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/prefer-literal-enum-member.html
|
|
30
|
+
'@typescript-eslint/prefer-literal-enum-member': 'error',
|
|
31
|
+
|
|
32
|
+
// https://oxc.rs/docs/guide/usage/linter/rules/typescript/unified-signatures.html
|
|
33
|
+
'@typescript-eslint/unified-signatures': 'error',
|
|
34
|
+
},
|
|
35
|
+
} as const;
|