ultracite 7.8.4 → 7.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/config/biome/core/biome.jsonc +65 -4
- package/config/biome/next/biome.jsonc +3 -1
- package/config/biome/react/biome.jsonc +1 -0
- package/config/biome/vue/biome.jsonc +22 -2
- package/config/eslint/astro/rules/astro.mjs +4 -1
- package/config/eslint/core/eslint.config.mjs +9 -0
- package/config/eslint/core/rules/eslint-typescript.mjs +0 -2
- package/config/eslint/core/rules/eslint.mjs +15 -1
- package/config/eslint/core/rules/github.mjs +4 -0
- package/config/eslint/core/rules/import.mjs +10 -1
- package/config/eslint/core/rules/jsdoc.mjs +31 -0
- package/config/eslint/core/rules/n.mjs +5 -0
- package/config/eslint/core/rules/promise.mjs +6 -1
- package/config/eslint/core/rules/sonarjs.mjs +17 -0
- package/config/eslint/core/rules/typescript.mjs +12 -1
- package/config/eslint/core/rules/unicorn.mjs +21 -5
- package/config/eslint/next/eslint.config.mjs +4 -0
- package/config/eslint/next/rules/react-doctor.mjs +27 -0
- package/config/eslint/react/eslint.config.mjs +20 -1
- package/config/eslint/react/rules/react-doctor.mjs +153 -0
- package/config/eslint/react/rules/react.mjs +7 -6
- package/config/eslint/svelte/rules/svelte.mjs +9 -2
- package/config/eslint/tanstack/eslint.config.mjs +4 -0
- package/config/eslint/tanstack/rules/react-doctor.mjs +25 -0
- package/config/eslint/vue/eslint.config.mjs +9 -0
- package/config/oxlint/core/index.mjs +10 -3
- package/config/oxlint/github/index.d.mts +5 -0
- package/config/oxlint/github/index.mjs +36 -0
- package/config/oxlint/next/index.mjs +53 -1
- package/config/oxlint/react/index.mjs +245 -2
- package/config/oxlint/sonarjs/index.d.mts +5 -0
- package/config/oxlint/sonarjs/index.mjs +207 -0
- package/config/oxlint/tanstack/index.mjs +26 -1
- package/config/oxlint/vue/index.mjs +3 -0
- package/dist/index.js +64 -100
- package/package.json +24 -20
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ Common `init` flags for non-interactive / CI use:
|
|
|
45
45
|
| `--skip-install` | Configure without installing dependencies. |
|
|
46
46
|
| `--quiet` | Suppress interactive prompts (auto-enabled in CI). |
|
|
47
47
|
|
|
48
|
-
See the [CLI reference](https://
|
|
48
|
+
See the [CLI reference](https://ultracite.ai/) for the full, current list of options.
|
|
49
49
|
|
|
50
50
|
## Supported Tools
|
|
51
51
|
|
|
@@ -73,13 +73,12 @@ One unified toolchain configuration across every package and app, eliminating du
|
|
|
73
73
|
|
|
74
74
|
## Using the presets directly
|
|
75
75
|
|
|
76
|
-
Beyond the CLI, Ultracite publishes ready-made config presets you can extend in your own setup (Biome, ESLint, Oxlint, Oxfmt, Prettier, and Stylelint). `ultracite init` wires these up for you; if you'd rather reference them by hand, the [configuration docs](https://
|
|
76
|
+
Beyond the CLI, Ultracite publishes ready-made config presets you can extend in your own setup (Biome, ESLint, Oxlint, Oxfmt, Prettier, and Stylelint). `ultracite init` wires these up for you; if you'd rather reference them by hand, the [configuration docs](https://ultracite.ai/) list the exact import paths and extension points for each toolchain.
|
|
77
77
|
|
|
78
78
|
## Documentation
|
|
79
79
|
|
|
80
80
|
Full setup guides, configuration options, rule references, framework and editor integrations, and examples live in the docs:
|
|
81
81
|
|
|
82
|
-
- **Docs:** https://docs.ultracite.ai/
|
|
83
82
|
- **Website:** https://www.ultracite.ai/
|
|
84
83
|
- **Issues & discussions:** https://github.com/haydenbleasel/ultracite
|
|
85
84
|
|
|
@@ -78,14 +78,24 @@
|
|
|
78
78
|
"organizeImports": "on",
|
|
79
79
|
// Enforce attribute sorting in JSX elements.
|
|
80
80
|
"useSortedAttributes": "on",
|
|
81
|
-
// Enforce ordering of a JS object properties.
|
|
82
|
-
|
|
81
|
+
// Enforce ordering of a JS object properties. Matches sort-keys in
|
|
82
|
+
// the oxlint/ESLint configs.
|
|
83
|
+
"useSortedKeys": "on",
|
|
84
|
+
// Enforce ordering of TypeScript enum members. Off because reordering
|
|
85
|
+
// members changes the implicit numeric values of the enum.
|
|
86
|
+
"useSortedEnumMembers": "off",
|
|
83
87
|
// Enforce no duplicate classes in the file.
|
|
84
88
|
"noDuplicateClasses": "on",
|
|
85
89
|
// Enforce ordering of a TypeScript interface members.
|
|
86
90
|
"useSortedInterfaceMembers": "on",
|
|
87
91
|
// Enforce ordering of a JavaScript object properties.
|
|
88
|
-
"useSortedProperties": "on"
|
|
92
|
+
"useSortedProperties": "on",
|
|
93
|
+
// Enforce ordering of TypeScript type alias members.
|
|
94
|
+
"useSortedTypeFields": "on",
|
|
95
|
+
// Enforce alphabetical ordering of GraphQL selection sets.
|
|
96
|
+
"useSortedSelectionSet": "on",
|
|
97
|
+
// Enforce ordering of package.json keys.
|
|
98
|
+
"useSortedPackageJson": "on"
|
|
89
99
|
}
|
|
90
100
|
}
|
|
91
101
|
},
|
|
@@ -96,6 +106,7 @@
|
|
|
96
106
|
/** ------------------------ JavaScript Rules ------------------------ **/
|
|
97
107
|
|
|
98
108
|
"noAccessKey": "error",
|
|
109
|
+
"noAmbiguousAnchorText": "error",
|
|
99
110
|
"noAriaHiddenOnFocusable": "error",
|
|
100
111
|
"noAriaUnsupportedElements": "error",
|
|
101
112
|
"noDistractingElements": "error",
|
|
@@ -143,6 +154,7 @@
|
|
|
143
154
|
"noArguments": "error",
|
|
144
155
|
"noBannedTypes": "error",
|
|
145
156
|
"noCommaOperator": "error",
|
|
157
|
+
"noDivRegex": "error",
|
|
146
158
|
"noEmptyTypeParameters": "error",
|
|
147
159
|
"noExcessiveCognitiveComplexity": {
|
|
148
160
|
"level": "error",
|
|
@@ -153,6 +165,7 @@
|
|
|
153
165
|
"noExtraBooleanCast": "error",
|
|
154
166
|
"noFlatMapIdentity": "error",
|
|
155
167
|
"noForEach": "error",
|
|
168
|
+
"noRedundantDefaultExport": "error",
|
|
156
169
|
"noStaticOnlyClass": "error",
|
|
157
170
|
"noThisInStatic": "error",
|
|
158
171
|
"noUselessCatch": "error",
|
|
@@ -165,6 +178,7 @@
|
|
|
165
178
|
"noUselessLabel": "error",
|
|
166
179
|
"noUselessLoneBlockStatements": "error",
|
|
167
180
|
"noUselessRename": "error",
|
|
181
|
+
"noUselessReturn": "error",
|
|
168
182
|
"noUselessStringConcat": "error",
|
|
169
183
|
"noUselessStringRaw": "error",
|
|
170
184
|
"noUselessSwitchCase": "error",
|
|
@@ -174,6 +188,7 @@
|
|
|
174
188
|
"noUselessUndefined": "error",
|
|
175
189
|
"noUselessUndefinedInitialization": "error",
|
|
176
190
|
"noVoid": "error",
|
|
191
|
+
"useArrayFind": "error",
|
|
177
192
|
"useArrowFunction": "error",
|
|
178
193
|
"useDateNow": "error",
|
|
179
194
|
"useFlatMap": "error",
|
|
@@ -200,6 +215,11 @@
|
|
|
200
215
|
"noConstantMathMinMaxClamp": "error",
|
|
201
216
|
"noConstAssign": "error",
|
|
202
217
|
"noConstructorReturn": "error",
|
|
218
|
+
"noDuplicateArgumentNames": "error",
|
|
219
|
+
"noDuplicateAttributes": "error",
|
|
220
|
+
"noDuplicateEnumValueNames": "error",
|
|
221
|
+
"noDuplicateInputFieldNames": "error",
|
|
222
|
+
"noDuplicateVariableNames": "error",
|
|
203
223
|
"noEmptyCharacterClassInRegex": "error",
|
|
204
224
|
"noEmptyPattern": "error",
|
|
205
225
|
"noGlobalDirnameFilename": "error",
|
|
@@ -225,6 +245,7 @@
|
|
|
225
245
|
"fix": "safe",
|
|
226
246
|
"level": "error"
|
|
227
247
|
},
|
|
248
|
+
"noUnusedInstantiation": "error",
|
|
228
249
|
"noUnusedLabels": "error",
|
|
229
250
|
"noUnusedPrivateClassMembers": "error",
|
|
230
251
|
"noUnusedVariables": "error",
|
|
@@ -232,6 +253,7 @@
|
|
|
232
253
|
"useGraphqlNamedOperations": "error",
|
|
233
254
|
"useImageSize": "error",
|
|
234
255
|
"useIsNan": "error",
|
|
256
|
+
"useLoneAnonymousOperation": "error",
|
|
235
257
|
"useParseIntRadix": "error",
|
|
236
258
|
"useSingleJsDocAsterisk": "error",
|
|
237
259
|
"useValidForDirection": "error",
|
|
@@ -279,15 +301,17 @@
|
|
|
279
301
|
/** ------------------------ JavaScript Rules ------------------------ **/
|
|
280
302
|
|
|
281
303
|
"noAccumulatingSpread": "error",
|
|
304
|
+
"noAwaitInLoops": "error",
|
|
282
305
|
"noBarrelFile": "error",
|
|
283
306
|
"noDelete": "error",
|
|
284
307
|
"noDynamicNamespaceImportAccess": "error",
|
|
308
|
+
"noJsxPropsBind": "error",
|
|
285
309
|
"noNamespaceImport": "error",
|
|
310
|
+
"noSyncScripts": "error",
|
|
286
311
|
"noUnwantedPolyfillio": "error",
|
|
287
312
|
"useGoogleFontPreconnect": "error",
|
|
288
313
|
"useTopLevelRegex": "error",
|
|
289
314
|
|
|
290
|
-
"noAwaitInLoops": "off",
|
|
291
315
|
"noReExportAll": "off"
|
|
292
316
|
},
|
|
293
317
|
"security": {
|
|
@@ -297,6 +321,7 @@
|
|
|
297
321
|
"noDangerouslySetInnerHtml": "error",
|
|
298
322
|
"noDangerouslySetInnerHtmlWithChildren": "error",
|
|
299
323
|
"noGlobalEval": "error",
|
|
324
|
+
"noScriptUrl": "error",
|
|
300
325
|
|
|
301
326
|
"noSecrets": "off"
|
|
302
327
|
},
|
|
@@ -305,7 +330,11 @@
|
|
|
305
330
|
|
|
306
331
|
"noEnum": "error",
|
|
307
332
|
"noExportedImports": "error",
|
|
333
|
+
// Matches no-plusplus in the oxlint/ESLint configs.
|
|
334
|
+
"noIncrementDecrement": "error",
|
|
308
335
|
"noInferrableTypes": "error",
|
|
336
|
+
"noMultiAssign": "error",
|
|
337
|
+
"noMultilineString": "error",
|
|
309
338
|
"noNamespace": "error",
|
|
310
339
|
"noNegationElse": "error",
|
|
311
340
|
"noNestedTernary": "error",
|
|
@@ -315,6 +344,7 @@
|
|
|
315
344
|
"noRestrictedGlobals": "error",
|
|
316
345
|
"noRestrictedImports": "error",
|
|
317
346
|
"noRestrictedTypes": "error",
|
|
347
|
+
"noRootType": "error",
|
|
318
348
|
"noShoutyConstants": "error",
|
|
319
349
|
"noSubstr": "error",
|
|
320
350
|
"noUnusedTemplateLiteral": "error",
|
|
@@ -332,7 +362,10 @@
|
|
|
332
362
|
"useConsistentArrowReturn": "error",
|
|
333
363
|
"useConsistentArrayType": "error",
|
|
334
364
|
"useConsistentBuiltinInstantiation": "error",
|
|
365
|
+
"useConsistentEnumValueType": "error",
|
|
366
|
+
"useConsistentGraphqlDescriptions": "error",
|
|
335
367
|
"useConsistentMemberAccessibility": "error",
|
|
368
|
+
"useConsistentMethodSignatures": "error",
|
|
336
369
|
"useConsistentObjectDefinitions": "error",
|
|
337
370
|
"useConsistentTypeDefinitions": {
|
|
338
371
|
"level": "error",
|
|
@@ -344,7 +377,9 @@
|
|
|
344
377
|
"useDefaultParameterLast": "error",
|
|
345
378
|
"useDefaultSwitchClause": "error",
|
|
346
379
|
"useDeprecatedReason": "error",
|
|
380
|
+
"useDestructuring": "error",
|
|
347
381
|
"useEnumInitializers": "error",
|
|
382
|
+
"useErrorCause": "error",
|
|
348
383
|
"useExponentiationOperator": "error",
|
|
349
384
|
"useExportType": "error",
|
|
350
385
|
"useFilenamingConvention": {
|
|
@@ -359,7 +394,9 @@
|
|
|
359
394
|
"useGraphqlNamingConvention": "error",
|
|
360
395
|
"useGroupedAccessorPairs": "error",
|
|
361
396
|
"useImportType": "error",
|
|
397
|
+
"useInputName": "error",
|
|
362
398
|
"useLiteralEnumMembers": "error",
|
|
399
|
+
"useLoneExecutableDefinition": "error",
|
|
363
400
|
"useNodeAssertStrict": "error",
|
|
364
401
|
"useNodejsImportProtocol": "error",
|
|
365
402
|
"useNumberNamespace": "error",
|
|
@@ -369,6 +406,7 @@
|
|
|
369
406
|
"useSelfClosingElements": "error",
|
|
370
407
|
"useShorthandAssign": "error",
|
|
371
408
|
"useShorthandFunctionType": "error",
|
|
409
|
+
"useSpreadOverApply": "error",
|
|
372
410
|
"useSymbolDescription": "error",
|
|
373
411
|
"useTemplate": "error",
|
|
374
412
|
"useThrowNewError": "error",
|
|
@@ -377,11 +415,18 @@
|
|
|
377
415
|
"useUnifiedTypeSignatures": "error",
|
|
378
416
|
|
|
379
417
|
"noCommonJs": "off",
|
|
418
|
+
"noContinue": "off",
|
|
380
419
|
"noDefaultExport": "off",
|
|
420
|
+
"noExcessiveClassesPerFile": "off",
|
|
421
|
+
"noExcessiveLinesPerFile": "off",
|
|
422
|
+
"noHexColors": "off",
|
|
381
423
|
"noImplicitBoolean": "off",
|
|
382
424
|
"noJsxLiterals": "off",
|
|
425
|
+
// Matches unicorn/prefer-global-this being off in the oxlint config.
|
|
426
|
+
"useGlobalThis": "off",
|
|
383
427
|
"noMagicNumbers": "off",
|
|
384
428
|
"noProcessEnv": "off",
|
|
429
|
+
"noTernary": "off",
|
|
385
430
|
"useComponentExportOnlyModules": "off",
|
|
386
431
|
"useConsistentCurlyBraces": "off",
|
|
387
432
|
"useExplicitLengthCheck": "off",
|
|
@@ -412,17 +457,22 @@
|
|
|
412
457
|
"noConstEnum": "error",
|
|
413
458
|
"noControlCharactersInRegex": "error",
|
|
414
459
|
"noDebugger": "error",
|
|
460
|
+
"noDeprecatedMediaType": "error",
|
|
415
461
|
"noDocumentCookie": "error",
|
|
416
462
|
"noDoubleEquals": "error",
|
|
417
463
|
"noDuplicateCase": "error",
|
|
418
464
|
"noDuplicateClassMembers": "error",
|
|
419
465
|
"noDuplicateDependencies": "error",
|
|
466
|
+
"noDuplicatedSpreadProps": "error",
|
|
420
467
|
"noDuplicateElseIf": "error",
|
|
468
|
+
"noDuplicateEnumValues": "error",
|
|
421
469
|
"noDuplicateFields": "error",
|
|
470
|
+
"noDuplicateGraphqlOperationName": "error",
|
|
422
471
|
"noDuplicateObjectKeys": "error",
|
|
423
472
|
"noDuplicateParameters": "error",
|
|
424
473
|
"noEmptyBlockStatements": "error",
|
|
425
474
|
"noEmptyInterface": "error",
|
|
475
|
+
"noEqualsToNull": "error",
|
|
426
476
|
"noEvolvingTypes": "error",
|
|
427
477
|
"noExplicitAny": "error",
|
|
428
478
|
"noExtraNonNullAssertion": "error",
|
|
@@ -438,18 +488,25 @@
|
|
|
438
488
|
"noMisleadingCharacterClass": "error",
|
|
439
489
|
"noMisleadingInstantiator": "error",
|
|
440
490
|
"noMisrefactoredShorthandAssign": "error",
|
|
491
|
+
"noNestedPromises": "error",
|
|
441
492
|
"noOctalEscape": "error",
|
|
493
|
+
"noParametersOnlyUsedInRecursion": "error",
|
|
494
|
+
"noProto": "error",
|
|
442
495
|
"noPrototypeBuiltins": "error",
|
|
443
496
|
"noQuickfixBiome": "error",
|
|
444
497
|
"noRedeclare": "error",
|
|
445
498
|
"noRedundantUseStrict": "error",
|
|
499
|
+
"noReturnAssign": "error",
|
|
446
500
|
"noSelfCompare": "error",
|
|
501
|
+
"noShadow": "error",
|
|
447
502
|
"noShadowRestrictedNames": "error",
|
|
448
503
|
"noSparseArray": "error",
|
|
449
504
|
"noTemplateCurlyInString": "error",
|
|
450
505
|
"noThenProperty": "error",
|
|
451
506
|
"noTsIgnore": "error",
|
|
452
507
|
"noUnassignedVariables": "error",
|
|
508
|
+
"noUnknownAttribute": "error",
|
|
509
|
+
"noUnnecessaryConditions": "error",
|
|
453
510
|
"noUnsafeDeclarationMerging": "error",
|
|
454
511
|
"noUnsafeNegation": "error",
|
|
455
512
|
"noUselessEscapeInString": "error",
|
|
@@ -457,6 +514,7 @@
|
|
|
457
514
|
"noVar": "error",
|
|
458
515
|
"noWith": "error",
|
|
459
516
|
"useAdjacentOverloadSignatures": "error",
|
|
517
|
+
"useArraySortCompare": "error",
|
|
460
518
|
"useAwait": "error",
|
|
461
519
|
"useBiomeIgnoreFolder": "error",
|
|
462
520
|
"useDefaultSwitchClauseLast": "error",
|
|
@@ -468,12 +526,15 @@
|
|
|
468
526
|
"useIterableCallbackReturn": "error",
|
|
469
527
|
"useNamespaceKeyword": "error",
|
|
470
528
|
"useNumberToFixedDigitsArgument": "error",
|
|
529
|
+
"useRequiredScripts": "error",
|
|
471
530
|
"useStaticResponseMethods": "error",
|
|
472
531
|
"useStrictMode": "error",
|
|
473
532
|
"noNonNullAssertedOptionalChain": "error",
|
|
474
533
|
"noUnusedExpressions": "error",
|
|
475
534
|
|
|
476
535
|
"noConsole": "off",
|
|
536
|
+
"noForIn": "off",
|
|
537
|
+
"noUndeclaredEnvVars": "off",
|
|
477
538
|
"useDeprecatedDate": "off",
|
|
478
539
|
|
|
479
540
|
/** ------ Project/Scanner rules. Use ultracite/biome/type-aware to enable. ------ **/
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
"linter": {
|
|
5
5
|
"rules": {
|
|
6
6
|
"correctness": {
|
|
7
|
-
"
|
|
7
|
+
"noBeforeInteractiveScriptOutsideDocument": "error",
|
|
8
|
+
"noNextAsyncClientComponent": "error",
|
|
9
|
+
"useInlineScriptId": "error"
|
|
8
10
|
},
|
|
9
11
|
"performance": {
|
|
10
12
|
"noImgElement": "error"
|
|
@@ -18,10 +18,30 @@
|
|
|
18
18
|
"noVueDuplicateKeys": "error",
|
|
19
19
|
"noVueReservedKeys": "error",
|
|
20
20
|
"noVueReservedProps": "error",
|
|
21
|
-
"noVueSetupPropsReactivityLoss": "error"
|
|
21
|
+
"noVueSetupPropsReactivityLoss": "error",
|
|
22
|
+
"noVueVIfWithVFor": "error",
|
|
23
|
+
"useVueVForKey": "error",
|
|
24
|
+
"useVueValidTemplateRoot": "error",
|
|
25
|
+
"useVueValidVBind": "error",
|
|
26
|
+
"useVueValidVCloak": "error",
|
|
27
|
+
"useVueValidVElse": "error",
|
|
28
|
+
"useVueValidVElseIf": "error",
|
|
29
|
+
"useVueValidVHtml": "error",
|
|
30
|
+
"useVueValidVIf": "error",
|
|
31
|
+
"useVueValidVOn": "error",
|
|
32
|
+
"useVueValidVOnce": "error",
|
|
33
|
+
"useVueValidVPre": "error",
|
|
34
|
+
"useVueValidVText": "error"
|
|
22
35
|
},
|
|
23
36
|
"suspicious": {
|
|
24
|
-
"noReactSpecificProps": "error"
|
|
37
|
+
"noReactSpecificProps": "error",
|
|
38
|
+
"noVueArrowFuncInWatch": "error"
|
|
39
|
+
},
|
|
40
|
+
"style": {
|
|
41
|
+
"useVueConsistentVBindStyle": "error",
|
|
42
|
+
"useVueConsistentVOnStyle": "error",
|
|
43
|
+
"useVueHyphenatedAttributes": "error",
|
|
44
|
+
"useVueMultiWordComponentNames": "error"
|
|
25
45
|
}
|
|
26
46
|
}
|
|
27
47
|
}
|
|
@@ -8,7 +8,10 @@ const baseRules = Object.fromEntries(
|
|
|
8
8
|
availableKeys.map((key) => [`astro/${key}`, "error"])
|
|
9
9
|
);
|
|
10
10
|
|
|
11
|
-
const overrideRules = {
|
|
11
|
+
const overrideRules = {
|
|
12
|
+
// Prettier owns formatting for .astro files.
|
|
13
|
+
"astro/semi": "off",
|
|
14
|
+
};
|
|
12
15
|
|
|
13
16
|
const config = Object.assign(baseRules, overrideRules);
|
|
14
17
|
|
|
@@ -9,6 +9,7 @@ import cypress from "eslint-plugin-cypress";
|
|
|
9
9
|
import github from "eslint-plugin-github";
|
|
10
10
|
import html from "eslint-plugin-html";
|
|
11
11
|
import { importX } from "eslint-plugin-import-x";
|
|
12
|
+
import jsdocPlugin from "eslint-plugin-jsdoc";
|
|
12
13
|
import n from "eslint-plugin-n";
|
|
13
14
|
import prettier from "eslint-plugin-prettier";
|
|
14
15
|
import promise from "eslint-plugin-promise";
|
|
@@ -25,6 +26,7 @@ import eslintTypescriptRules from "./rules/eslint-typescript.mjs";
|
|
|
25
26
|
import eslintRules from "./rules/eslint.mjs";
|
|
26
27
|
import githubRules from "./rules/github.mjs";
|
|
27
28
|
import importRules from "./rules/import.mjs";
|
|
29
|
+
import jsdocRules from "./rules/jsdoc.mjs";
|
|
28
30
|
import nRules from "./rules/n.mjs";
|
|
29
31
|
import prettierRules from "./rules/prettier.mjs";
|
|
30
32
|
import promiseRules from "./rules/promise.mjs";
|
|
@@ -63,6 +65,7 @@ const config = [
|
|
|
63
65
|
compat,
|
|
64
66
|
github,
|
|
65
67
|
"import-x": importX,
|
|
68
|
+
jsdoc: jsdocPlugin,
|
|
66
69
|
n,
|
|
67
70
|
prettier,
|
|
68
71
|
promise,
|
|
@@ -73,10 +76,16 @@ const config = [
|
|
|
73
76
|
rules: {
|
|
74
77
|
...eslintRules,
|
|
75
78
|
...importRules,
|
|
79
|
+
...jsdocRules,
|
|
76
80
|
...promiseRules,
|
|
77
81
|
...nRules,
|
|
78
82
|
...prettierRules,
|
|
79
83
|
...eslintPrettier.rules,
|
|
84
|
+
// eslint-config-prettier disables these defensively, but they don't
|
|
85
|
+
// conflict with our Prettier settings and the oxlint config enforces
|
|
86
|
+
// them alongside oxfmt.
|
|
87
|
+
curly: "error",
|
|
88
|
+
"no-unexpected-multiline": "error",
|
|
80
89
|
...unusedImportsRules,
|
|
81
90
|
...sonarjsRules,
|
|
82
91
|
...compatRules,
|
|
@@ -15,14 +15,12 @@ const config = {
|
|
|
15
15
|
"lines-between-class-members": "off",
|
|
16
16
|
"no-array-constructor": "off",
|
|
17
17
|
"no-dupe-class-members": "off",
|
|
18
|
-
"no-duplicate-imports": "off",
|
|
19
18
|
"no-empty-function": "off",
|
|
20
19
|
"no-extra-parens": "off",
|
|
21
20
|
"no-extra-semi": "off",
|
|
22
21
|
"no-implied-eval": "off",
|
|
23
22
|
"no-invalid-this": "off",
|
|
24
23
|
"no-loop-func": "off",
|
|
25
|
-
"no-loss-of-precision": "off",
|
|
26
24
|
"no-magic-numbers": "off",
|
|
27
25
|
"no-redeclare": "off",
|
|
28
26
|
"no-restricted-imports": "off",
|
|
@@ -3,15 +3,29 @@ import plugin from "@eslint/js";
|
|
|
3
3
|
// Create a new object to avoid mutating the readonly rules object
|
|
4
4
|
const baseRules = { ...plugin.configs.all.rules };
|
|
5
5
|
|
|
6
|
+
// Overrides mirror the oxlint core config (config/oxlint/core/index.mjs),
|
|
7
|
+
// which is the benchmark for rule decisions across linters.
|
|
6
8
|
const overrideRules = {
|
|
7
9
|
"capitalized-comments": "off",
|
|
8
|
-
"
|
|
10
|
+
"func-style": ["error", "expression", { allowArrowFunctions: true }],
|
|
11
|
+
"id-length": "off",
|
|
12
|
+
"init-declarations": "off",
|
|
13
|
+
"max-depth": "off",
|
|
9
14
|
"max-lines": "off",
|
|
10
15
|
"max-lines-per-function": "off",
|
|
11
16
|
"max-params": "off",
|
|
12
17
|
"max-statements": "off",
|
|
18
|
+
"new-cap": "off",
|
|
19
|
+
"no-console": "off",
|
|
20
|
+
"no-continue": "off",
|
|
21
|
+
"no-duplicate-imports": ["error", { allowSeparateTypeImports: true }],
|
|
22
|
+
"no-implicit-coercion": "off",
|
|
23
|
+
"no-restricted-properties": "off",
|
|
13
24
|
"no-ternary": "off",
|
|
14
25
|
"no-undefined": "off",
|
|
26
|
+
"no-underscore-dangle": "off",
|
|
27
|
+
// Avoid conflict with @typescript-eslint/no-floating-promises
|
|
28
|
+
"no-void": ["error", { allowAsStatement: true }],
|
|
15
29
|
"one-var": "off",
|
|
16
30
|
// https://github.com/eslint/eslint/issues/11542
|
|
17
31
|
"sort-imports": "off",
|
|
@@ -10,7 +10,11 @@ const baseRules = Object.fromEntries(
|
|
|
10
10
|
availableKeys.map((key) => [`github/${key}`, "error"])
|
|
11
11
|
);
|
|
12
12
|
|
|
13
|
+
// Overrides mirror the oxlint github preset (config/oxlint/github), which
|
|
14
|
+
// is the benchmark for rule decisions across linters.
|
|
13
15
|
const overrideRules = {
|
|
16
|
+
// Conflicts with unicorn/prefer-dom-node-dataset, which is the benchmark.
|
|
17
|
+
"github/no-dataset": "off",
|
|
14
18
|
"github/unescaped-html-literal": "off",
|
|
15
19
|
};
|
|
16
20
|
|
|
@@ -8,20 +8,28 @@ const baseRules = Object.fromEntries(
|
|
|
8
8
|
availableKeys.map((key) => [`import-x/${key}`, "error"])
|
|
9
9
|
);
|
|
10
10
|
|
|
11
|
+
// Overrides mirror the oxlint core config (config/oxlint/core/index.mjs),
|
|
12
|
+
// which is the benchmark for rule decisions across linters.
|
|
11
13
|
const overrideRules = {
|
|
12
14
|
"import-x/consistent-type-specifier-style": ["error", "prefer-top-level"],
|
|
13
15
|
"import-x/exports-last": "off",
|
|
14
16
|
"import-x/extensions": "off",
|
|
15
17
|
"import-x/group-exports": "off",
|
|
16
18
|
"import-x/max-dependencies": "off",
|
|
19
|
+
"import-x/no-anonymous-default-export": "off",
|
|
20
|
+
"import-x/no-commonjs": "off",
|
|
17
21
|
"import-x/no-default-export": "off",
|
|
22
|
+
"import-x/no-dynamic-require": "off",
|
|
18
23
|
"import-x/no-internal-modules": "off",
|
|
19
|
-
"import-x/no-named-as-default": "off",
|
|
20
24
|
"import-x/no-named-export": "off",
|
|
21
25
|
"import-x/no-namespace": "off",
|
|
26
|
+
"import-x/no-nodejs-modules": "off",
|
|
22
27
|
"import-x/no-relative-parent-imports": "off",
|
|
23
28
|
"import-x/no-unassigned-import": "off",
|
|
24
29
|
"import-x/no-unresolved": "off",
|
|
30
|
+
// No-op under ESLint 10 (the FileEnumerator API it needs was removed)
|
|
31
|
+
// and it prints a warning on every run while enabled.
|
|
32
|
+
"import-x/no-unused-modules": "off",
|
|
25
33
|
"import-x/order": [
|
|
26
34
|
"error",
|
|
27
35
|
{
|
|
@@ -38,6 +46,7 @@ const overrideRules = {
|
|
|
38
46
|
},
|
|
39
47
|
],
|
|
40
48
|
"import-x/prefer-default-export": "off",
|
|
49
|
+
"import-x/unambiguous": "off",
|
|
41
50
|
};
|
|
42
51
|
|
|
43
52
|
const config = Object.assign(baseRules, overrideRules);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Mirrors the jsdoc section of the oxlint core config
|
|
2
|
+
// (config/oxlint/core/index.mjs), which is the benchmark for rule decisions
|
|
3
|
+
// across linters. Only the rules oxlint implements are enabled here — the
|
|
4
|
+
// rest of eslint-plugin-jsdoc's rules stay off to keep the two presets in
|
|
5
|
+
// lockstep.
|
|
6
|
+
const config = {
|
|
7
|
+
"jsdoc/check-access": "error",
|
|
8
|
+
"jsdoc/check-property-names": "error",
|
|
9
|
+
"jsdoc/check-tag-names": "error",
|
|
10
|
+
"jsdoc/empty-tags": "error",
|
|
11
|
+
"jsdoc/implements-on-classes": "error",
|
|
12
|
+
"jsdoc/no-defaults": "error",
|
|
13
|
+
"jsdoc/require-param": "off",
|
|
14
|
+
"jsdoc/require-param-description": "error",
|
|
15
|
+
"jsdoc/require-param-name": "error",
|
|
16
|
+
"jsdoc/require-param-type": "off",
|
|
17
|
+
"jsdoc/require-property": "error",
|
|
18
|
+
"jsdoc/require-property-description": "error",
|
|
19
|
+
"jsdoc/require-property-name": "error",
|
|
20
|
+
"jsdoc/require-property-type": "error",
|
|
21
|
+
"jsdoc/require-returns": "off",
|
|
22
|
+
"jsdoc/require-returns-description": "error",
|
|
23
|
+
"jsdoc/require-returns-type": "off",
|
|
24
|
+
"jsdoc/require-throws-description": "error",
|
|
25
|
+
"jsdoc/require-throws-type": "error",
|
|
26
|
+
"jsdoc/require-yields": "error",
|
|
27
|
+
"jsdoc/require-yields-description": "error",
|
|
28
|
+
"jsdoc/require-yields-type": "error",
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default config;
|
|
@@ -10,10 +10,15 @@ const baseRules = Object.fromEntries(
|
|
|
10
10
|
availableKeys.map((key) => [`n/${key}`, "error"])
|
|
11
11
|
);
|
|
12
12
|
|
|
13
|
+
// Overrides mirror the oxlint core config (config/oxlint/core/index.mjs),
|
|
14
|
+
// which is the benchmark for rule decisions across linters.
|
|
13
15
|
const overrideRules = {
|
|
14
16
|
"n/file-extension-in-import": "off",
|
|
15
17
|
"n/no-missing-import": "off",
|
|
16
18
|
"n/no-process-env": "off",
|
|
19
|
+
// Matches unicorn/no-process-exit being off in the oxlint config.
|
|
20
|
+
"n/no-process-exit": "off",
|
|
21
|
+
"n/no-sync": "off",
|
|
17
22
|
"n/no-unsupported-features/es-builtins": "off",
|
|
18
23
|
"n/no-unsupported-features/es-syntax": "off",
|
|
19
24
|
"n/no-unsupported-features/node-builtins": "off",
|
|
@@ -10,8 +10,13 @@ const baseRules = Object.fromEntries(
|
|
|
10
10
|
availableKeys.map((key) => [`promise/${key}`, "error"])
|
|
11
11
|
);
|
|
12
12
|
|
|
13
|
+
// Overrides mirror the oxlint core config (config/oxlint/core/index.mjs),
|
|
14
|
+
// which is the benchmark for rule decisions across linters. always-return
|
|
15
|
+
// and catch-or-return are off there because prefer-await-to-then already
|
|
16
|
+
// steers code away from .then() chains.
|
|
13
17
|
const overrideRules = {
|
|
14
|
-
"promise/
|
|
18
|
+
"promise/always-return": "off",
|
|
19
|
+
"promise/catch-or-return": "off",
|
|
15
20
|
"promise/no-native": "off",
|
|
16
21
|
};
|
|
17
22
|
|
|
@@ -10,8 +10,25 @@ const baseRules = Object.fromEntries(
|
|
|
10
10
|
availableKeys.map((key) => [`sonarjs/${key}`, "error"])
|
|
11
11
|
);
|
|
12
12
|
|
|
13
|
+
// Overrides mirror the oxlint sonarjs preset (config/oxlint/sonarjs), which
|
|
14
|
+
// is the benchmark for rule decisions across linters.
|
|
13
15
|
const overrideRules = {
|
|
16
|
+
// Fights the formatter (arrowParentheses: always).
|
|
17
|
+
"sonarjs/arrow-function-convention": "off",
|
|
18
|
+
// Matches Biome's noExcessiveCognitiveComplexity limit.
|
|
19
|
+
"sonarjs/cognitive-complexity": ["error", 20],
|
|
20
|
+
// Duplicate of the core complexity rule.
|
|
21
|
+
"sonarjs/cyclomatic-complexity": "off",
|
|
14
22
|
"sonarjs/elseif-without-else": "off",
|
|
23
|
+
// Requires a headerFormat option; errors on every file without one.
|
|
24
|
+
"sonarjs/file-header": "off",
|
|
25
|
+
// The preset disables max-lines everywhere.
|
|
26
|
+
"sonarjs/max-lines": "off",
|
|
27
|
+
"sonarjs/max-lines-per-function": "off",
|
|
28
|
+
// Duplicate of max-depth, which is off.
|
|
29
|
+
"sonarjs/nested-control-flow": "off",
|
|
30
|
+
// Conflicts with sort-keys.
|
|
31
|
+
"sonarjs/shorthand-property-grouping": "off",
|
|
15
32
|
};
|
|
16
33
|
|
|
17
34
|
const config = Object.assign(baseRules, overrideRules);
|
|
@@ -10,9 +10,15 @@ const baseRules = Object.fromEntries(
|
|
|
10
10
|
availableKeys.map((key) => [`@typescript-eslint/${key}`, "error"])
|
|
11
11
|
);
|
|
12
12
|
|
|
13
|
+
// Overrides mirror the oxlint core config (config/oxlint/core/index.mjs),
|
|
14
|
+
// which is the benchmark for rule decisions across linters. Notably,
|
|
15
|
+
// consistent-type-definitions is left at its default ("interface"),
|
|
16
|
+
// matching oxlint and Biome's useConsistentTypeDefinitions.
|
|
13
17
|
const overrideRules = {
|
|
14
|
-
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
|
15
18
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
19
|
+
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
20
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
21
|
+
"@typescript-eslint/init-declarations": "off",
|
|
16
22
|
"@typescript-eslint/naming-convention": [
|
|
17
23
|
"error",
|
|
18
24
|
{
|
|
@@ -26,7 +32,12 @@ const overrideRules = {
|
|
|
26
32
|
},
|
|
27
33
|
],
|
|
28
34
|
"@typescript-eslint/no-magic-numbers": "off",
|
|
35
|
+
"@typescript-eslint/no-require-imports": "off",
|
|
29
36
|
"@typescript-eslint/prefer-readonly-parameter-types": "off",
|
|
37
|
+
// Kept on even though oxlint sets typescript/require-await off — oxlint
|
|
38
|
+
// applies the base require-await rule to TS files natively, so this is
|
|
39
|
+
// the behavioral equivalent here.
|
|
40
|
+
"@typescript-eslint/require-await": "error",
|
|
30
41
|
"@typescript-eslint/return-await": ["error", "always"],
|
|
31
42
|
};
|
|
32
43
|
|