ultracite 7.8.3 → 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 +18 -19
- package/config/biome/core/biome.jsonc +68 -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/oxfmt/index.mjs +1 -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/config/shared/ignores.mjs +3 -0
- package/dist/index.js +64 -100
- package/package.json +24 -20
package/README.md
CHANGED
|
@@ -22,30 +22,30 @@ The interactive setup guides you through choosing your formatter/linter, framewo
|
|
|
22
22
|
|
|
23
23
|
## Commands
|
|
24
24
|
|
|
25
|
-
| Command
|
|
26
|
-
|
|
|
27
|
-
| `ultracite init`
|
|
25
|
+
| Command | Description |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| `ultracite init` | Initialize Ultracite in the current directory (interactive by default). |
|
|
28
28
|
| `ultracite check [files...]` | Lint without writing changes. Unknown flags are passed through to the underlying linter. |
|
|
29
|
-
| `ultracite fix [files...]`
|
|
30
|
-
| `ultracite doctor`
|
|
29
|
+
| `ultracite fix [files...]` | Lint and auto-fix. Unknown flags are passed through to the underlying linter. |
|
|
30
|
+
| `ultracite doctor` | Verify your Ultracite setup and diagnose configuration issues. |
|
|
31
31
|
|
|
32
32
|
`check` and `fix` accept an optional list of files or globs; omit them to run against the whole project. Add `-v` / `--version` or `-h` / `--help` for CLI details.
|
|
33
33
|
|
|
34
34
|
Common `init` flags for non-interactive / CI use:
|
|
35
35
|
|
|
36
|
-
| Flag
|
|
37
|
-
|
|
|
38
|
-
| `--linter <linter>`
|
|
39
|
-
| `--pm <pm>`
|
|
40
|
-
| `--editors <editors...>`
|
|
41
|
-
| `--agents <agents...>`
|
|
42
|
-
| `--frameworks <frameworks...>` | Frameworks in use, for framework-aware rules.
|
|
43
|
-
| `--type-aware`
|
|
44
|
-
| `--install-skill`
|
|
45
|
-
| `--skip-install`
|
|
46
|
-
| `--quiet`
|
|
36
|
+
| Flag | Description |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| `--linter <linter>` | Toolchain to configure (Biome, ESLint, or Oxlint). |
|
|
39
|
+
| `--pm <pm>` | Package manager to use. |
|
|
40
|
+
| `--editors <editors...>` | Editors to configure (use `universal` for `.vscode/settings.json`). |
|
|
41
|
+
| `--agents <agents...>` | AI agents to enable (use `universal` for `AGENTS.md`). |
|
|
42
|
+
| `--frameworks <frameworks...>` | Frameworks in use, for framework-aware rules. |
|
|
43
|
+
| `--type-aware` | Enable type-aware linting. |
|
|
44
|
+
| `--install-skill` | Install the reusable Ultracite skill after setup. |
|
|
45
|
+
| `--skip-install` | Configure without installing dependencies. |
|
|
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
|
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
"!!**/.turbo",
|
|
23
23
|
"!!**/.vercel",
|
|
24
24
|
"!!**/.netlify",
|
|
25
|
+
"!!**/.wrangler",
|
|
26
|
+
"!!**/.wrangler-dry-run",
|
|
25
27
|
"!!**/.docusaurus",
|
|
26
28
|
"!!**/.cache",
|
|
27
29
|
"!!**/.parcel-cache",
|
|
@@ -42,6 +44,7 @@
|
|
|
42
44
|
"!!**/schema.d.ts",
|
|
43
45
|
"!!**/schema.graphql.d.ts",
|
|
44
46
|
"!!**/*.d.ts.map",
|
|
47
|
+
"!!**/.yarn",
|
|
45
48
|
"!!**/coverage",
|
|
46
49
|
"!!**/.nyc_output",
|
|
47
50
|
"!!**/.expo",
|
|
@@ -75,14 +78,24 @@
|
|
|
75
78
|
"organizeImports": "on",
|
|
76
79
|
// Enforce attribute sorting in JSX elements.
|
|
77
80
|
"useSortedAttributes": "on",
|
|
78
|
-
// Enforce ordering of a JS object properties.
|
|
79
|
-
|
|
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",
|
|
80
87
|
// Enforce no duplicate classes in the file.
|
|
81
88
|
"noDuplicateClasses": "on",
|
|
82
89
|
// Enforce ordering of a TypeScript interface members.
|
|
83
90
|
"useSortedInterfaceMembers": "on",
|
|
84
91
|
// Enforce ordering of a JavaScript object properties.
|
|
85
|
-
"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"
|
|
86
99
|
}
|
|
87
100
|
}
|
|
88
101
|
},
|
|
@@ -93,6 +106,7 @@
|
|
|
93
106
|
/** ------------------------ JavaScript Rules ------------------------ **/
|
|
94
107
|
|
|
95
108
|
"noAccessKey": "error",
|
|
109
|
+
"noAmbiguousAnchorText": "error",
|
|
96
110
|
"noAriaHiddenOnFocusable": "error",
|
|
97
111
|
"noAriaUnsupportedElements": "error",
|
|
98
112
|
"noDistractingElements": "error",
|
|
@@ -140,6 +154,7 @@
|
|
|
140
154
|
"noArguments": "error",
|
|
141
155
|
"noBannedTypes": "error",
|
|
142
156
|
"noCommaOperator": "error",
|
|
157
|
+
"noDivRegex": "error",
|
|
143
158
|
"noEmptyTypeParameters": "error",
|
|
144
159
|
"noExcessiveCognitiveComplexity": {
|
|
145
160
|
"level": "error",
|
|
@@ -150,6 +165,7 @@
|
|
|
150
165
|
"noExtraBooleanCast": "error",
|
|
151
166
|
"noFlatMapIdentity": "error",
|
|
152
167
|
"noForEach": "error",
|
|
168
|
+
"noRedundantDefaultExport": "error",
|
|
153
169
|
"noStaticOnlyClass": "error",
|
|
154
170
|
"noThisInStatic": "error",
|
|
155
171
|
"noUselessCatch": "error",
|
|
@@ -162,6 +178,7 @@
|
|
|
162
178
|
"noUselessLabel": "error",
|
|
163
179
|
"noUselessLoneBlockStatements": "error",
|
|
164
180
|
"noUselessRename": "error",
|
|
181
|
+
"noUselessReturn": "error",
|
|
165
182
|
"noUselessStringConcat": "error",
|
|
166
183
|
"noUselessStringRaw": "error",
|
|
167
184
|
"noUselessSwitchCase": "error",
|
|
@@ -171,6 +188,7 @@
|
|
|
171
188
|
"noUselessUndefined": "error",
|
|
172
189
|
"noUselessUndefinedInitialization": "error",
|
|
173
190
|
"noVoid": "error",
|
|
191
|
+
"useArrayFind": "error",
|
|
174
192
|
"useArrowFunction": "error",
|
|
175
193
|
"useDateNow": "error",
|
|
176
194
|
"useFlatMap": "error",
|
|
@@ -197,6 +215,11 @@
|
|
|
197
215
|
"noConstantMathMinMaxClamp": "error",
|
|
198
216
|
"noConstAssign": "error",
|
|
199
217
|
"noConstructorReturn": "error",
|
|
218
|
+
"noDuplicateArgumentNames": "error",
|
|
219
|
+
"noDuplicateAttributes": "error",
|
|
220
|
+
"noDuplicateEnumValueNames": "error",
|
|
221
|
+
"noDuplicateInputFieldNames": "error",
|
|
222
|
+
"noDuplicateVariableNames": "error",
|
|
200
223
|
"noEmptyCharacterClassInRegex": "error",
|
|
201
224
|
"noEmptyPattern": "error",
|
|
202
225
|
"noGlobalDirnameFilename": "error",
|
|
@@ -222,6 +245,7 @@
|
|
|
222
245
|
"fix": "safe",
|
|
223
246
|
"level": "error"
|
|
224
247
|
},
|
|
248
|
+
"noUnusedInstantiation": "error",
|
|
225
249
|
"noUnusedLabels": "error",
|
|
226
250
|
"noUnusedPrivateClassMembers": "error",
|
|
227
251
|
"noUnusedVariables": "error",
|
|
@@ -229,6 +253,7 @@
|
|
|
229
253
|
"useGraphqlNamedOperations": "error",
|
|
230
254
|
"useImageSize": "error",
|
|
231
255
|
"useIsNan": "error",
|
|
256
|
+
"useLoneAnonymousOperation": "error",
|
|
232
257
|
"useParseIntRadix": "error",
|
|
233
258
|
"useSingleJsDocAsterisk": "error",
|
|
234
259
|
"useValidForDirection": "error",
|
|
@@ -276,15 +301,17 @@
|
|
|
276
301
|
/** ------------------------ JavaScript Rules ------------------------ **/
|
|
277
302
|
|
|
278
303
|
"noAccumulatingSpread": "error",
|
|
304
|
+
"noAwaitInLoops": "error",
|
|
279
305
|
"noBarrelFile": "error",
|
|
280
306
|
"noDelete": "error",
|
|
281
307
|
"noDynamicNamespaceImportAccess": "error",
|
|
308
|
+
"noJsxPropsBind": "error",
|
|
282
309
|
"noNamespaceImport": "error",
|
|
310
|
+
"noSyncScripts": "error",
|
|
283
311
|
"noUnwantedPolyfillio": "error",
|
|
284
312
|
"useGoogleFontPreconnect": "error",
|
|
285
313
|
"useTopLevelRegex": "error",
|
|
286
314
|
|
|
287
|
-
"noAwaitInLoops": "off",
|
|
288
315
|
"noReExportAll": "off"
|
|
289
316
|
},
|
|
290
317
|
"security": {
|
|
@@ -294,6 +321,7 @@
|
|
|
294
321
|
"noDangerouslySetInnerHtml": "error",
|
|
295
322
|
"noDangerouslySetInnerHtmlWithChildren": "error",
|
|
296
323
|
"noGlobalEval": "error",
|
|
324
|
+
"noScriptUrl": "error",
|
|
297
325
|
|
|
298
326
|
"noSecrets": "off"
|
|
299
327
|
},
|
|
@@ -302,7 +330,11 @@
|
|
|
302
330
|
|
|
303
331
|
"noEnum": "error",
|
|
304
332
|
"noExportedImports": "error",
|
|
333
|
+
// Matches no-plusplus in the oxlint/ESLint configs.
|
|
334
|
+
"noIncrementDecrement": "error",
|
|
305
335
|
"noInferrableTypes": "error",
|
|
336
|
+
"noMultiAssign": "error",
|
|
337
|
+
"noMultilineString": "error",
|
|
306
338
|
"noNamespace": "error",
|
|
307
339
|
"noNegationElse": "error",
|
|
308
340
|
"noNestedTernary": "error",
|
|
@@ -312,6 +344,7 @@
|
|
|
312
344
|
"noRestrictedGlobals": "error",
|
|
313
345
|
"noRestrictedImports": "error",
|
|
314
346
|
"noRestrictedTypes": "error",
|
|
347
|
+
"noRootType": "error",
|
|
315
348
|
"noShoutyConstants": "error",
|
|
316
349
|
"noSubstr": "error",
|
|
317
350
|
"noUnusedTemplateLiteral": "error",
|
|
@@ -329,7 +362,10 @@
|
|
|
329
362
|
"useConsistentArrowReturn": "error",
|
|
330
363
|
"useConsistentArrayType": "error",
|
|
331
364
|
"useConsistentBuiltinInstantiation": "error",
|
|
365
|
+
"useConsistentEnumValueType": "error",
|
|
366
|
+
"useConsistentGraphqlDescriptions": "error",
|
|
332
367
|
"useConsistentMemberAccessibility": "error",
|
|
368
|
+
"useConsistentMethodSignatures": "error",
|
|
333
369
|
"useConsistentObjectDefinitions": "error",
|
|
334
370
|
"useConsistentTypeDefinitions": {
|
|
335
371
|
"level": "error",
|
|
@@ -341,7 +377,9 @@
|
|
|
341
377
|
"useDefaultParameterLast": "error",
|
|
342
378
|
"useDefaultSwitchClause": "error",
|
|
343
379
|
"useDeprecatedReason": "error",
|
|
380
|
+
"useDestructuring": "error",
|
|
344
381
|
"useEnumInitializers": "error",
|
|
382
|
+
"useErrorCause": "error",
|
|
345
383
|
"useExponentiationOperator": "error",
|
|
346
384
|
"useExportType": "error",
|
|
347
385
|
"useFilenamingConvention": {
|
|
@@ -356,7 +394,9 @@
|
|
|
356
394
|
"useGraphqlNamingConvention": "error",
|
|
357
395
|
"useGroupedAccessorPairs": "error",
|
|
358
396
|
"useImportType": "error",
|
|
397
|
+
"useInputName": "error",
|
|
359
398
|
"useLiteralEnumMembers": "error",
|
|
399
|
+
"useLoneExecutableDefinition": "error",
|
|
360
400
|
"useNodeAssertStrict": "error",
|
|
361
401
|
"useNodejsImportProtocol": "error",
|
|
362
402
|
"useNumberNamespace": "error",
|
|
@@ -366,6 +406,7 @@
|
|
|
366
406
|
"useSelfClosingElements": "error",
|
|
367
407
|
"useShorthandAssign": "error",
|
|
368
408
|
"useShorthandFunctionType": "error",
|
|
409
|
+
"useSpreadOverApply": "error",
|
|
369
410
|
"useSymbolDescription": "error",
|
|
370
411
|
"useTemplate": "error",
|
|
371
412
|
"useThrowNewError": "error",
|
|
@@ -374,11 +415,18 @@
|
|
|
374
415
|
"useUnifiedTypeSignatures": "error",
|
|
375
416
|
|
|
376
417
|
"noCommonJs": "off",
|
|
418
|
+
"noContinue": "off",
|
|
377
419
|
"noDefaultExport": "off",
|
|
420
|
+
"noExcessiveClassesPerFile": "off",
|
|
421
|
+
"noExcessiveLinesPerFile": "off",
|
|
422
|
+
"noHexColors": "off",
|
|
378
423
|
"noImplicitBoolean": "off",
|
|
379
424
|
"noJsxLiterals": "off",
|
|
425
|
+
// Matches unicorn/prefer-global-this being off in the oxlint config.
|
|
426
|
+
"useGlobalThis": "off",
|
|
380
427
|
"noMagicNumbers": "off",
|
|
381
428
|
"noProcessEnv": "off",
|
|
429
|
+
"noTernary": "off",
|
|
382
430
|
"useComponentExportOnlyModules": "off",
|
|
383
431
|
"useConsistentCurlyBraces": "off",
|
|
384
432
|
"useExplicitLengthCheck": "off",
|
|
@@ -409,17 +457,22 @@
|
|
|
409
457
|
"noConstEnum": "error",
|
|
410
458
|
"noControlCharactersInRegex": "error",
|
|
411
459
|
"noDebugger": "error",
|
|
460
|
+
"noDeprecatedMediaType": "error",
|
|
412
461
|
"noDocumentCookie": "error",
|
|
413
462
|
"noDoubleEquals": "error",
|
|
414
463
|
"noDuplicateCase": "error",
|
|
415
464
|
"noDuplicateClassMembers": "error",
|
|
416
465
|
"noDuplicateDependencies": "error",
|
|
466
|
+
"noDuplicatedSpreadProps": "error",
|
|
417
467
|
"noDuplicateElseIf": "error",
|
|
468
|
+
"noDuplicateEnumValues": "error",
|
|
418
469
|
"noDuplicateFields": "error",
|
|
470
|
+
"noDuplicateGraphqlOperationName": "error",
|
|
419
471
|
"noDuplicateObjectKeys": "error",
|
|
420
472
|
"noDuplicateParameters": "error",
|
|
421
473
|
"noEmptyBlockStatements": "error",
|
|
422
474
|
"noEmptyInterface": "error",
|
|
475
|
+
"noEqualsToNull": "error",
|
|
423
476
|
"noEvolvingTypes": "error",
|
|
424
477
|
"noExplicitAny": "error",
|
|
425
478
|
"noExtraNonNullAssertion": "error",
|
|
@@ -435,18 +488,25 @@
|
|
|
435
488
|
"noMisleadingCharacterClass": "error",
|
|
436
489
|
"noMisleadingInstantiator": "error",
|
|
437
490
|
"noMisrefactoredShorthandAssign": "error",
|
|
491
|
+
"noNestedPromises": "error",
|
|
438
492
|
"noOctalEscape": "error",
|
|
493
|
+
"noParametersOnlyUsedInRecursion": "error",
|
|
494
|
+
"noProto": "error",
|
|
439
495
|
"noPrototypeBuiltins": "error",
|
|
440
496
|
"noQuickfixBiome": "error",
|
|
441
497
|
"noRedeclare": "error",
|
|
442
498
|
"noRedundantUseStrict": "error",
|
|
499
|
+
"noReturnAssign": "error",
|
|
443
500
|
"noSelfCompare": "error",
|
|
501
|
+
"noShadow": "error",
|
|
444
502
|
"noShadowRestrictedNames": "error",
|
|
445
503
|
"noSparseArray": "error",
|
|
446
504
|
"noTemplateCurlyInString": "error",
|
|
447
505
|
"noThenProperty": "error",
|
|
448
506
|
"noTsIgnore": "error",
|
|
449
507
|
"noUnassignedVariables": "error",
|
|
508
|
+
"noUnknownAttribute": "error",
|
|
509
|
+
"noUnnecessaryConditions": "error",
|
|
450
510
|
"noUnsafeDeclarationMerging": "error",
|
|
451
511
|
"noUnsafeNegation": "error",
|
|
452
512
|
"noUselessEscapeInString": "error",
|
|
@@ -454,6 +514,7 @@
|
|
|
454
514
|
"noVar": "error",
|
|
455
515
|
"noWith": "error",
|
|
456
516
|
"useAdjacentOverloadSignatures": "error",
|
|
517
|
+
"useArraySortCompare": "error",
|
|
457
518
|
"useAwait": "error",
|
|
458
519
|
"useBiomeIgnoreFolder": "error",
|
|
459
520
|
"useDefaultSwitchClauseLast": "error",
|
|
@@ -465,12 +526,15 @@
|
|
|
465
526
|
"useIterableCallbackReturn": "error",
|
|
466
527
|
"useNamespaceKeyword": "error",
|
|
467
528
|
"useNumberToFixedDigitsArgument": "error",
|
|
529
|
+
"useRequiredScripts": "error",
|
|
468
530
|
"useStaticResponseMethods": "error",
|
|
469
531
|
"useStrictMode": "error",
|
|
470
532
|
"noNonNullAssertedOptionalChain": "error",
|
|
471
533
|
"noUnusedExpressions": "error",
|
|
472
534
|
|
|
473
535
|
"noConsole": "off",
|
|
536
|
+
"noForIn": "off",
|
|
537
|
+
"noUndeclaredEnvVars": "off",
|
|
474
538
|
"useDeprecatedDate": "off",
|
|
475
539
|
|
|
476
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);
|