ultracite 5.1.1 → 5.1.3
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/biome.jsonc +121 -76
- package/dist/index.js +25 -25
- package/dist/index.mjs +23 -23
- package/package.json +2 -2
package/biome.jsonc
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/2.
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
|
|
3
3
|
"formatter": {
|
|
4
4
|
"enabled": true,
|
|
5
5
|
"formatWithErrors": true,
|
|
@@ -42,6 +42,8 @@
|
|
|
42
42
|
"noInteractiveElementToNoninteractiveRole": "error",
|
|
43
43
|
// Enforce that a label element or component has a text label and an associated input.
|
|
44
44
|
"noLabelWithoutControl": "error",
|
|
45
|
+
// Disallow use event handlers on non-interactive elements.
|
|
46
|
+
"noNoninteractiveElementInteractions": "error",
|
|
45
47
|
// Enforce that interactive ARIA roles are not assigned to non-interactive HTML elements.
|
|
46
48
|
"noNoninteractiveElementToInteractiveRole": "error",
|
|
47
49
|
// Enforce that tabIndex is not assigned to non-interactive HTML elements.
|
|
@@ -119,6 +121,8 @@
|
|
|
119
121
|
"noEmptyTypeParameters": "error",
|
|
120
122
|
// Disallow functions that exceed a given Cognitive Complexity score.
|
|
121
123
|
"noExcessiveCognitiveComplexity": "error",
|
|
124
|
+
// Restrict the number of lines of code in a function.
|
|
125
|
+
"noExcessiveLinesPerFunction": "error",
|
|
122
126
|
// This rule enforces a maximum depth to nested describe() in test files.
|
|
123
127
|
"noExcessiveNestedTestSuites": "error",
|
|
124
128
|
// Disallow unnecessary boolean casts
|
|
@@ -127,6 +131,8 @@
|
|
|
127
131
|
"noFlatMapIdentity": "error",
|
|
128
132
|
// Prefer for...of statement instead of Array.forEach.
|
|
129
133
|
"noForEach": "error",
|
|
134
|
+
// Disallow shorthand type conversions.
|
|
135
|
+
"noImplicitCoercions": "error",
|
|
130
136
|
// This rule reports when a class has no non-static members, such as for a class used exclusively as a static namespace.
|
|
131
137
|
"noStaticOnlyClass": "error",
|
|
132
138
|
// Disallow this and super in static contexts.
|
|
@@ -171,6 +177,8 @@
|
|
|
171
177
|
"useDateNow": "error",
|
|
172
178
|
// Promotes the use of .flatMap() when map().flat() are used together.
|
|
173
179
|
"useFlatMap": "error",
|
|
180
|
+
// Prefer Array#{indexOf,lastIndexOf}() over Array#{findIndex,findLastIndex}() when looking for the index of an item.
|
|
181
|
+
"useIndexOf": "error",
|
|
174
182
|
// Enforce the usage of a literal access to properties over computed property access.
|
|
175
183
|
"useLiteralKeys": "error",
|
|
176
184
|
// Disallow parseInt() and Number.parseInt() in favor of binary, octal, and hexadecimal literals
|
|
@@ -184,7 +192,11 @@
|
|
|
184
192
|
// Discard redundant terms from logical expressions.
|
|
185
193
|
"useSimplifiedLogicExpression": "error",
|
|
186
194
|
// Enforce the use of while loops instead of for loops when the initializer and update expressions are not needed.
|
|
187
|
-
"useWhile": "error"
|
|
195
|
+
"useWhile": "error",
|
|
196
|
+
|
|
197
|
+
/** ------------------------ CSS Rules ------------------------ **/
|
|
198
|
+
// Disallow the use of the !important style.
|
|
199
|
+
"noImportantStyles": "off"
|
|
188
200
|
},
|
|
189
201
|
"correctness": {
|
|
190
202
|
/** ------------------------ JavaScript Rules ------------------------ **/
|
|
@@ -203,6 +215,8 @@
|
|
|
203
215
|
"noEmptyCharacterClassInRegex": "error",
|
|
204
216
|
// Disallows empty destructuring patterns.
|
|
205
217
|
"noEmptyPattern": "error",
|
|
218
|
+
// Disallow the use of __dirname and __filename in the global scope.
|
|
219
|
+
"noGlobalDirnameFilename": "error",
|
|
206
220
|
// Disallow calling global object properties as functions
|
|
207
221
|
"noGlobalObjectCalls": "error",
|
|
208
222
|
// Disallow function and var declarations that are accessible outside their block.
|
|
@@ -213,18 +227,28 @@
|
|
|
213
227
|
"noInvalidConstructorSuper": "error",
|
|
214
228
|
// Disallow the use of variables and function parameters before their declaration
|
|
215
229
|
"noInvalidUseBeforeDeclaration": "error",
|
|
230
|
+
// Disallows defining React components inside other components.
|
|
231
|
+
"noNestedComponentDefinitions": "error",
|
|
216
232
|
// Disallow \8 and \9 escape sequences in string literals.
|
|
217
233
|
"noNonoctalDecimalEscape": "error",
|
|
218
234
|
// Disallow literal numbers that lose precision
|
|
219
235
|
"noPrecisionLoss": "error",
|
|
236
|
+
// Disallow assigning to React component props.
|
|
237
|
+
"noReactPropAssignments": "error",
|
|
220
238
|
// Prevent the usage of the return value of React.render.
|
|
221
239
|
"noRenderReturnValue": "error",
|
|
240
|
+
// Disallow the use of configured elements.
|
|
241
|
+
"noRestrictedElements": "error",
|
|
222
242
|
// Disallow assignments where both sides are exactly the same.
|
|
223
243
|
"noSelfAssign": "error",
|
|
224
244
|
// Disallow returning a value from a setter
|
|
225
245
|
"noSetterReturn": "error",
|
|
246
|
+
// Enforce JSDoc comment lines to start with a single asterisk, except for the first one.
|
|
247
|
+
"useSingleJsDocAsterisk": "error",
|
|
226
248
|
// Disallow comparison of expressions modifying the string case with non-compliant value.
|
|
227
249
|
"noStringCaseMismatch": "error",
|
|
250
|
+
// Disallow destructuring props inside JSX components in Solid projects.
|
|
251
|
+
"noSolidDestructuredProps": "error",
|
|
228
252
|
// Disallow lexical declarations in switch clauses.
|
|
229
253
|
"noSwitchDeclarations": "error",
|
|
230
254
|
// Prevents the usage of variables that haven't been declared inside the document.
|
|
@@ -253,12 +277,18 @@
|
|
|
253
277
|
"noVoidTypeReturn": "error",
|
|
254
278
|
// Enforce all dependencies are correctly specified in a React hook.
|
|
255
279
|
"useExhaustiveDependencies": "error",
|
|
280
|
+
// Enforce specifying the name of GraphQL operations.
|
|
281
|
+
"useGraphqlNamedOperations": "error",
|
|
256
282
|
// Enforce that all React hooks are being called from the Top Level component functions.
|
|
257
283
|
"useHookAtTopLevel": "error",
|
|
258
284
|
// Require calls to isNaN() when checking for NaN.
|
|
259
285
|
"useIsNan": "error",
|
|
286
|
+
// Enforces the use of with { type: "json" } for JSON module imports.
|
|
287
|
+
"useJsonImportAttributes": "error",
|
|
260
288
|
// Disallow missing key props in iterators/collection literals.
|
|
261
289
|
"useJsxKeyInIterable": "error",
|
|
290
|
+
// Enforce the consistent use of the radix argument when using parseInt().
|
|
291
|
+
"useParseIntRadix": "error",
|
|
262
292
|
// Enforce "for" loop update clause moving the counter in the right direction.
|
|
263
293
|
"useValidForDirection": "error",
|
|
264
294
|
// This rule checks that the result of a typeof expression is compared to a valid value.
|
|
@@ -268,12 +298,16 @@
|
|
|
268
298
|
|
|
269
299
|
// Disallow the use of dependencies that aren't specified in the package.json.
|
|
270
300
|
"noUndeclaredDependencies": "off",
|
|
271
|
-
//
|
|
272
|
-
"
|
|
301
|
+
// Disallow the use of process global.
|
|
302
|
+
"noProcessGlobal": "off",
|
|
273
303
|
// Forbid the use of Node.js builtin modules.
|
|
274
304
|
"noNodejsModules": "off",
|
|
275
305
|
// Restrict imports of private exports.
|
|
276
306
|
"noPrivateImports": "off",
|
|
307
|
+
// Enforce file extensions for relative imports.
|
|
308
|
+
"useImportExtensions": "off",
|
|
309
|
+
// Prevent the usage of static string literal id attribute on elements.
|
|
310
|
+
"useUniqueElementIds": "off",
|
|
277
311
|
|
|
278
312
|
/** ------------------------ CSS Rules ------------------------ **/
|
|
279
313
|
// Disallow non-standard direction values for linear gradient functions.
|
|
@@ -302,75 +336,50 @@
|
|
|
302
336
|
"noUnmatchableAnbSelector": "error"
|
|
303
337
|
},
|
|
304
338
|
"nursery": {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
//
|
|
308
|
-
"
|
|
309
|
-
// Disallow
|
|
310
|
-
"
|
|
311
|
-
// Disallow
|
|
312
|
-
"
|
|
313
|
-
// Disallow the use of __dirname and __filename in the global scope.
|
|
314
|
-
"noGlobalDirnameFilename": "error",
|
|
315
|
-
// Disallows defining React components inside other components.
|
|
316
|
-
"noNestedComponentDefinitions": "error",
|
|
317
|
-
// Disallow use event handlers on non-interactive elements.
|
|
318
|
-
"noNoninteractiveElementInteractions": "error",
|
|
319
|
-
// Disallow assigning to React component props.
|
|
320
|
-
"noReactPropAssign": "error",
|
|
321
|
-
// Disallow the use of configured elements.
|
|
322
|
-
"noRestrictedElements": "error",
|
|
339
|
+
// Disallow Promises to be used in places where they are almost certainly a mistake.
|
|
340
|
+
"noMisusedPromises": "error",
|
|
341
|
+
// Prevent client components from being async functions.
|
|
342
|
+
"noNextAsyncClientComponent": "error",
|
|
343
|
+
// Disallow non-null assertions after optional chaining expressions.
|
|
344
|
+
"noNonNullAssertedOptionalChain": "error",
|
|
345
|
+
// Disallow useVisibleTask$() functions in Qwik components.
|
|
346
|
+
"noQwikUseVisibleTask": "error",
|
|
323
347
|
// Disallow variable declarations from shadowing variables declared in the outer scope.
|
|
324
348
|
"noShadow": "error",
|
|
325
|
-
//
|
|
326
|
-
"
|
|
327
|
-
// Prevent duplicate polyfills from Polyfill.io.
|
|
328
|
-
"noUnwantedPolyfillio": "error",
|
|
329
|
-
// Disallow useless backreferences in regular expression literals that always match an empty string.
|
|
330
|
-
"noUselessBackrefInRegex": "error",
|
|
331
|
-
// Disallow unnecessary escapes in string literals.
|
|
332
|
-
"noUselessEscapeInString": "error",
|
|
349
|
+
// Disallow unnecessary type-based conditions that can be statically determined as redundant.
|
|
350
|
+
"noUnnecessaryConditions": "error",
|
|
333
351
|
// Disallow the use of useless undefined.
|
|
334
352
|
"noUselessUndefined": "error",
|
|
335
|
-
// Enforce that
|
|
336
|
-
"
|
|
337
|
-
//
|
|
338
|
-
"
|
|
339
|
-
//
|
|
340
|
-
"
|
|
353
|
+
// Enforce that Vue component data options are declared as functions.
|
|
354
|
+
"noVueDataObjectDeclaration": "error",
|
|
355
|
+
// Disallow reserved keys in Vue component data and computed properties.
|
|
356
|
+
"noVueReservedKeys": "error",
|
|
357
|
+
// Disallow reserved names to be used as props.
|
|
358
|
+
"noVueReservedProps": "error",
|
|
359
|
+
// Enforces href attribute for <a> elements.
|
|
360
|
+
"useAnchorHref": "error",
|
|
361
|
+
//Enforce type definitions to consistently use either interface or type.
|
|
362
|
+
"useConsistentTypeDefinitions": {
|
|
363
|
+
"level": "error",
|
|
364
|
+
"options": {
|
|
365
|
+
"style": "type"
|
|
366
|
+
}
|
|
367
|
+
},
|
|
341
368
|
// Require switch-case statements to be exhaustive.
|
|
342
369
|
"useExhaustiveSwitchCases": "error",
|
|
343
|
-
//
|
|
344
|
-
"
|
|
345
|
-
//
|
|
346
|
-
"
|
|
347
|
-
//
|
|
348
|
-
"
|
|
349
|
-
//
|
|
350
|
-
"
|
|
351
|
-
// Enforce the use of numeric separators in numeric literals.
|
|
352
|
-
"useNumericSeparators": "error",
|
|
353
|
-
// Prefer object spread over Object.assign() when constructing new objects.
|
|
354
|
-
"useObjectSpread": "error",
|
|
355
|
-
// Enforce the consistent use of the radix argument when using parseInt().
|
|
356
|
-
"useParseIntRadix": "error",
|
|
357
|
-
// Enforce JSDoc comment lines to start with a single asterisk, except for the first one.
|
|
358
|
-
"useSingleJsDocAsterisk": "error",
|
|
359
|
-
// Require a description parameter for the Symbol().
|
|
360
|
-
"useSymbolDescription": "error",
|
|
370
|
+
// Enforces that <img> elements have both width and height attributes.
|
|
371
|
+
"useImageSize": "error",
|
|
372
|
+
// Enforce a maximum number of parameters in function definitions.
|
|
373
|
+
"useMaxParams": "error",
|
|
374
|
+
// Prefer using the class prop as a classlist over the classnames helper.
|
|
375
|
+
"useQwikClasslist": "error",
|
|
376
|
+
// Enforce that components are defined as functions and never as classes.
|
|
377
|
+
"useReactFunctionComponents": "error",
|
|
361
378
|
|
|
362
|
-
// Disallow destructuring props inside JSX components in Solid projects.
|
|
363
|
-
"noDestructuredProps": "off",
|
|
364
|
-
// Disallow the use of process global.
|
|
365
|
-
"noProcessGlobal": "off",
|
|
366
379
|
// Disallow usage of sensitive data such as API keys and tokens.
|
|
367
380
|
"noSecrets": "off",
|
|
368
381
|
// Enforce types in functions, methods, variables, and parameters.
|
|
369
382
|
"useExplicitType": "off",
|
|
370
|
-
// Require that all exports are declared after all non-export statements.
|
|
371
|
-
"useExportsLast": "off",
|
|
372
|
-
// Enforce using Solid's <For /> component for mapping an array to JSX elements.
|
|
373
|
-
"useForComponent": "off",
|
|
374
383
|
// Enforce the sorting of CSS utility classes.
|
|
375
384
|
"useSortedClasses": {
|
|
376
385
|
"fix": "safe",
|
|
@@ -380,8 +389,6 @@
|
|
|
380
389
|
"functions": ["clsx", "cva", "tw", "twMerge", "cn", "twJoin", "tv"]
|
|
381
390
|
}
|
|
382
391
|
},
|
|
383
|
-
// Prevent the usage of static string literal id attribute on elements.
|
|
384
|
-
"useUniqueElementIds": "off",
|
|
385
392
|
|
|
386
393
|
/** ------ These rules should be enabled but Scanner makes them too slow ------ **/
|
|
387
394
|
// Require Promise-like statements to be handled appropriately.
|
|
@@ -389,13 +396,7 @@
|
|
|
389
396
|
// Warn when importing non-existing exports.
|
|
390
397
|
"noUnresolvedImports": "off",
|
|
391
398
|
// Prevent import cycles.
|
|
392
|
-
"noImportCycles": "off"
|
|
393
|
-
|
|
394
|
-
/** ------------------------ CSS Rules ------------------------ **/
|
|
395
|
-
// Disallow the use of the !important style.
|
|
396
|
-
"noImportantStyles": "error",
|
|
397
|
-
// Disallow unknown at-rules.
|
|
398
|
-
"noUnknownAtRule": "error"
|
|
399
|
+
"noImportCycles": "off"
|
|
399
400
|
},
|
|
400
401
|
"performance": {
|
|
401
402
|
/** ------------------------ JavaScript Rules ------------------------ **/
|
|
@@ -410,13 +411,21 @@
|
|
|
410
411
|
"noImgElement": "error",
|
|
411
412
|
// Disallow the use of namespace imports.
|
|
412
413
|
"noNamespaceImport": "error",
|
|
414
|
+
// Prevent duplicate polyfills from Polyfill.io.
|
|
415
|
+
"noUnwantedPolyfillio": "error",
|
|
416
|
+
// Ensure the preconnect attribute is used when using Google Fonts.
|
|
417
|
+
"useGoogleFontPreconnect": "error",
|
|
413
418
|
// Require regex literals to be declared at the top level.
|
|
414
419
|
"useTopLevelRegex": "error",
|
|
415
420
|
|
|
421
|
+
// Disallow await inside loops.
|
|
422
|
+
"noAwaitInLoops": "off",
|
|
416
423
|
// Disallow the use of barrel file.
|
|
417
424
|
"noBarrelFile": "off",
|
|
418
425
|
// Avoid re-export all.
|
|
419
|
-
"noReExportAll": "off"
|
|
426
|
+
"noReExportAll": "off",
|
|
427
|
+
// Enforce using Solid's <For /> component for mapping an array to JSX elements.
|
|
428
|
+
"useSolidForComponent": "off"
|
|
420
429
|
},
|
|
421
430
|
"security": {
|
|
422
431
|
/** ------------------------ JavaScript Rules ------------------------ **/
|
|
@@ -489,6 +498,8 @@
|
|
|
489
498
|
"useConsistentBuiltinInstantiation": "error",
|
|
490
499
|
// Require consistent accessibility modifiers on class properties and methods.
|
|
491
500
|
"useConsistentMemberAccessibility": "error",
|
|
501
|
+
// Require the consistent declaration of object literals. Defaults to explicit definitions.
|
|
502
|
+
"useConsistentObjectDefinitions": "error",
|
|
492
503
|
// Require const declarations for variables that are only assigned once.
|
|
493
504
|
"useConst": "error",
|
|
494
505
|
// Enforce default function parameters and optional function parameters to be last.
|
|
@@ -515,22 +526,36 @@
|
|
|
515
526
|
"useForOf": "error",
|
|
516
527
|
// This rule enforces the use of <>...</> over <Fragment>...</Fragment>.
|
|
517
528
|
"useFragmentSyntax": "error",
|
|
529
|
+
// Validates that all enum values are capitalized.
|
|
530
|
+
"useGraphqlNamingConvention": "error",
|
|
531
|
+
// Enforce that getters and setters for the same property are adjacent in class and object definitions.
|
|
532
|
+
"useGroupedAccessorPairs": "error",
|
|
518
533
|
// Promotes the use of import type for types.
|
|
519
534
|
"useImportType": "error",
|
|
520
535
|
// Require all enum members to be literal values.
|
|
521
536
|
"useLiteralEnumMembers": "error",
|
|
537
|
+
// Reports usage of “magic numbers” — numbers used directly instead of being assigned to named constants.
|
|
538
|
+
"noMagicNumbers": "error",
|
|
522
539
|
// Promotes the usage of node:assert/strict over node:assert.
|
|
523
540
|
"useNodeAssertStrict": "error",
|
|
524
541
|
// Enforces using the node: protocol for Node.js builtin modules.
|
|
525
542
|
"useNodejsImportProtocol": "error",
|
|
526
543
|
// Use the Number properties instead of global ones.
|
|
527
544
|
"useNumberNamespace": "error",
|
|
545
|
+
// Enforce the use of numeric separators in numeric literals.
|
|
546
|
+
"useNumericSeparators": "error",
|
|
547
|
+
// Prefer object spread over Object.assign() when constructing new objects.
|
|
548
|
+
"useObjectSpread": "error",
|
|
549
|
+
// Enforce marking members as readonly if they are never modified outside the constructor.
|
|
550
|
+
"useReadonlyClassProperties": "error",
|
|
528
551
|
// Prevent extra closing tags for components without children.
|
|
529
552
|
"useSelfClosingElements": "error",
|
|
530
553
|
// Require assignment operator shorthand where possible.
|
|
531
554
|
"useShorthandAssign": "error",
|
|
532
555
|
// Enforce using function types instead of object type with call signatures.
|
|
533
556
|
"useShorthandFunctionType": "error",
|
|
557
|
+
// Require a description parameter for the Symbol().
|
|
558
|
+
"useSymbolDescription": "error",
|
|
534
559
|
// Prefer template literals over string concatenation.
|
|
535
560
|
"useTemplate": "error",
|
|
536
561
|
// Require new when throwing an error.
|
|
@@ -539,6 +564,8 @@
|
|
|
539
564
|
"useThrowOnlyError": "error",
|
|
540
565
|
// Enforce the use of String.trimStart() and String.trimEnd() over String.trimLeft() and String.trimRight().
|
|
541
566
|
"useTrimStartEnd": "error",
|
|
567
|
+
// Disallow overload signatures that can be unified into a single signature.
|
|
568
|
+
"useUnifiedTypeSignatures": "error",
|
|
542
569
|
|
|
543
570
|
// Disallow use of CommonJs module system in favor of ESM style imports.
|
|
544
571
|
"noCommonJs": "off",
|
|
@@ -554,9 +581,9 @@
|
|
|
554
581
|
"useConsistentCurlyBraces": "off",
|
|
555
582
|
// Enforce explicitly comparing the length, size, byteLength or byteOffset property of a value.
|
|
556
583
|
"useExplicitLengthCheck": "off",
|
|
557
|
-
//
|
|
558
|
-
"
|
|
559
|
-
//
|
|
584
|
+
// Require that all exports are declared after all non-export statements.
|
|
585
|
+
"useExportsLast": "off",
|
|
586
|
+
// Disallow multiple variable declarations in the same variable statement
|
|
560
587
|
"useSingleVarDeclarator": "off",
|
|
561
588
|
|
|
562
589
|
/** ------------------------ CSS Rules ------------------------ **/
|
|
@@ -576,6 +603,10 @@
|
|
|
576
603
|
"noAssignInExpressions": "error",
|
|
577
604
|
// Disallows using an async function as a Promise executor.
|
|
578
605
|
"noAsyncPromiseExecutor": "error",
|
|
606
|
+
// Disallow bitwise operators.
|
|
607
|
+
"noBitwiseOperators": "error",
|
|
608
|
+
// Disallow expressions where the operation doesn't affect the value
|
|
609
|
+
"noConstantBinaryExpressions": "error",
|
|
579
610
|
// Disallow reassigning exceptions in catch clauses.
|
|
580
611
|
"noCatchAssign": "error",
|
|
581
612
|
// Disallow reassigning class members.
|
|
@@ -680,10 +711,18 @@
|
|
|
680
711
|
"noTemplateCurlyInString": "error",
|
|
681
712
|
// Disallow then property.
|
|
682
713
|
"noThenProperty": "error",
|
|
714
|
+
// Prevents the use of the TypeScript directive @ts-ignore.
|
|
715
|
+
"noTsIgnore": "error",
|
|
716
|
+
// Disallow let or var variables that are read but never assigned.
|
|
717
|
+
"noUnassignedVariables": "error",
|
|
683
718
|
// Disallow unsafe declaration merging between interfaces and classes.
|
|
684
719
|
"noUnsafeDeclarationMerging": "error",
|
|
685
720
|
// Disallow using unsafe negation.
|
|
686
721
|
"noUnsafeNegation": "error",
|
|
722
|
+
// Disallow unnecessary escapes in string literals.
|
|
723
|
+
"noUselessEscapeInString": "error",
|
|
724
|
+
// Disallow useless backreferences in regular expression literals that always match an empty string.
|
|
725
|
+
"noUselessRegexBackrefs": "error",
|
|
687
726
|
// Disallow the use of var
|
|
688
727
|
"noVar": "error",
|
|
689
728
|
// Disallow with statements in non-strict contexts.
|
|
@@ -692,6 +731,8 @@
|
|
|
692
731
|
"useAdjacentOverloadSignatures": "error",
|
|
693
732
|
// Ensure async functions utilize await.
|
|
694
733
|
"useAwait": "error",
|
|
734
|
+
// Enforce consistent return values in iterable callbacks.
|
|
735
|
+
"useIterableCallbackReturn": "error",
|
|
695
736
|
// Enforce default clauses in switch statements to be last
|
|
696
737
|
"useDefaultSwitchClauseLast": "error",
|
|
697
738
|
// Enforce passing a message value when creating a built-in error.
|
|
@@ -708,6 +749,8 @@
|
|
|
708
749
|
"useNamespaceKeyword": "error",
|
|
709
750
|
// Enforce using the digits argument with Number#toFixed().
|
|
710
751
|
"useNumberToFixedDigitsArgument": "error",
|
|
752
|
+
// Use static Response methods instead of new Response() constructor when possible.
|
|
753
|
+
"useStaticResponseMethods": "error",
|
|
711
754
|
// Enforce the use of the directive "use strict" in script files.
|
|
712
755
|
"useStrictMode": "error",
|
|
713
756
|
|
|
@@ -730,7 +773,9 @@
|
|
|
730
773
|
// Disallow invalid !important within keyframe declarations
|
|
731
774
|
"noImportantInKeyframe": "error",
|
|
732
775
|
// Disallow shorthand properties that override related longhand properties.
|
|
733
|
-
"noShorthandPropertyOverrides": "error"
|
|
776
|
+
"noShorthandPropertyOverrides": "error",
|
|
777
|
+
// Disallow unknown at-rules.
|
|
778
|
+
"noUnknownAtRules": "error"
|
|
734
779
|
}
|
|
735
780
|
}
|
|
736
781
|
},
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var fs=Object.create;var te=Object.defineProperty;var gs=Object.getOwnPropertyDescriptor;var hs=Object.getOwnPropertyNames;var ys=Object.getPrototypeOf,ws=Object.prototype.hasOwnProperty;var et=e=>t=>{var s=e[t];if(s)return s();throw new Error("Module not found in bundle: "+t)};var u=(e,t)=>()=>(e&&(t=e(e=0)),t);var p=(e,t)=>{for(var s in t)te(e,s,{get:t[s],enumerable:!0})},tt=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of hs(t))!ws.call(e,o)&&o!==s&&te(e,o,{get:()=>t[o],enumerable:!(n=gs(t,o))||n.enumerable});return e};var w=(e,t,s)=>(s=e!=null?fs(ys(e)):{},tt(t||!e||!e.__esModule?te(s,"default",{value:e,enumerable:!0}):s,e)),d=e=>tt(te({},"__esModule",{value:!0}),e);var j,se=u(()=>{j={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"5.1.0",bin:{ultracite:"dist/index.js"},files:["biome.jsonc","dist"],scripts:{build:"tsup",test:"vitest run","test:coverage":"vitest --coverage"},main:"./biome.jsonc",author:"Hayden Bleasel <hello@haydenbleasel.com>",bugs:{url:"https://github.com/haydenbleasel/ultracite/issues"},homepage:"https://github.com/haydenbleasel/ultracite#readme",keywords:["ultracite","biome","linter","formatter","fixer"],license:"MIT",publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},repository:{type:"git",url:"git+https://github.com/haydenbleasel/ultracite.git"},devDependencies:{"@auto-it/all-contributors":"^11.3.0","@auto-it/first-time-contributor":"^11.3.0","@biomejs/biome":"2.1.2","@types/node":"^24.0.14","@vitest/coverage-v8":"3.2.4",tsup:"^8.5.0"},dependencies:{"@clack/prompts":"^0.11.0",deepmerge:"^4.3.1","jsonc-parser":"^3.3.1","trpc-cli":"^0.10.0",vitest:"^3.2.4",zod:"^4.0.5"},packageManager:"pnpm@10.13.1"}});var ot={};p(ot,{format:()=>ge});var st,nt,ge,he=u(()=>{"use strict";st=require("child_process"),nt=w(require("process")),ge=(e,t={})=>{try{let s=e.length>0?e.map(o=>`"${o}"`).join(" "):"./",n=t.unsafe?" --unsafe":"";(0,st.execSync)(`npx @biomejs/biome check --write${n} ${s}`,{stdio:"inherit"})}catch(s){let n=s instanceof Error?s.message:"Unknown error";console.error("Failed to run Ultracite:",n),nt.default.exit(1)}}});var rt={};p(rt,{exists:()=>i,isMonorepo:()=>T});var ne,it,i,T,g=u(()=>{"use strict";ne=require("fs/promises"),it=require("jsonc-parser"),i=async e=>{try{return await(0,ne.access)(e),!0}catch{return!1}},T=async()=>{if(await i("pnpm-workspace.yaml"))return!0;try{let e=(0,it.parse)(await(0,ne.readFile)("package.json","utf-8"));return e?!!e.workspaces:!1}catch{return!1}}});var ut={};p(ut,{biome:()=>W});var N,ct,lt,vs,at,ye,W,we=u(()=>{"use strict";N=require("fs/promises"),ct=w(require("deepmerge")),lt=require("jsonc-parser");g();se();vs=j.devDependencies["@biomejs/biome"],at={$schema:`https://biomejs.dev/schemas/${vs}/schema.json`,extends:["ultracite"]},ye=async()=>await i("./biome.json")?"./biome.json":"./biome.jsonc",W={exists:async()=>{let e=await ye();return i(e)},create:async()=>{let e=await ye();return(0,N.writeFile)(e,JSON.stringify(at,null,2))},update:async()=>{let e=await ye(),t=await(0,N.readFile)(e,"utf-8"),n=(0,lt.parse)(t)||{},o=n.extends&&Array.isArray(n.extends)?n.extends:[];o.includes("ultracite")||(n.extends=[...o,"ultracite"]);let r={$schema:at.$schema},l=(0,ct.default)(n,r);await(0,N.writeFile)(e,JSON.stringify(l,null,2))}}});var dt,pt,mt,ft,gt,ht,yt,wt,gn,m,b=u(()=>{"use strict";dt=["Don't use `accessKey` attribute on any HTML element.",'Don\'t set `aria-hidden="true"` on focusable elements.',"Don't add ARIA roles, states, and properties to elements that don't support them.","Don't use distracting elements like `<marquee>` or `<blink>`.","Only use the `scope` prop on `<th>` elements.","Don't assign non-interactive ARIA roles to interactive HTML elements.","Make sure label elements have text content and are associated with an input.","Don't assign interactive ARIA roles to non-interactive HTML elements.","Don't assign `tabIndex` to non-interactive HTML elements.","Don't use positive integers for `tabIndex` property.",`Don't include "image", "picture", or "photo" in img alt prop.`,"Don't use explicit role property that's the same as the implicit/default role.","Make static elements with click handlers use a valid role attribute.","Always include a `title` element for SVG elements.","Give all elements requiring alt text meaningful information for screen readers.","Make sure anchors have content that's accessible to screen readers.","Assign `tabIndex` to non-interactive HTML elements with `aria-activedescendant`.","Include all required ARIA attributes for elements with ARIA roles.","Make sure ARIA properties are valid for the element's supported roles.","Always include a `type` attribute for button elements.","Make elements with interactive roles and handlers focusable.","Give heading elements content that's accessible to screen readers (not hidden with `aria-hidden`).","Always include a `lang` attribute on the html element.","Always include a `title` attribute for iframe elements.","Accompany `onClick` with at least one of: `onKeyUp`, `onKeyDown`, or `onKeyPress`.","Accompany `onMouseOver`/`onMouseOut` with `onFocus`/`onBlur`.","Include caption tracks for audio and video elements.","Use semantic elements instead of role attributes in JSX.","Make sure all anchors are valid and navigable.","Ensure all ARIA properties (`aria-*`) are valid.","Use valid, non-abstract ARIA roles for elements with ARIA roles.","Use valid ARIA state and property values.","Use valid values for the `autocomplete` attribute on input elements.","Use correct ISO language/country codes for the `lang` attribute."],pt=["Don't use consecutive spaces in regular expression literals.","Don't use the `arguments` object.","Don't use primitive type aliases or misleading types.","Don't use the comma operator.","Don't use empty type parameters in type aliases and interfaces.","Don't write functions that exceed a given Cognitive Complexity score.","Don't nest describe() blocks too deeply in test files.","Don't use unnecessary boolean casts.","Don't use unnecessary callbacks with flatMap.","Use for...of statements instead of Array.forEach.","Don't create classes that only have static members (like a static namespace).","Don't use this and super in static contexts.","Don't use unnecessary catch clauses.","Don't use unnecessary constructors.","Don't use unnecessary continue statements.","Don't export empty modules that don't change anything.","Don't use unnecessary escape sequences in regular expression literals.","Don't use unnecessary fragments.","Don't use unnecessary labels.","Don't use unnecessary nested block statements.","Don't rename imports, exports, and destructured assignments to the same name.","Don't use unnecessary string or template literal concatenation.","Don't use String.raw in template literals when there are no escape sequences.","Don't use useless case statements in switch statements.","Don't use ternary operators when simpler alternatives exist.","Don't use useless `this` aliasing.","Don't use any or unknown as type constraints.","Don't initialize variables to undefined.","Don't use the void operators (they're not familiar).","Use arrow functions instead of function expressions.","Use Date.now() to get milliseconds since the Unix Epoch.","Use .flatMap() instead of map().flat() when possible.","Use literal property access instead of computed property access.","Don't use parseInt() or Number.parseInt() when binary, octal, or hexadecimal literals work.","Use concise optional chaining instead of chained logical expressions.","Use regular expression literals instead of the RegExp constructor when possible.","Don't use number literal object member names that aren't base 10 or use underscore separators.","Remove redundant terms from logical expressions.","Use while loops instead of for loops when you don't need initializer and update expressions.","Don't pass children as props.","Don't reassign const variables.","Don't use constant expressions in conditions.","Don't use `Math.min` and `Math.max` to clamp values when the result is constant.","Don't return a value from a constructor.","Don't use empty character classes in regular expression literals.","Don't use empty destructuring patterns.","Don't call global object properties as functions.","Don't declare functions and vars that are accessible outside their block.","Make sure builtins are correctly instantiated.","Don't use super() incorrectly inside classes. Also check that super() is called in classes that extend other constructors.","Don't use variables and function parameters before they're declared.","Don't use 8 and 9 escape sequences in string literals.","Don't use literal numbers that lose precision."],mt=["Don't use the return value of React.render.","Make sure all dependencies are correctly specified in React hooks.","Make sure all React hooks are called from the top level of component functions.","Don't forget key props in iterators and collection literals.","Don't destructure props inside JSX components in Solid projects.","Don't define React components inside other components.","Don't use event handlers on non-interactive elements.","Don't assign to React component props.","Don't use both `children` and `dangerouslySetInnerHTML` props on the same element.","Don't use dangerous JSX props.","Don't use Array index in keys.","Don't insert comments as text nodes.","Don't assign JSX properties multiple times.","Don't add extra closing tags for components without children.","Use `<>...</>` instead of `<Fragment>...</Fragment>`.",'Watch out for possible "wrong" semicolons inside JSX elements.'],ft=["Don't assign a value to itself.","Don't return a value from a setter.","Don't compare expressions that modify string case with non-compliant values.","Don't use lexical declarations in switch clauses.","Don't use variables that haven't been declared in the document.","Don't write unreachable code.","Make sure super() is called exactly once on every code path in a class constructor before this is accessed if the class has a superclass.","Don't use control flow statements in finally blocks.","Don't use optional chaining where undefined values aren't allowed.","Don't have unused function parameters.","Don't have unused imports.","Don't have unused labels.","Don't have unused private class members.","Don't have unused variables.","Make sure void (self-closing) elements don't have children.","Don't return a value from a function with the return type 'void'","Use isNaN() when checking for NaN.",'Make sure "for" loop update clauses move the counter in the right direction.',"Make sure typeof expressions are compared to valid values.","Make sure generator functions contain yield.","Don't use await inside loops.","Don't use bitwise operators.","Don't use expressions where the operation doesn't change the value.","Make sure Promise-like statements are handled appropriately.","Don't use __dirname and __filename in the global scope.","Prevent import cycles.","Don't use configured elements.","Don't hardcode sensitive data like API keys and tokens.","Don't let variable declarations shadow variables from outer scopes.","Don't use the TypeScript directive @ts-ignore.","Prevent duplicate polyfills from Polyfill.io.","Don't use useless backreferences in regular expressions that always match empty strings.","Don't use unnecessary escapes in string literals.","Don't use useless undefined.","Make sure getters and setters for the same property are next to each other in class and object definitions.","Make sure object literals are declared consistently (defaults to explicit definitions).","Use static Response methods instead of new Response() constructor when possible.","Make sure switch-case statements are exhaustive.","Make sure the `preconnect` attribute is used when using Google Fonts.","Use `Array#{indexOf,lastIndexOf}()` instead of `Array#{findIndex,findLastIndex}()` when looking for the index of an item.","Make sure iterable callbacks return consistent values.",'Use `with { type: "json" }` for JSON module imports.',"Use numeric separators in numeric literals.","Use object spread instead of `Object.assign()` when constructing new objects.","Always use the radix argument when using `parseInt()`.","Make sure JSDoc comment lines start with a single asterisk, except for the first one.","Include a description parameter for `Symbol()`.","Don't use spread (`...`) syntax on accumulators.","Don't use the `delete` operator.","Don't access namespace imports dynamically.","Don't use namespace imports.","Declare regex literals at the top level.",'Don\'t use `target="_blank"` without `rel="noopener"`.'],gt=["Don't use TypeScript enums.","Don't export imported variables.","Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions.","Don't use TypeScript namespaces.","Don't use non-null assertions with the `!` postfix operator.","Don't use parameter properties in class constructors.","Don't use user-defined types.","Use `as const` instead of literal types and type annotations.","Use either `T[]` or `Array<T>` consistently.","Initialize each enum member value explicitly.","Use `export type` for types.","Use `import type` for types.","Make sure all enum members are literal values.","Don't use TypeScript const enum.","Don't declare empty interfaces.","Don't let variables evolve into any type through reassignments.","Don't use the any type.","Don't misuse the non-null assertion operator (!) in TypeScript files.","Don't use implicit any type on variable declarations.","Don't merge interfaces and classes unsafely.","Don't use overload signatures that aren't next to each other.","Use the namespace keyword instead of the module keyword to declare TypeScript namespaces."],ht=["Don't use global `eval()`.","Don't use callbacks in asynchronous tests and hooks.","Don't use negation in `if` statements that have `else` clauses.","Don't use nested ternary expressions.","Don't reassign function parameters.","This rule lets you specify global variable names you don't want to use in your application.","Don't use specified modules when loaded by import or require.","Don't use constants whose value is the upper-case version of their name.","Use `String.slice()` instead of `String.substr()` and `String.substring()`.","Don't use template literals if you don't need interpolation or special-character handling.","Don't use `else` blocks when the `if` block breaks early.","Don't use yoda expressions.","Don't use Array constructors.","Use `at()` instead of integer index access.","Follow curly brace conventions.","Use `else if` instead of nested `if` statements in `else` clauses.","Use single `if` statements instead of nested `if` clauses.","Use `new` for all builtins except `String`, `Number`, and `Boolean`.","Use consistent accessibility modifiers on class properties and methods.","Use `const` declarations for variables that are only assigned once.","Put default function parameters and optional function parameters last.","Include a `default` clause in switch statements.","Use the `**` operator instead of `Math.pow`.","Use `for-of` loops when you need the index to extract an item from the iterated array.","Use `node:assert/strict` over `node:assert`.","Use the `node:` protocol for Node.js builtin modules.","Use Number properties instead of global ones.","Use assignment operator shorthand where possible.","Use function types instead of object types with call signatures.","Use template literals over string concatenation.","Use `new` when throwing an error.","Don't throw non-Error values.","Use `String.trimStart()` and `String.trimEnd()` over `String.trimLeft()` and `String.trimRight()`.","Use standard constants instead of approximated literals.","Don't assign values in expressions.","Don't use async functions as Promise executors.","Don't reassign exceptions in catch clauses.","Don't reassign class members.","Don't compare against -0.","Don't use labeled statements that aren't loops.","Don't use void type outside of generic or return types.","Don't use console.","Don't use control characters and escape sequences that match control characters in regular expression literals.","Don't use debugger.","Don't assign directly to document.cookie.","Use `===` and `!==`.","Don't use duplicate case labels.","Don't use duplicate class members.","Don't use duplicate conditions in if-else-if chains.","Don't use two keys with the same name inside objects.","Don't use duplicate function parameter names.","Don't have duplicate hooks in describe blocks.","Don't use empty block statements and static blocks.","Don't let switch clauses fall through.","Don't reassign function declarations.","Don't allow assignments to native objects and read-only global variables.","Use Number.isFinite instead of global isFinite.","Use Number.isNaN instead of global isNaN.","Don't assign to imported bindings.","Don't use irregular whitespace characters.","Don't use labels that share a name with a variable.","Don't use characters made with multiple code points in character class syntax.","Make sure to use new and constructor properly.","Don't use shorthand assign when the variable appears on both sides.","Don't use octal escape sequences in string literals.","Don't use Object.prototype builtins directly.","Don't redeclare variables, functions, classes, and types in the same scope.",`Don't have redundant "use strict".`,"Don't compare things where both sides are exactly the same.","Don't let identifiers shadow restricted names.","Don't use sparse arrays (arrays with holes).","Don't use template literal placeholder syntax in regular strings.","Don't use the then property.","Don't use unsafe negation.","Don't use var.","Don't use with statements in non-strict contexts.","Make sure async functions actually use await.","Make sure default clauses in switch statements come last.","Make sure to pass a message value when creating a built-in error.","Make sure get methods always return a value.","Use a recommended display strategy with Google Fonts.","Make sure for-in loops include an if statement.","Use Array.isArray() instead of instanceof Array.","Make sure to use the digits argument with Number#toFixed().",'Make sure to use the "use strict" directive in script files.'],yt=["Don't use `<img>` elements in Next.js projects.","Don't use `<head>` elements in Next.js projects.","Don't import next/document outside of pages/_document.jsx in Next.js projects.","Don't use the next/head module in pages/_document.js on Next.js projects."],wt=["Don't use export or module.exports in test files.","Don't use focused tests.","Make sure the assertion function, like expect, is placed inside an it() function call.","Don't use disabled tests."],gn=[...dt,...pt,...mt,...ft,...gt,...ht,...yt,...wt],m=`# Project Context
|
|
2
|
+
"use strict";var hs=Object.create;var se=Object.defineProperty;var ys=Object.getOwnPropertyDescriptor;var ws=Object.getOwnPropertyNames;var bs=Object.getPrototypeOf,vs=Object.prototype.hasOwnProperty;var tt=e=>t=>{var s=e[t];if(s)return s();throw new Error("Module not found in bundle: "+t)};var u=(e,t)=>()=>(e&&(t=e(e=0)),t);var p=(e,t)=>{for(var s in t)se(e,s,{get:t[s],enumerable:!0})},st=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ws(t))!vs.call(e,o)&&o!==s&&se(e,o,{get:()=>t[o],enumerable:!(n=ys(t,o))||n.enumerable});return e};var b=(e,t,s)=>(s=e!=null?hs(bs(e)):{},st(t||!e||!e.__esModule?se(s,"default",{value:e,enumerable:!0}):s,e)),d=e=>st(se({},"__esModule",{value:!0}),e);var x,ne=u(()=>{x={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"5.1.2",bin:{ultracite:"dist/index.js"},files:["biome.jsonc","dist"],scripts:{build:"tsup",test:"vitest run","test:coverage":"vitest --coverage"},main:"./biome.jsonc",author:"Hayden Bleasel <hello@haydenbleasel.com>",bugs:{url:"https://github.com/haydenbleasel/ultracite/issues"},homepage:"https://github.com/haydenbleasel/ultracite#readme",keywords:["ultracite","biome","linter","formatter","fixer"],license:"MIT",publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},repository:{type:"git",url:"git+https://github.com/haydenbleasel/ultracite.git"},devDependencies:{"@auto-it/all-contributors":"^11.3.0","@auto-it/first-time-contributor":"^11.3.0","@biomejs/biome":"2.2.0","@types/node":"^24.0.14","@vitest/coverage-v8":"3.2.4",tsup:"^8.5.0"},dependencies:{"@clack/prompts":"^0.11.0",deepmerge:"^4.3.1","jsonc-parser":"^3.3.1","trpc-cli":"^0.10.0",vitest:"^3.2.4",zod:"^4.0.5"},packageManager:"pnpm@10.13.1"}});var it={};p(it,{format:()=>he});var nt,ot,he,ye=u(()=>{"use strict";nt=require("child_process"),ot=b(require("process")),he=(e,t={})=>{try{let s=e.length>0?e.map(o=>`"${o}"`).join(" "):"./",n=t.unsafe?" --unsafe":"";(0,nt.execSync)(`npx @biomejs/biome check --write${n} ${s}`,{stdio:"inherit"})}catch(s){let n=s instanceof Error?s.message:"Unknown error";console.error("Failed to run Ultracite:",n),ot.default.exit(1)}}});var at={};p(at,{exists:()=>i,isMonorepo:()=>T});var oe,rt,i,T,g=u(()=>{"use strict";oe=require("fs/promises"),rt=require("jsonc-parser"),i=async e=>{try{return await(0,oe.access)(e),!0}catch{return!1}},T=async()=>{if(await i("pnpm-workspace.yaml"))return!0;try{let e=(0,rt.parse)(await(0,oe.readFile)("package.json","utf-8"));return e?!!e.workspaces:!1}catch{return!1}}});var dt={};p(dt,{biome:()=>L});var W,lt,ut,xs,ct,we,L,be=u(()=>{"use strict";W=require("fs/promises"),lt=b(require("deepmerge")),ut=require("jsonc-parser");g();ne();xs=x.devDependencies["@biomejs/biome"],ct={$schema:`https://biomejs.dev/schemas/${xs}/schema.json`,extends:["ultracite"]},we=async()=>await i("./biome.json")?"./biome.json":"./biome.jsonc",L={exists:async()=>{let e=await we();return i(e)},create:async()=>{let e=await we();return(0,W.writeFile)(e,JSON.stringify(ct,null,2))},update:async()=>{let e=await we(),t=await(0,W.readFile)(e,"utf-8"),n=(0,ut.parse)(t)||{},o=n.extends&&Array.isArray(n.extends)?n.extends:[];o.includes("ultracite")||(n.extends=[...o,"ultracite"]);let r={$schema:ct.$schema},l=(0,lt.default)(n,r);await(0,W.writeFile)(e,JSON.stringify(l,null,2))}}});var pt,mt,ft,gt,ht,yt,wt,bt,yn,m,v=u(()=>{"use strict";pt=["Don't use `accessKey` attribute on any HTML element.",'Don\'t set `aria-hidden="true"` on focusable elements.',"Don't add ARIA roles, states, and properties to elements that don't support them.","Don't use distracting elements like `<marquee>` or `<blink>`.","Only use the `scope` prop on `<th>` elements.","Don't assign non-interactive ARIA roles to interactive HTML elements.","Make sure label elements have text content and are associated with an input.","Don't assign interactive ARIA roles to non-interactive HTML elements.","Don't assign `tabIndex` to non-interactive HTML elements.","Don't use positive integers for `tabIndex` property.",`Don't include "image", "picture", or "photo" in img alt prop.`,"Don't use explicit role property that's the same as the implicit/default role.","Make static elements with click handlers use a valid role attribute.","Always include a `title` element for SVG elements.","Give all elements requiring alt text meaningful information for screen readers.","Make sure anchors have content that's accessible to screen readers.","Assign `tabIndex` to non-interactive HTML elements with `aria-activedescendant`.","Include all required ARIA attributes for elements with ARIA roles.","Make sure ARIA properties are valid for the element's supported roles.","Always include a `type` attribute for button elements.","Make elements with interactive roles and handlers focusable.","Give heading elements content that's accessible to screen readers (not hidden with `aria-hidden`).","Always include a `lang` attribute on the html element.","Always include a `title` attribute for iframe elements.","Accompany `onClick` with at least one of: `onKeyUp`, `onKeyDown`, or `onKeyPress`.","Accompany `onMouseOver`/`onMouseOut` with `onFocus`/`onBlur`.","Include caption tracks for audio and video elements.","Use semantic elements instead of role attributes in JSX.","Make sure all anchors are valid and navigable.","Ensure all ARIA properties (`aria-*`) are valid.","Use valid, non-abstract ARIA roles for elements with ARIA roles.","Use valid ARIA state and property values.","Use valid values for the `autocomplete` attribute on input elements.","Use correct ISO language/country codes for the `lang` attribute."],mt=["Don't use consecutive spaces in regular expression literals.","Don't use the `arguments` object.","Don't use primitive type aliases or misleading types.","Don't use the comma operator.","Don't use empty type parameters in type aliases and interfaces.","Don't write functions that exceed a given Cognitive Complexity score.","Don't nest describe() blocks too deeply in test files.","Don't use unnecessary boolean casts.","Don't use unnecessary callbacks with flatMap.","Use for...of statements instead of Array.forEach.","Don't create classes that only have static members (like a static namespace).","Don't use this and super in static contexts.","Don't use unnecessary catch clauses.","Don't use unnecessary constructors.","Don't use unnecessary continue statements.","Don't export empty modules that don't change anything.","Don't use unnecessary escape sequences in regular expression literals.","Don't use unnecessary fragments.","Don't use unnecessary labels.","Don't use unnecessary nested block statements.","Don't rename imports, exports, and destructured assignments to the same name.","Don't use unnecessary string or template literal concatenation.","Don't use String.raw in template literals when there are no escape sequences.","Don't use useless case statements in switch statements.","Don't use ternary operators when simpler alternatives exist.","Don't use useless `this` aliasing.","Don't use any or unknown as type constraints.","Don't initialize variables to undefined.","Don't use the void operators (they're not familiar).","Use arrow functions instead of function expressions.","Use Date.now() to get milliseconds since the Unix Epoch.","Use .flatMap() instead of map().flat() when possible.","Use literal property access instead of computed property access.","Don't use parseInt() or Number.parseInt() when binary, octal, or hexadecimal literals work.","Use concise optional chaining instead of chained logical expressions.","Use regular expression literals instead of the RegExp constructor when possible.","Don't use number literal object member names that aren't base 10 or use underscore separators.","Remove redundant terms from logical expressions.","Use while loops instead of for loops when you don't need initializer and update expressions.","Don't pass children as props.","Don't reassign const variables.","Don't use constant expressions in conditions.","Don't use `Math.min` and `Math.max` to clamp values when the result is constant.","Don't return a value from a constructor.","Don't use empty character classes in regular expression literals.","Don't use empty destructuring patterns.","Don't call global object properties as functions.","Don't declare functions and vars that are accessible outside their block.","Make sure builtins are correctly instantiated.","Don't use super() incorrectly inside classes. Also check that super() is called in classes that extend other constructors.","Don't use variables and function parameters before they're declared.","Don't use 8 and 9 escape sequences in string literals.","Don't use literal numbers that lose precision."],ft=["Don't use the return value of React.render.","Make sure all dependencies are correctly specified in React hooks.","Make sure all React hooks are called from the top level of component functions.","Don't forget key props in iterators and collection literals.","Don't destructure props inside JSX components in Solid projects.","Don't define React components inside other components.","Don't use event handlers on non-interactive elements.","Don't assign to React component props.","Don't use both `children` and `dangerouslySetInnerHTML` props on the same element.","Don't use dangerous JSX props.","Don't use Array index in keys.","Don't insert comments as text nodes.","Don't assign JSX properties multiple times.","Don't add extra closing tags for components without children.","Use `<>...</>` instead of `<Fragment>...</Fragment>`.",'Watch out for possible "wrong" semicolons inside JSX elements.'],gt=["Don't assign a value to itself.","Don't return a value from a setter.","Don't compare expressions that modify string case with non-compliant values.","Don't use lexical declarations in switch clauses.","Don't use variables that haven't been declared in the document.","Don't write unreachable code.","Make sure super() is called exactly once on every code path in a class constructor before this is accessed if the class has a superclass.","Don't use control flow statements in finally blocks.","Don't use optional chaining where undefined values aren't allowed.","Don't have unused function parameters.","Don't have unused imports.","Don't have unused labels.","Don't have unused private class members.","Don't have unused variables.","Make sure void (self-closing) elements don't have children.","Don't return a value from a function with the return type 'void'","Use isNaN() when checking for NaN.",'Make sure "for" loop update clauses move the counter in the right direction.',"Make sure typeof expressions are compared to valid values.","Make sure generator functions contain yield.","Don't use await inside loops.","Don't use bitwise operators.","Don't use expressions where the operation doesn't change the value.","Make sure Promise-like statements are handled appropriately.","Don't use __dirname and __filename in the global scope.","Prevent import cycles.","Don't use configured elements.","Don't hardcode sensitive data like API keys and tokens.","Don't let variable declarations shadow variables from outer scopes.","Don't use the TypeScript directive @ts-ignore.","Prevent duplicate polyfills from Polyfill.io.","Don't use useless backreferences in regular expressions that always match empty strings.","Don't use unnecessary escapes in string literals.","Don't use useless undefined.","Make sure getters and setters for the same property are next to each other in class and object definitions.","Make sure object literals are declared consistently (defaults to explicit definitions).","Use static Response methods instead of new Response() constructor when possible.","Make sure switch-case statements are exhaustive.","Make sure the `preconnect` attribute is used when using Google Fonts.","Use `Array#{indexOf,lastIndexOf}()` instead of `Array#{findIndex,findLastIndex}()` when looking for the index of an item.","Make sure iterable callbacks return consistent values.",'Use `with { type: "json" }` for JSON module imports.',"Use numeric separators in numeric literals.","Use object spread instead of `Object.assign()` when constructing new objects.","Always use the radix argument when using `parseInt()`.","Make sure JSDoc comment lines start with a single asterisk, except for the first one.","Include a description parameter for `Symbol()`.","Don't use spread (`...`) syntax on accumulators.","Don't use the `delete` operator.","Don't access namespace imports dynamically.","Don't use namespace imports.","Declare regex literals at the top level.",'Don\'t use `target="_blank"` without `rel="noopener"`.'],ht=["Don't use TypeScript enums.","Don't export imported variables.","Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions.","Don't use TypeScript namespaces.","Don't use non-null assertions with the `!` postfix operator.","Don't use parameter properties in class constructors.","Don't use user-defined types.","Use `as const` instead of literal types and type annotations.","Use either `T[]` or `Array<T>` consistently.","Initialize each enum member value explicitly.","Use `export type` for types.","Use `import type` for types.","Make sure all enum members are literal values.","Don't use TypeScript const enum.","Don't declare empty interfaces.","Don't let variables evolve into any type through reassignments.","Don't use the any type.","Don't misuse the non-null assertion operator (!) in TypeScript files.","Don't use implicit any type on variable declarations.","Don't merge interfaces and classes unsafely.","Don't use overload signatures that aren't next to each other.","Use the namespace keyword instead of the module keyword to declare TypeScript namespaces."],yt=["Don't use global `eval()`.","Don't use callbacks in asynchronous tests and hooks.","Don't use negation in `if` statements that have `else` clauses.","Don't use nested ternary expressions.","Don't reassign function parameters.","This rule lets you specify global variable names you don't want to use in your application.","Don't use specified modules when loaded by import or require.","Don't use constants whose value is the upper-case version of their name.","Use `String.slice()` instead of `String.substr()` and `String.substring()`.","Don't use template literals if you don't need interpolation or special-character handling.","Don't use `else` blocks when the `if` block breaks early.","Don't use yoda expressions.","Don't use Array constructors.","Use `at()` instead of integer index access.","Follow curly brace conventions.","Use `else if` instead of nested `if` statements in `else` clauses.","Use single `if` statements instead of nested `if` clauses.","Use `new` for all builtins except `String`, `Number`, and `Boolean`.","Use consistent accessibility modifiers on class properties and methods.","Use `const` declarations for variables that are only assigned once.","Put default function parameters and optional function parameters last.","Include a `default` clause in switch statements.","Use the `**` operator instead of `Math.pow`.","Use `for-of` loops when you need the index to extract an item from the iterated array.","Use `node:assert/strict` over `node:assert`.","Use the `node:` protocol for Node.js builtin modules.","Use Number properties instead of global ones.","Use assignment operator shorthand where possible.","Use function types instead of object types with call signatures.","Use template literals over string concatenation.","Use `new` when throwing an error.","Don't throw non-Error values.","Use `String.trimStart()` and `String.trimEnd()` over `String.trimLeft()` and `String.trimRight()`.","Use standard constants instead of approximated literals.","Don't assign values in expressions.","Don't use async functions as Promise executors.","Don't reassign exceptions in catch clauses.","Don't reassign class members.","Don't compare against -0.","Don't use labeled statements that aren't loops.","Don't use void type outside of generic or return types.","Don't use console.","Don't use control characters and escape sequences that match control characters in regular expression literals.","Don't use debugger.","Don't assign directly to document.cookie.","Use `===` and `!==`.","Don't use duplicate case labels.","Don't use duplicate class members.","Don't use duplicate conditions in if-else-if chains.","Don't use two keys with the same name inside objects.","Don't use duplicate function parameter names.","Don't have duplicate hooks in describe blocks.","Don't use empty block statements and static blocks.","Don't let switch clauses fall through.","Don't reassign function declarations.","Don't allow assignments to native objects and read-only global variables.","Use Number.isFinite instead of global isFinite.","Use Number.isNaN instead of global isNaN.","Don't assign to imported bindings.","Don't use irregular whitespace characters.","Don't use labels that share a name with a variable.","Don't use characters made with multiple code points in character class syntax.","Make sure to use new and constructor properly.","Don't use shorthand assign when the variable appears on both sides.","Don't use octal escape sequences in string literals.","Don't use Object.prototype builtins directly.","Don't redeclare variables, functions, classes, and types in the same scope.",`Don't have redundant "use strict".`,"Don't compare things where both sides are exactly the same.","Don't let identifiers shadow restricted names.","Don't use sparse arrays (arrays with holes).","Don't use template literal placeholder syntax in regular strings.","Don't use the then property.","Don't use unsafe negation.","Don't use var.","Don't use with statements in non-strict contexts.","Make sure async functions actually use await.","Make sure default clauses in switch statements come last.","Make sure to pass a message value when creating a built-in error.","Make sure get methods always return a value.","Use a recommended display strategy with Google Fonts.","Make sure for-in loops include an if statement.","Use Array.isArray() instead of instanceof Array.","Make sure to use the digits argument with Number#toFixed().",'Make sure to use the "use strict" directive in script files.'],wt=["Don't use `<img>` elements in Next.js projects.","Don't use `<head>` elements in Next.js projects.","Don't import next/document outside of pages/_document.jsx in Next.js projects.","Don't use the next/head module in pages/_document.js on Next.js projects."],bt=["Don't use export or module.exports in test files.","Don't use focused tests.","Make sure the assertion function, like expect, is placed inside an it() function call.","Don't use disabled tests."],yn=[...pt,...mt,...ft,...gt,...ht,...yt,...wt,...bt],m=`# Project Context
|
|
3
3
|
Ultracite enforces strict type safety, accessibility standards, and consistent code quality for JavaScript/TypeScript projects using Biome's lightning-fast formatter and linter.
|
|
4
4
|
|
|
5
5
|
## Key Principles
|
|
@@ -17,35 +17,35 @@ Ultracite enforces strict type safety, accessibility standards, and consistent c
|
|
|
17
17
|
## Rules
|
|
18
18
|
|
|
19
19
|
### Accessibility (a11y)
|
|
20
|
-
${
|
|
20
|
+
${pt.map(e=>`- ${e}`).join(`
|
|
21
21
|
`)}
|
|
22
22
|
|
|
23
23
|
### Code Complexity and Quality
|
|
24
|
-
${
|
|
24
|
+
${mt.map(e=>`- ${e}`).join(`
|
|
25
25
|
`)}
|
|
26
26
|
|
|
27
27
|
### React and JSX Best Practices
|
|
28
|
-
${
|
|
28
|
+
${ft.map(e=>`- ${e}`).join(`
|
|
29
29
|
`)}
|
|
30
30
|
|
|
31
31
|
### Correctness and Safety
|
|
32
|
-
${
|
|
32
|
+
${gt.map(e=>`- ${e}`).join(`
|
|
33
33
|
`)}
|
|
34
34
|
|
|
35
35
|
### TypeScript Best Practices
|
|
36
|
-
${
|
|
36
|
+
${ht.map(e=>`- ${e}`).join(`
|
|
37
37
|
`)}
|
|
38
38
|
|
|
39
39
|
### Style and Consistency
|
|
40
|
-
${
|
|
40
|
+
${yt.map(e=>`- ${e}`).join(`
|
|
41
41
|
`)}
|
|
42
42
|
|
|
43
43
|
### Next.js Specific Rules
|
|
44
|
-
${
|
|
44
|
+
${wt.map(e=>`- ${e}`).join(`
|
|
45
45
|
`)}
|
|
46
46
|
|
|
47
47
|
### Testing Best Practices
|
|
48
|
-
${
|
|
48
|
+
${bt.map(e=>`- ${e}`).join(`
|
|
49
49
|
`)}
|
|
50
50
|
|
|
51
51
|
## Common Tasks
|
|
@@ -70,16 +70,16 @@ try {
|
|
|
70
70
|
} catch (e) {
|
|
71
71
|
console.log(e);
|
|
72
72
|
}
|
|
73
|
-
\`\`\``});var
|
|
73
|
+
\`\`\``});var vt={};p(vt,{claude:()=>_});var R,ve,_,ke=u(()=>{"use strict";R=require("fs/promises");v();g();ve="./.claude/CLAUDE.md",_={exists:()=>i(ve),create:async()=>{await(0,R.mkdir)(".claude",{recursive:!0}),await(0,R.writeFile)(ve,m)},update:async()=>{await(0,R.mkdir)(".claude",{recursive:!0}),await(0,R.writeFile)(ve,m)}}});var kt={};p(kt,{codex:()=>q});var De,xe,q,je=u(()=>{"use strict";De=require("fs/promises");v();g();xe="./AGENTS.md",q={exists:()=>i(xe),create:async()=>{await(0,De.writeFile)(xe,m)},update:async()=>{await(0,De.writeFile)(xe,m)}}});var xt={};p(xt,{cursor:()=>B});var P,Ce,Ds,B,Se=u(()=>{"use strict";P=require("fs/promises");v();g();Ce="./.cursor/rules/ultracite.mdc",Ds=`---
|
|
74
74
|
description: Ultracite Rules - AI-Ready Formatter and Linter
|
|
75
75
|
globs: "**/*.{ts,tsx,js,jsx}"
|
|
76
76
|
alwaysApply: true
|
|
77
77
|
---
|
|
78
78
|
|
|
79
|
-
${m}`,
|
|
80
|
-
${
|
|
79
|
+
${m}`,B={exists:()=>i(Ce),create:async()=>{await(0,P.mkdir)(".cursor/rules",{recursive:!0}),await(0,P.writeFile)(Ce,Ds)},update:async()=>{await(0,P.mkdir)(".cursor/rules",{recursive:!0}),await(0,P.writeFile)(Ce,m)}}});var Rt={};p(Rt,{eslintCleanup:()=>ie});var Dt,jt,H,Re,Ct,St,js,Cs,Ss,Rs,Ps,ie,Pe=u(()=>{"use strict";Dt=require("child_process"),jt=require("fs/promises"),H=require("fs/promises"),Re=require("jsonc-parser");g();Ct=[".eslintrc",".eslintrc.js",".eslintrc.json",".eslintrc.yml",".eslintrc.yaml",".eslintrc.config.js","eslint.config.js","eslint.config.mjs","eslint.config.cjs",".eslintignore"],St=async()=>{try{let e=await(0,H.readFile)("package.json","utf-8"),t=(0,Re.parse)(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(r=>r.startsWith("eslint")||r==="@eslint/js"||r==="@typescript-eslint/parser"||r==="@typescript-eslint/eslint-plugin")}catch{return[]}},js=(e,t)=>{if(t.length===0)return;let s=t.join(" ");try{(0,Dt.execSync)(`${e} ${s}`,{stdio:"pipe"})}catch{}},Cs=async()=>{let e=[];for(let t of Ct)if(await i(t))try{await(0,jt.unlink)(t),e.push(t)}catch{}return e},Ss=async()=>{let e="./.vscode/settings.json";if(!await i(e))return!1;try{let t=await(0,H.readFile)(e,"utf-8"),s=(0,Re.parse)(t);if(!s||typeof s!="object")return!1;let n=!1,o={...s},r=["eslint.enable","eslint.format.enable","eslint.validate","eslint.workingDirectories","eslint.codeAction.showDocumentation","eslint.run","eslint.autoFixOnSave","eslint.quiet","eslint.packageManager","eslint.options","eslint.trace.server"];for(let l of r)l in o&&(delete o[l],n=!0);if("editor.codeActionsOnSave"in o){let l=o["editor.codeActionsOnSave"];if(l&&typeof l=="object"){let a=["source.fixAll.eslint","source.organizeImports.eslint"];for(let f of a)f in l&&(delete l[f],n=!0);Object.keys(l).length===0&&delete o["editor.codeActionsOnSave"]}}return n?(await(0,H.writeFile)(e,JSON.stringify(o,null,2)),!0):!1}catch{return!1}},Rs=async()=>{if((await St()).length>0)return!0;for(let t of Ct)if(await i(t))return!0;return!1},Ps=e=>e.startsWith("npm")?"npm uninstall":e.startsWith("yarn")?"yarn remove":e.startsWith("pnpm")?"pnpm remove":e.startsWith("bun")?"bun remove":"npm uninstall",ie={hasESLint:Rs,remove:async e=>{let t=await St(),s=Ps(e);js(s,t);let n=await Cs(),o=await Ss();return{packagesRemoved:t,filesRemoved:n,vsCodeCleaned:o}}}});var At={};p(At,{husky:()=>F});var Ft,D,Pt,re,F,Fe=u(()=>{"use strict";Ft=require("child_process"),D=require("fs/promises");g();Pt="npx ultracite format",re="./.husky/pre-commit",F={exists:()=>i(re),install:e=>{(0,Ft.execSync)(`${e} -D husky`)},create:async()=>{await(0,D.mkdir)(".husky",{recursive:!0}),await(0,D.writeFile)(re,Pt)},update:async()=>{let e=await(0,D.readFile)(re,"utf-8");await(0,D.writeFile)(re,`${e}
|
|
80
|
+
${Pt}`)}}});var It={};p(It,{kiro:()=>$t});var A,Ae,$t,$e=u(()=>{"use strict";A=require("fs/promises");v();g();Ae="./.kiro/steering/linting-and-formatting.md",$t={exists:()=>i(Ae),create:async()=>{await(0,A.mkdir)(".kiro/steering",{recursive:!0}),await(0,A.writeFile)(Ae,m)},update:async()=>{await(0,A.mkdir)(".kiro/steering",{recursive:!0}),await(0,A.writeFile)(Ae,m)}}});var Ut={};p(Ut,{lefthook:()=>I});var Ie,j,ae,$,Ot,I,Oe=u(()=>{"use strict";Ie=require("child_process"),j=require("fs/promises");g();ae="npx ultracite format",$="./lefthook.yml",Ot=`pre-commit:
|
|
81
81
|
jobs:
|
|
82
|
-
- run: ${
|
|
82
|
+
- run: ${ae}
|
|
83
83
|
glob:
|
|
84
84
|
- "*.js"
|
|
85
85
|
- "*.jsx"
|
|
@@ -89,7 +89,7 @@ ${Rt}`)}}});var $t={};p($t,{kiro:()=>At});var F,Fe,At,Ae=u(()=>{"use strict";F=r
|
|
|
89
89
|
- "*.jsonc"
|
|
90
90
|
- "*.css"
|
|
91
91
|
stage_fixed: true
|
|
92
|
-
|
|
92
|
+
`,I={exists:()=>i($),install:e=>{(0,Ie.execSync)(`${e} -D lefthook`),(0,Ie.execSync)("npx lefthook install")},create:async()=>{await(0,j.writeFile)($,Ot)},update:async()=>{let e=await(0,j.readFile)($,"utf-8");if(!e.includes(ae))if(e.includes("pre-commit:"))if(e.includes("jobs:")){let t=` - run: ${ae}
|
|
93
93
|
glob:
|
|
94
94
|
- "*.js"
|
|
95
95
|
- "*.jsx"
|
|
@@ -99,8 +99,8 @@ ${Rt}`)}}});var $t={};p($t,{kiro:()=>At});var F,Fe,At,Ae=u(()=>{"use strict";F=r
|
|
|
99
99
|
- "*.jsonc"
|
|
100
100
|
- "*.css"
|
|
101
101
|
stage_fixed: true`,s=e.replace(/(pre-commit:\s*\n\s*jobs:\s*\n)/,`$1${t}
|
|
102
|
-
`);await(0,
|
|
103
|
-
- run: ${
|
|
102
|
+
`);await(0,j.writeFile)($,s)}else{let t=` jobs:
|
|
103
|
+
- run: ${ae}
|
|
104
104
|
glob:
|
|
105
105
|
- "*.js"
|
|
106
106
|
- "*.jsx"
|
|
@@ -110,8 +110,8 @@ ${Rt}`)}}});var $t={};p($t,{kiro:()=>At});var F,Fe,At,Ae=u(()=>{"use strict";F=r
|
|
|
110
110
|
- "*.jsonc"
|
|
111
111
|
- "*.css"
|
|
112
112
|
stage_fixed: true`,s=e.replace(/(pre-commit:\s*\n)/,`$1${t}
|
|
113
|
-
`);await(0,
|
|
114
|
-
${
|
|
113
|
+
`);await(0,j.writeFile)($,s)}else await(0,j.writeFile)($,`${e}
|
|
114
|
+
${Ot}`)}}});var Et={};p(Et,{lint:()=>Ue});var Jt,Mt,Ue,Je=u(()=>{"use strict";Jt=require("child_process"),Mt=b(require("process")),Ue=e=>{try{let t=e.length>0?e.map(s=>`"${s}"`).join(" "):"./";(0,Jt.execSync)(`npx @biomejs/biome check ${t}`,{stdio:"inherit"})}catch(t){let s=t instanceof Error?t.message:"Unknown error";console.error("Failed to run Ultracite:",s),Mt.default.exit(1)}}});var Nt={};p(Nt,{packageManager:()=>O});var ce,Me,O,Ee=u(()=>{"use strict";ce=require("@clack/prompts");g();Me=[{hint:"Recommended",label:"pnpm",value:"pnpm add",lockfiles:["pnpm-lock.yaml"],monorepoSuffix:"-w"},{label:"bun",value:"bun add",lockfiles:["bun.lockb","bun.lock"],monorepoSuffix:""},{label:"yarn",value:"yarn add",lockfiles:["yarn.lock"],monorepoSuffix:""},{label:"npm",value:"npm install --legacy-peer-deps",lockfiles:["package-lock.json"],monorepoSuffix:"--workspace ."}],O={get:async()=>{let e=await T();e&&ce.log.info("Monorepo detected, updating install command to include workspace flag");for(let t of Me){let s=!1;for(let n of t.lockfiles)if(await i(n)){s=!0;break}if(s)return e&&t.monorepoSuffix?`${t.value} ${t.monorepoSuffix}`:t.value}return null},select:async()=>{let e=await T(),t=await(0,ce.select)({initialValue:"pnpm",message:"Which package manager do you use?",options:Me.map(s=>({label:s.label,value:e&&s.monorepoSuffix?`${s.value} ${s.monorepoSuffix}`:s.value}))});return typeof t!="string"?null:t},isMonorepo:T,options:Me}});var _t={};p(_t,{prettierCleanup:()=>le});var zt,Tt,V,Ne,Wt,Lt,Fs,As,$s,Is,Os,le,ze=u(()=>{"use strict";zt=require("child_process"),Tt=require("fs/promises"),V=require("fs/promises"),Ne=require("jsonc-parser");g();Wt=[".prettierrc",".prettierrc.js",".prettierrc.json",".prettierrc.yml",".prettierrc.yaml",".prettierrc.config.js","prettier.config.js","prettier.config.mjs",".prettierignore"],Lt=async()=>{try{let e=await(0,V.readFile)("package.json","utf-8"),t=(0,Ne.parse)(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(r=>r.startsWith("prettier")||r==="eslint-config-prettier"||r==="eslint-plugin-prettier")}catch{return[]}},Fs=(e,t)=>{if(t.length===0)return;let s=t.join(" ");try{(0,zt.execSync)(`${e} ${s}`,{stdio:"pipe"})}catch{}},As=async()=>{let e=[];for(let t of Wt)if(await i(t))try{await(0,Tt.unlink)(t),e.push(t)}catch{}return e},$s=async()=>{let e="./.vscode/settings.json";if(!await i(e))return!1;try{let t=await(0,V.readFile)(e,"utf-8"),s=(0,Ne.parse)(t);if(!s||typeof s!="object")return!1;let n=!1,o={...s},r=["editor.defaultFormatter","prettier.enable","prettier.requireConfig","prettier.configPath","prettier.printWidth","prettier.tabWidth","prettier.useTabs","prettier.semi","prettier.singleQuote","prettier.quoteProps","prettier.trailingComma","prettier.bracketSpacing","prettier.arrowParens","prettier.endOfLine"];for(let a of r)a in o&&(a==="editor.defaultFormatter"&&o[a]==="esbenp.prettier-vscode"||a!=="editor.defaultFormatter")&&(delete o[a],n=!0);let l=Object.keys(o).filter(a=>a.startsWith("[")&&a.includes("javascript"));for(let a of l){let f=o[a];f&&typeof f=="object"&&"editor.defaultFormatter"in f&&f["editor.defaultFormatter"]==="esbenp.prettier-vscode"&&(delete f["editor.defaultFormatter"],n=!0,Object.keys(f).length===0&&delete o[a])}return n?(await(0,V.writeFile)(e,JSON.stringify(o,null,2)),!0):!1}catch{return!1}},Is=async()=>{if((await Lt()).length>0)return!0;for(let t of Wt)if(await i(t))return!0;return!1},Os=e=>e.startsWith("npm")?"npm uninstall":e.startsWith("yarn")?"yarn remove":e.startsWith("pnpm")?"pnpm remove":e.startsWith("bun")?"bun remove":"npm uninstall",le={hasPrettier:Is,remove:async e=>{let t=await Lt(),s=Os(e);Fs(s,t);let n=await As(),o=await $s();return{packagesRemoved:t,filesRemoved:n,vsCodeCleaned:o}}}});var qt={};p(qt,{title:()=>Te});var Te,We=u(()=>{"use strict";Te=`
|
|
115
115
|
888 888 888 88888888888 8888888b. d8888 .d8888b. 8888888 88888888888 8888888888
|
|
116
116
|
888 888 888 888 888 Y88b d88888 d88P Y88b 888 888 888
|
|
117
117
|
888 888 888 888 888 888 d88P888 888 888 888 888 888
|
|
@@ -120,16 +120,16 @@ ${Ut}`)}}});var Et={};p(Et,{lint:()=>Ie});var Mt,Ot,Ie,Me=u(()=>{"use strict";Mt
|
|
|
120
120
|
888 888 888 888 888 T88b d88P 888 888 888 888 888 888
|
|
121
121
|
Y88b. .d88P 888 888 888 T88b d8888888888 Y88b d88P 888 888 888
|
|
122
122
|
"Y88888P" 88888888 888 888 T88b d88P 888 "Y8888P" 8888888 888 8888888888
|
|
123
|
-
`});var Kt={};p(Kt,{tsconfig:()=>
|
|
123
|
+
`});var Kt={};p(Kt,{tsconfig:()=>G});var K,Ht,Vt,Bt,ue,G,Le=u(()=>{"use strict";K=require("fs/promises"),Ht=b(require("deepmerge")),Vt=require("jsonc-parser");g();Bt={compilerOptions:{strictNullChecks:!0}},ue="./tsconfig.json",G={exists:()=>i(ue),create:()=>(0,K.writeFile)(ue,JSON.stringify(Bt,null,2)),update:async()=>{let e=await(0,K.readFile)(ue,"utf-8"),s=(0,Vt.parse)(e)||{},n=(0,Ht.default)(s,Bt);await(0,K.writeFile)(ue,JSON.stringify(n,null,2))}}});var Yt={};p(Yt,{vscodeCopilot:()=>Y});var U,_e,Gt,Y,qe=u(()=>{"use strict";U=require("fs/promises");v();g();_e="./.github/copilot-instructions.md",Gt=`---
|
|
124
124
|
applyTo: "**/*.{ts,tsx,js,jsx}"
|
|
125
125
|
---
|
|
126
126
|
|
|
127
|
-
${m}`,
|
|
127
|
+
${m}`,Y={exists:()=>i(_e),create:async()=>{await(0,U.mkdir)(".github",{recursive:!0}),await(0,U.writeFile)(_e,Gt)},update:async()=>{await(0,U.mkdir)(".github",{recursive:!0}),await(0,U.writeFile)(_e,Gt)}}});var es={};p(es,{vscode:()=>Z});var C,Xt,Qt,Zt,de,Z,Be=u(()=>{"use strict";C=require("fs/promises"),Xt=b(require("deepmerge")),Qt=require("jsonc-parser");g();Zt={"editor.defaultFormatter":"esbenp.prettier-vscode","[javascript]":{"editor.defaultFormatter":"biomejs.biome"},"[typescript]":{"editor.defaultFormatter":"biomejs.biome"},"[javascriptreact]":{"editor.defaultFormatter":"biomejs.biome"},"[typescriptreact]":{"editor.defaultFormatter":"biomejs.biome"},"[json]":{"editor.defaultFormatter":"biomejs.biome"},"[jsonc]":{"editor.defaultFormatter":"biomejs.biome"},"[css]":{"editor.defaultFormatter":"biomejs.biome"},"[graphql]":{"editor.defaultFormatter":"biomejs.biome"},"typescript.tsdk":"node_modules/typescript/lib","editor.formatOnSave":!0,"editor.formatOnPaste":!0,"emmet.showExpandedAbbreviation":"never","editor.codeActionsOnSave":{"source.fixAll.biome":"explicit","source.organizeImports.biome":"explicit"}},de="./.vscode/settings.json",Z={exists:()=>i(de),create:async()=>{await(0,C.mkdir)(".vscode",{recursive:!0}),await(0,C.writeFile)(de,JSON.stringify(Zt,null,2))},update:async()=>{let e=await(0,C.readFile)(de,"utf-8"),s=(0,Qt.parse)(e)||{},n=(0,Xt.default)(s,Zt);await(0,C.writeFile)(de,JSON.stringify(n,null,2))}}});var ts={};p(ts,{windsurf:()=>X});var J,He,X,Ve=u(()=>{"use strict";J=require("fs/promises");v();g();He="./.windsurf/rules/ultracite.md",X={exists:()=>i(He),create:async()=>{await(0,J.mkdir)(".windsurf/rules",{recursive:!0}),await(0,J.writeFile)(He,m)},update:async()=>{await(0,J.mkdir)(".windsurf/rules",{recursive:!0}),await(0,J.writeFile)(He,m)}}});var is={};p(is,{zed:()=>Q});var S,ns,os,ss,pe,Q,Ke=u(()=>{"use strict";S=require("fs/promises"),ns=b(require("deepmerge")),os=require("jsonc-parser");g();ss={formatter:"language_server",format_on_save:"on",languages:{JavaScript:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},TypeScript:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},JSX:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},TSX:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}}},lsp:{"typescript-language-server":{settings:{typescript:{preferences:{includePackageJsonAutoImports:"on"}}}}}},pe="./.zed/settings.json",Q={exists:()=>i(pe),create:async()=>{await(0,S.mkdir)(".zed",{recursive:!0}),await(0,S.writeFile)(pe,JSON.stringify(ss,null,2))},update:async()=>{let e=await(0,S.readFile)(pe,"utf-8"),s=(0,os.parse)(e)||{},n=(0,ns.default)(s,ss);await(0,S.writeFile)(pe,JSON.stringify(n,null,2))}}});var rs={};p(rs,{zedCopilot:()=>ee});var E,M,ee,Ge=u(()=>{"use strict";E=require("fs/promises");v();g();M="./.rules",ee={exists:()=>i(M),create:async()=>{await(0,E.writeFile)(M,m)},update:async()=>{if(!await i(M)){await(0,E.writeFile)(M,m);return}let e=await(0,E.readFile)(M,"utf-8");e.includes(m.trim())||await(0,E.writeFile)(M,`${e}
|
|
128
128
|
|
|
129
|
-
${m}`)}}});var
|
|
130
|
-
`).filter(r=>r.trim()&&!r.trim().startsWith("#")),s={},n=null,o=[];for(let r of t){let l=Ms(r,s,n,o);n=l.newCurrentKey,o=l.newCurrentArray}return n&&o.length>0&&(s[n]=o),s},
|
|
129
|
+
${m}`)}}});var Js,Ye=u(()=>{Js=tt({"./biome.ts":()=>(be(),d(dt)),"./claude.ts":()=>(ke(),d(vt)),"./codex.ts":()=>(je(),d(kt)),"./cursor.ts":()=>(Se(),d(xt)),"./eslint-cleanup.ts":()=>(Pe(),d(Rt)),"./format.ts":()=>(ye(),d(it)),"./husky.ts":()=>(Fe(),d(At)),"./index.ts":()=>(ls(),d(Us)),"./initialize.ts":()=>(Xe(),d(cs)),"./kiro.ts":()=>($e(),d(It)),"./lefthook.ts":()=>(Oe(),d(Ut)),"./lint-staged.ts":()=>(Ze(),d(as)),"./lint.ts":()=>(Je(),d(Et)),"./package-manager.ts":()=>(Ee(),d(Nt)),"./prettier-cleanup.ts":()=>(ze(),d(_t)),"./title.ts":()=>(We(),d(qt)),"./tsconfig.ts":()=>(Le(),d(Kt)),"./utils.ts":()=>(g(),d(at)),"./vscode-copilot.ts":()=>(qe(),d(Yt)),"./vscode-settings.ts":()=>(Be(),d(es)),"./windsurf.ts":()=>(Ve(),d(ts)),"./zed-settings.ts":()=>(Ke(),d(is)),"./zed.ts":()=>(Ge(),d(rs))})});var as={};p(as,{lintStaged:()=>z});var ds,y,ps,N,me,k,us,Ms,Es,Ns,zs,Ts,Ws,Ls,_s,qs,Qe,Bs,z,Ze=u(()=>{"use strict";ds=require("child_process"),y=require("fs/promises"),ps=require("url"),N=b(require("deepmerge")),me=require("jsonc-parser");g();Ye();k={"*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}":["npx ultracite format"]},us=["./package.json","./.lintstagedrc.json","./.lintstagedrc.js","./.lintstagedrc.cjs","./.lintstagedrc.mjs","./lint-staged.config.js","./lint-staged.config.cjs","./lint-staged.config.mjs","./.lintstagedrc.yaml","./.lintstagedrc.yml","./.lintstagedrc"],Ms=(e,t,s,n)=>{let o=e.trim();if(o.includes(":")&&!o.startsWith("-")){s&&n.length>0&&(t[s]=n);let[r,...l]=o.split(":"),a=l.join(":").trim(),f=r.trim().replace(/['"]/g,"");return a&&a!==""?(a.startsWith("[")&&a.endsWith("]")?t[f]=a.slice(1,-1).split(",").map(te=>te.trim().replace(/['"]/g,"")):t[f]=a.replace(/['"]/g,""),{newCurrentKey:null,newCurrentArray:[]}):{newCurrentKey:f,newCurrentArray:[]}}if(o.startsWith("-")&&s){let r=[...n,o.slice(1).trim().replace(/['"]/g,"")];return{newCurrentKey:s,newCurrentArray:r}}return{newCurrentKey:s,newCurrentArray:n}},Es=e=>{let t=e.split(`
|
|
130
|
+
`).filter(r=>r.trim()&&!r.trim().startsWith("#")),s={},n=null,o=[];for(let r of t){let l=Ms(r,s,n,o);n=l.newCurrentKey,o=l.newCurrentArray}return n&&o.length>0&&(s[n]=o),s},Ns=e=>{let t="";for(let[s,n]of Object.entries(e))if(Array.isArray(n)){t+=`${s}:
|
|
131
131
|
`;for(let o of n)t+=` - '${o}'
|
|
132
132
|
`}else t+=`${s}: '${n}'
|
|
133
|
-
`;return t},zs=async()=>{try{let e=(0,
|
|
134
|
-
`;await(0,y.writeFile)(e,r)},
|
|
135
|
-
`;await(0,y.writeFile)(e,n)},Xe=async()=>{await(0,y.writeFile)(".lintstagedrc.json",JSON.stringify(v,null,2))},_s=async e=>{if(e==="./package.json"){await Js();return}if(e.endsWith(".json")||e==="./.lintstagedrc"){await Ts(e);return}if(e.endsWith(".yaml")||e.endsWith(".yml")){await Ns(e);return}let t=await zs();if(e.endsWith(".mjs")||e.endsWith(".js")&&t){try{await Ws(e)}catch{await Xe()}return}if(e.endsWith(".cjs")||e.endsWith(".js")&&!t)try{await Ls(e)}catch{await Xe()}},J={exists:async()=>{for(let e of ls)if(await i(e))return!0;return!1},install:e=>{(0,us.execSync)(`${e} -D lint-staged`)},create:async()=>{await(0,y.writeFile)(".lintstagedrc.json",JSON.stringify(v,null,2))},update:async()=>{let e=null;for(let t of ls)if(await i(t)){e=t;break}if(!e){await Xe();return}await _s(e)}}});var as={};p(as,{initialize:()=>Qe});var ps,ms,c,qs,Bs,Hs,Ks,Vs,Gs,Ys,Zs,Xs,Qs,en,tn,sn,nn,on,rn,an,cn,Qe,Ze=u(()=>{"use strict";ps=require("child_process"),ms=w(require("process")),c=require("@clack/prompts");we();ve();De();je();Re();Pe();Ae();Ue();Ye();Ee();Je();Ne();We();_e();qe();He();Ve();Ke();se();qs=j.devDependencies["@biomejs/biome"],Bs=e=>{let t=(0,c.spinner)();t.start("Installing dependencies..."),(0,ps.execSync)(`${e} -D -E ultracite @biomejs/biome@${qs}`),t.stop("Dependencies installed.")},Hs=async()=>{let e=(0,c.spinner)();if(e.start("Checking for tsconfig.json..."),await V.exists()){e.message("tsconfig.json found, updating..."),await V.update(),e.stop("tsconfig.json updated.");return}e.message("tsconfig.json not found, creating..."),await V.create(),e.stop("tsconfig.json created.")},Ks=async()=>{let e=(0,c.spinner)();if(e.start("Checking for .vscode/settings.json..."),await Y.exists()){e.message("settings.json found, updating..."),await Y.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await Y.create(),e.stop("settings.json created.")},Vs=async()=>{let e=(0,c.spinner)();if(e.start("Checking for .zed/settings.json..."),await X.exists()){e.message("settings.json found, updating..."),await X.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await X.create(),e.stop("settings.json created.")},Gs=async()=>{let e=(0,c.spinner)();if(e.start("Checking for Biome configuration..."),await W.exists()){e.message("Biome configuration found, updating..."),await W.update(),e.stop("Biome configuration updated.");return}e.message("Biome configuration not found, creating..."),await W.create(),e.stop("Biome configuration created.")},Ys=async e=>{let t=(0,c.spinner)();if(t.start("Initializing pre-commit hooks..."),t.message("Installing Husky..."),P.install(e),await P.exists()){t.message("Pre-commit hook found, updating..."),await P.update(),t.stop("Pre-commit hook updated.");return}t.message("Pre-commit hook not found, creating..."),await P.create(),t.stop("Pre-commit hook created.")},Zs=async e=>{let t=(0,c.spinner)();if(t.start("Initializing lefthook..."),t.message("Installing lefthook..."),$.install(e),await $.exists()){t.message("lefthook.yml found, updating..."),await $.update(),t.stop("lefthook.yml updated.");return}t.message("lefthook.yml not found, creating..."),await $.create(),t.stop("lefthook.yml created.")},Xs=async e=>{let t=(0,c.spinner)();if(t.start("Initializing lint-staged..."),t.message("Installing lint-staged..."),J.install(e),await J.exists()){t.message("lint-staged found, updating..."),await J.update(),t.stop("lint-staged updated.");return}t.message("lint-staged not found, creating..."),await J.create(),t.stop("lint-staged created.")},Qs=async()=>{let e=(0,c.spinner)();if(e.start("Checking for GitHub Copilot rules..."),await G.exists()){e.message("GitHub Copilot rules found, updating..."),await G.update(),e.stop("GitHub Copilot rules updated.");return}e.message("GitHub Copilot rules not found, creating..."),await G.create(),e.stop("GitHub Copilot rules created.")},en=async()=>{let e=(0,c.spinner)();if(e.start("Checking for Cursor rules..."),await q.exists()){e.message("Cursor rules found, updating..."),await q.update(),e.stop("Cursor rules updated.");return}e.message("Cursor rules not found, creating..."),await q.create(),e.stop("Cursor rules created.")},tn=async()=>{let e=(0,c.spinner)();if(e.start("Checking for Windsurf rules..."),await Z.exists()){e.message("Windsurf rules found, updating..."),await Z.update(),e.stop("Windsurf rules updated.");return}e.message("Windsurf rules not found, creating..."),await Z.create(),e.stop("Windsurf rules created.")},sn=async()=>{let e=(0,c.spinner)();if(e.start("Checking for Zed rules..."),await Q.exists()){e.message("Zed rules found, updating..."),await Q.update(),e.stop("Zed rules updated.");return}e.message("Zed rules not found, creating..."),await Q.create(),e.stop("Zed rules created.")},nn=async()=>{let e=(0,c.spinner)();if(e.start("Checking for Claude Code rules..."),await L.exists()){e.message("Claude Code rules found, updating..."),await L.update(),e.stop("Claude Code rules updated.");return}e.message("Claude Code rules not found, creating..."),await L.create(),e.stop("Claude Code rules created.")},on=async()=>{let e=(0,c.spinner)();if(e.start("Checking for OpenAI Codex rules..."),await _.exists()){e.message("OpenAI Codex rules found, updating..."),await _.update(),e.stop("OpenAI Codex rules updated.");return}e.message("OpenAI Codex rules not found, creating..."),await _.create(),e.stop("OpenAI Codex rules created.")},rn=async e=>{let t=(0,c.spinner)();t.start("Removing Prettier dependencies and configuration...");try{let s=await ce.remove(e);s.packagesRemoved.length>0&&t.message(`Removed Prettier packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&t.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&t.message("Cleaned VS Code settings"),t.stop("Prettier removed successfully.")}catch{t.stop("Failed to remove Prettier completely, but continuing...")}},an=async e=>{let t=(0,c.spinner)();t.start("Removing ESLint dependencies and configuration...");try{let s=await oe.remove(e);s.packagesRemoved.length>0&&t.message(`Removed ESLint packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&t.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&t.message("Cleaned VS Code settings"),t.stop("ESLint removed successfully.")}catch{t.stop("Failed to remove ESLint completely, but continuing...")}},cn=async e=>{if(e){let n=U.options.find(r=>r.label===e);if(!n)throw new Error(`Unsupported package manager: ${e}`);return await U.isMonorepo()&&n.monorepoSuffix?`${n.value} ${n.monorepoSuffix}`:n.value}let t=await U.get();if(t)return c.log.info(`Detected lockfile, using ${t}`),t;let s=await U.select();if(!s)throw new Error("No package manager selected");return s},Qe=async e=>{(0,c.intro)(Te);try{let t=e??{},s=await cn(t.pm),n=t.removePrettier,o=t.removeEslint;if(n===void 0||o===void 0){let f=[];if(n===void 0&&await ce.hasPrettier()&&f.push({label:"Remove Prettier (dependencies, config files, VS Code settings)",value:"prettier"}),o===void 0&&await oe.hasESLint()&&f.push({label:"Remove ESLint (dependencies, config files, VS Code settings)",value:"eslint"}),f.length>0){let ee=await(0,c.multiselect)({message:"Remove existing formatters/linters (recommended for clean migration)?",options:f,required:!1});n===void 0&&(n=ee.includes("prettier")),o===void 0&&(o=ee.includes("eslint"))}}let r=t.editors;r||(r=await(0,c.multiselect)({message:"Which editors do you want to configure (recommended)?",options:[{label:"VSCode / Cursor / Windsurf",value:"vscode"},{label:"Zed",value:"zed"}],required:!1}));let l=t.rules;l||(l=await(0,c.multiselect)({message:"Which editor rules do you want to enable (optional)?",options:[{label:"GitHub Copilot (VSCode)",value:"vscode-copilot"},{label:"Cursor",value:"cursor"},{label:"Windsurf",value:"windsurf"},{label:"Zed",value:"zed"},{label:"Claude Code",value:"claude"},{label:"OpenAI Codex",value:"codex"}],required:!1}));let a=t.features;a===void 0&&(t.pm||t.editors||t.rules||t.removePrettier!==void 0||t.removeEslint!==void 0?a=[]:a=await(0,c.multiselect)({message:"Would you like any of the following (optional)?",options:[{label:"Husky pre-commit hook",value:"husky"},{label:"Lefthook pre-commit hook",value:"lefthook"},{label:"Lint-staged",value:"lint-staged"}],required:!1})),n&&await rn(s),o&&await an(s),Bs(s),await Hs(),await Gs(),r?.includes("vscode")&&await Ks(),r?.includes("zed")&&await Vs(),l?.includes("vscode-copilot")&&await Qs(),l?.includes("cursor")&&await en(),l?.includes("windsurf")&&await tn(),l?.includes("zed")&&await sn(),l?.includes("claude")&&await nn(),l?.includes("codex")&&await on(),a?.includes("husky")&&await Ys(s),a?.includes("lefthook")&&await Zs(s),a?.includes("lint-staged")&&await Xs(s),c.log.success("Successfully initialized Ultracite configuration!")}catch(t){let s=t instanceof Error?t.message:"Unknown error";c.log.error(`Failed to initialize Ultracite configuration: ${s}`),ms.default.exit(1)}}});var Us={};var fe,h,me,ln,un,cs=u(()=>{fe=require("trpc-cli"),h=w(require("zod"));se();he();Ze();Me();me=fe.trpcServer.initTRPC.meta().create(),ln=me.router({init:me.procedure.meta({description:"Initialize Ultracite in the current directory"}).input(h.default.object({pm:h.default.enum(["pnpm","bun","yarn","npm"]).optional().describe("Package manager to use"),editors:h.default.array(h.default.enum(["vscode","zed"])).optional().describe("Editors to configure"),rules:h.default.array(h.default.enum(["vscode-copilot","cursor","windsurf","zed","claude","codex"])).optional().describe("Editor rules to enable"),features:h.default.array(h.default.enum(["husky","lefthook","lint-staged"])).optional().describe("Additional features to enable"),removePrettier:h.default.boolean().optional().describe("Remove Prettier dependencies and configuration"),removeEslint:h.default.boolean().optional().describe("Remove ESLint dependencies and configuration")})).mutation(async({input:e})=>{await Qe(e)}),lint:me.procedure.meta({description:"Run Biome linter without fixing files"}).input(h.default.array(h.default.string()).optional().default([]).describe("specific files to lint")).query(({input:e})=>{Ie(e)}),format:me.procedure.meta({description:"Run Biome linter and fixes files"}).input(h.default.tuple([h.default.array(h.default.string()).optional().default([]).describe("specific files to format"),h.default.object({unsafe:h.default.boolean().optional().describe("apply unsafe fixes")})])).mutation(({input:e})=>{let[t,s]=e;ge(t,{unsafe:s.unsafe})})}),un=(0,fe.createCli)({router:ln,name:"ultracite",version:j.version,description:"Ship code faster and with more confidence."});process.env.VITEST||un.run()});cs();
|
|
133
|
+
`;return t},zs=async()=>{try{let e=(0,me.parse)(await(0,y.readFile)("./package.json","utf-8"));return e?e.type==="module":!1}catch{return!1}},Ts=async()=>{let e=(0,me.parse)(await(0,y.readFile)("./package.json","utf-8"));e&&(e["lint-staged"]?e["lint-staged"]=(0,N.default)(e["lint-staged"],k):e["lint-staged"]=k,await(0,y.writeFile)("./package.json",JSON.stringify(e,null,2)))},Ws=async e=>{let t=await(0,y.readFile)(e,"utf-8"),s=(0,me.parse)(t);if(!s)return;let n=(0,N.default)(s,k);await(0,y.writeFile)(e,JSON.stringify(n,null,2))},Ls=async e=>{let t=await(0,y.readFile)(e,"utf-8"),s=Es(t);if(!s)return;let n=(0,N.default)(s,k);await(0,y.writeFile)(e,Ns(n))},_s=async e=>{let n=(await import((0,ps.pathToFileURL)(e).href)).default||{},o=(0,N.default)(n,k),r=`export default ${JSON.stringify(o,null,2)};
|
|
134
|
+
`;await(0,y.writeFile)(e,r)},qs=async e=>{delete require.cache[require.resolve(`./${e}`)];let t=Js(`./${e}`),s=(0,N.default)(t,k),n=`module.exports = ${JSON.stringify(s,null,2)};
|
|
135
|
+
`;await(0,y.writeFile)(e,n)},Qe=async()=>{await(0,y.writeFile)(".lintstagedrc.json",JSON.stringify(k,null,2))},Bs=async e=>{if(e==="./package.json"){await Ts();return}if(e.endsWith(".json")||e==="./.lintstagedrc"){await Ws(e);return}if(e.endsWith(".yaml")||e.endsWith(".yml")){await Ls(e);return}let t=await zs();if(e.endsWith(".mjs")||e.endsWith(".js")&&t){try{await _s(e)}catch{await Qe()}return}if(e.endsWith(".cjs")||e.endsWith(".js")&&!t)try{await qs(e)}catch{await Qe()}},z={exists:async()=>{for(let e of us)if(await i(e))return!0;return!1},install:e=>{(0,ds.execSync)(`${e} -D lint-staged`)},create:async()=>{await(0,y.writeFile)(".lintstagedrc.json",JSON.stringify(k,null,2))},update:async()=>{let e=null;for(let t of us)if(await i(t)){e=t;break}if(!e){await Qe();return}await Bs(e)}}});var cs={};p(cs,{initialize:()=>et});var fs,w,gs,c,ms,Hs,Vs,Ks,Gs,Ys,Zs,Xs,Qs,en,tn,sn,nn,on,rn,an,cn,ln,un,et,Xe=u(()=>{"use strict";fs=require("child_process"),w=require("fs/promises"),gs=b(require("process")),c=require("@clack/prompts");ne();be();ke();je();Se();Pe();Fe();$e();Oe();Ze();Ee();ze();We();Le();qe();Be();Ve();Ge();Ke();ms=x.devDependencies["@biomejs/biome"],Hs=x.version,Vs=async(e,t=!0)=>{let s=(0,c.spinner)();if(s.start("Installing dependencies..."),t)(0,fs.execSync)(`${e} -D -E ultracite @biomejs/biome@${ms}`);else{let n=await(0,w.readFile)("package.json","utf8"),o=JSON.parse(n),r={...o,devDependencies:{...o.devDependencies,"@biomejs/biome":ms,ultracite:`^${Hs}`}};await(0,w.writeFile)("package.json",JSON.stringify(r,null,2))}s.stop("Dependencies installed.")},Ks=async()=>{let e=(0,c.spinner)();if(e.start("Checking for tsconfig.json..."),await G.exists()){e.message("tsconfig.json found, updating..."),await G.update(),e.stop("tsconfig.json updated.");return}e.message("tsconfig.json not found, creating..."),await G.create(),e.stop("tsconfig.json created.")},Gs=async()=>{let e=(0,c.spinner)();if(e.start("Checking for .vscode/settings.json..."),await Z.exists()){e.message("settings.json found, updating..."),await Z.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await Z.create(),e.stop("settings.json created.")},Ys=async()=>{let e=(0,c.spinner)();if(e.start("Checking for .zed/settings.json..."),await Q.exists()){e.message("settings.json found, updating..."),await Q.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await Q.create(),e.stop("settings.json created.")},Zs=async()=>{let e=(0,c.spinner)();if(e.start("Checking for Biome configuration..."),await L.exists()){e.message("Biome configuration found, updating..."),await L.update(),e.stop("Biome configuration updated.");return}e.message("Biome configuration not found, creating..."),await L.create(),e.stop("Biome configuration created.")},Xs=async(e,t=!0)=>{let s=(0,c.spinner)();if(s.start("Initializing pre-commit hooks..."),s.message("Installing Husky..."),t)F.install(e);else{let n=await(0,w.readFile)("package.json","utf8"),o=JSON.parse(n),r={...o,devDependencies:{...o.devDependencies,husky:"latest"}};await(0,w.writeFile)("package.json",JSON.stringify(r,null,2))}if(await F.exists()){s.message("Pre-commit hook found, updating..."),await F.update(),s.stop("Pre-commit hook updated.");return}s.message("Pre-commit hook not found, creating..."),await F.create(),s.stop("Pre-commit hook created.")},Qs=async(e,t=!0)=>{let s=(0,c.spinner)();if(s.start("Initializing lefthook..."),s.message("Installing lefthook..."),t)I.install(e);else{let n=await(0,w.readFile)("package.json","utf8"),o=JSON.parse(n),r={...o,devDependencies:{...o.devDependencies,lefthook:"latest"}};await(0,w.writeFile)("package.json",JSON.stringify(r,null,2))}if(await I.exists()){s.message("lefthook.yml found, updating..."),await I.update(),s.stop("lefthook.yml updated.");return}s.message("lefthook.yml not found, creating..."),await I.create(),s.stop("lefthook.yml created.")},en=async(e,t=!0)=>{let s=(0,c.spinner)();if(s.start("Initializing lint-staged..."),s.message("Installing lint-staged..."),t)z.install(e);else{let n=await(0,w.readFile)("package.json","utf8"),o=JSON.parse(n),r={...o,devDependencies:{...o.devDependencies,"lint-staged":"latest"}};await(0,w.writeFile)("package.json",JSON.stringify(r,null,2))}if(await z.exists()){s.message("lint-staged found, updating..."),await z.update(),s.stop("lint-staged updated.");return}s.message("lint-staged not found, creating..."),await z.create(),s.stop("lint-staged created.")},tn=async()=>{let e=(0,c.spinner)();if(e.start("Checking for GitHub Copilot rules..."),await Y.exists()){e.message("GitHub Copilot rules found, updating..."),await Y.update(),e.stop("GitHub Copilot rules updated.");return}e.message("GitHub Copilot rules not found, creating..."),await Y.create(),e.stop("GitHub Copilot rules created.")},sn=async()=>{let e=(0,c.spinner)();if(e.start("Checking for Cursor rules..."),await B.exists()){e.message("Cursor rules found, updating..."),await B.update(),e.stop("Cursor rules updated.");return}e.message("Cursor rules not found, creating..."),await B.create(),e.stop("Cursor rules created.")},nn=async()=>{let e=(0,c.spinner)();if(e.start("Checking for Windsurf rules..."),await X.exists()){e.message("Windsurf rules found, updating..."),await X.update(),e.stop("Windsurf rules updated.");return}e.message("Windsurf rules not found, creating..."),await X.create(),e.stop("Windsurf rules created.")},on=async()=>{let e=(0,c.spinner)();if(e.start("Checking for Zed rules..."),await ee.exists()){e.message("Zed rules found, updating..."),await ee.update(),e.stop("Zed rules updated.");return}e.message("Zed rules not found, creating..."),await ee.create(),e.stop("Zed rules created.")},rn=async()=>{let e=(0,c.spinner)();if(e.start("Checking for Claude Code rules..."),await _.exists()){e.message("Claude Code rules found, updating..."),await _.update(),e.stop("Claude Code rules updated.");return}e.message("Claude Code rules not found, creating..."),await _.create(),e.stop("Claude Code rules created.")},an=async()=>{let e=(0,c.spinner)();if(e.start("Checking for OpenAI Codex rules..."),await q.exists()){e.message("OpenAI Codex rules found, updating..."),await q.update(),e.stop("OpenAI Codex rules updated.");return}e.message("OpenAI Codex rules not found, creating..."),await q.create(),e.stop("OpenAI Codex rules created.")},cn=async e=>{let t=(0,c.spinner)();t.start("Removing Prettier dependencies and configuration...");try{let s=await le.remove(e);s.packagesRemoved.length>0&&t.message(`Removed Prettier packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&t.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&t.message("Cleaned VS Code settings"),t.stop("Prettier removed successfully.")}catch{t.stop("Failed to remove Prettier completely, but continuing...")}},ln=async e=>{let t=(0,c.spinner)();t.start("Removing ESLint dependencies and configuration...");try{let s=await ie.remove(e);s.packagesRemoved.length>0&&t.message(`Removed ESLint packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&t.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&t.message("Cleaned VS Code settings"),t.stop("ESLint removed successfully.")}catch{t.stop("Failed to remove ESLint completely, but continuing...")}},un=async e=>{if(e){let n=O.options.find(r=>r.label===e);if(!n)throw new Error(`Unsupported package manager: ${e}`);return await O.isMonorepo()&&n.monorepoSuffix?`${n.value} ${n.monorepoSuffix}`:n.value}let t=await O.get();if(t)return c.log.info(`Detected lockfile, using ${t}`),t;let s=await O.select();if(!s)throw new Error("No package manager selected");return s},et=async e=>{(0,c.intro)(Te);try{let t=e??{},s=await un(t.pm),n=t.removePrettier,o=t.removeEslint;if(n===void 0||o===void 0){let f=[];if(n===void 0&&await le.hasPrettier()&&f.push({label:"Remove Prettier (dependencies, config files, VS Code settings)",value:"prettier"}),o===void 0&&await ie.hasESLint()&&f.push({label:"Remove ESLint (dependencies, config files, VS Code settings)",value:"eslint"}),f.length>0){let te=await(0,c.multiselect)({message:"Remove existing formatters/linters (recommended for clean migration)?",options:f,required:!1});n===void 0&&(n=te.includes("prettier")),o===void 0&&(o=te.includes("eslint"))}}let r=t.editors;r||(r=await(0,c.multiselect)({message:"Which editors do you want to configure (recommended)?",options:[{label:"VSCode / Cursor / Windsurf",value:"vscode"},{label:"Zed",value:"zed"}],required:!1}));let l=t.rules;l||(l=await(0,c.multiselect)({message:"Which editor rules do you want to enable (optional)?",options:[{label:"GitHub Copilot (VSCode)",value:"vscode-copilot"},{label:"Cursor",value:"cursor"},{label:"Windsurf",value:"windsurf"},{label:"Zed",value:"zed"},{label:"Claude Code",value:"claude"},{label:"OpenAI Codex",value:"codex"}],required:!1}));let a=t.features;a===void 0&&(t.pm||t.editors||t.rules||t.removePrettier!==void 0||t.removeEslint!==void 0?a=[]:a=await(0,c.multiselect)({message:"Would you like any of the following (optional)?",options:[{label:"Husky pre-commit hook",value:"husky"},{label:"Lefthook pre-commit hook",value:"lefthook"},{label:"Lint-staged",value:"lint-staged"}],required:!1})),n&&await cn(s),o&&await ln(s),await Vs(s,!t.skipInstall),await Ks(),await Zs(),r?.includes("vscode")&&await Gs(),r?.includes("zed")&&await Ys(),l?.includes("vscode-copilot")&&await tn(),l?.includes("cursor")&&await sn(),l?.includes("windsurf")&&await nn(),l?.includes("zed")&&await on(),l?.includes("claude")&&await rn(),l?.includes("codex")&&await an(),a?.includes("husky")&&await Xs(s,!t.skipInstall),a?.includes("lefthook")&&await Qs(s,!t.skipInstall),a?.includes("lint-staged")&&await en(s,!t.skipInstall),c.log.success("Successfully initialized Ultracite configuration!")}catch(t){let s=t instanceof Error?t.message:"Unknown error";c.log.error(`Failed to initialize Ultracite configuration: ${s}`),gs.default.exit(1)}}});var Us={};var ge,h,fe,dn,pn,ls=u(()=>{ge=require("trpc-cli"),h=b(require("zod"));ne();ye();Xe();Je();fe=ge.trpcServer.initTRPC.meta().create(),dn=fe.router({init:fe.procedure.meta({description:"Initialize Ultracite in the current directory"}).input(h.default.object({pm:h.default.enum(["pnpm","bun","yarn","npm"]).optional().describe("Package manager to use"),editors:h.default.array(h.default.enum(["vscode","zed"])).optional().describe("Editors to configure"),rules:h.default.array(h.default.enum(["vscode-copilot","cursor","windsurf","zed","claude","codex"])).optional().describe("Editor rules to enable"),features:h.default.array(h.default.enum(["husky","lefthook","lint-staged"])).optional().describe("Additional features to enable"),removePrettier:h.default.boolean().optional().describe("Remove Prettier dependencies and configuration"),removeEslint:h.default.boolean().optional().describe("Remove ESLint dependencies and configuration"),skipInstall:h.default.boolean().default(!1).describe("Skip installing dependencies")})).mutation(async({input:e})=>{await et(e)}),lint:fe.procedure.meta({description:"Run Biome linter without fixing files"}).input(h.default.array(h.default.string()).optional().default([]).describe("specific files to lint")).query(({input:e})=>{Ue(e)}),format:fe.procedure.meta({description:"Run Biome linter and fixes files"}).input(h.default.tuple([h.default.array(h.default.string()).optional().default([]).describe("specific files to format"),h.default.object({unsafe:h.default.boolean().optional().describe("apply unsafe fixes")})])).mutation(({input:e})=>{let[t,s]=e;he(t,{unsafe:s.unsafe})})}),pn=(0,ge.createCli)({router:dn,name:"ultracite",version:x.version,description:"Ship code faster and with more confidence."});process.env.VITEST||pn.run()});ls();
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var X=Object.defineProperty;var Yt=Object.getOwnPropertyDescriptor;var Zt=Object.getOwnPropertyNames;var Xt=Object.prototype.hasOwnProperty;var Q=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,s)=>(typeof require<"u"?require:t)[s]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Je=e=>t=>{var s=e[t];if(s)return s();throw new Error("Module not found in bundle: "+t)};var l=(e,t)=>()=>(e&&(t=e(e=0)),t);var d=(e,t)=>{for(var s in t)X(e,s,{get:t[s],enumerable:!0})},Qt=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Zt(t))!Xt.call(e,o)&&o!==s&&X(e,o,{get:()=>t[o],enumerable:!(n=Yt(t,o))||n.enumerable});return e};var u=e=>Qt(X({},"__esModule",{value:!0}),e);var v,N=l(()=>{v={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"5.1.0",bin:{ultracite:"dist/index.js"},files:["biome.jsonc","dist"],scripts:{build:"tsup",test:"vitest run","test:coverage":"vitest --coverage"},main:"./biome.jsonc",author:"Hayden Bleasel <hello@haydenbleasel.com>",bugs:{url:"https://github.com/haydenbleasel/ultracite/issues"},homepage:"https://github.com/haydenbleasel/ultracite#readme",keywords:["ultracite","biome","linter","formatter","fixer"],license:"MIT",publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},repository:{type:"git",url:"git+https://github.com/haydenbleasel/ultracite.git"},devDependencies:{"@auto-it/all-contributors":"^11.3.0","@auto-it/first-time-contributor":"^11.3.0","@biomejs/biome":"2.1.2","@types/node":"^24.0.14","@vitest/coverage-v8":"3.2.4",tsup:"^8.5.0"},dependencies:{"@clack/prompts":"^0.11.0",deepmerge:"^4.3.1","jsonc-parser":"^3.3.1","trpc-cli":"^0.10.0",vitest:"^3.2.4",zod:"^4.0.5"},packageManager:"pnpm@10.13.1"}});var Te={};d(Te,{format:()=>ee});import{execSync as ts}from"child_process";import ss from"process";var ee,te=l(()=>{"use strict";ee=(e,t={})=>{try{let s=e.length>0?e.map(o=>`"${o}"`).join(" "):"./",n=t.unsafe?" --unsafe":"";ts(`npx @biomejs/biome check --write${n} ${s}`,{stdio:"inherit"})}catch(s){let n=s instanceof Error?s.message:"Unknown error";console.error("Failed to run Ultracite:",n),ss.exit(1)}}});var Ne={};d(Ne,{exists:()=>i,isMonorepo:()=>R});import{access as ns,readFile as os}from"fs/promises";import{parse as is}from"jsonc-parser";var i,R,f=l(()=>{"use strict";i=async e=>{try{return await ns(e),!0}catch{return!1}},R=async()=>{if(await i("pnpm-workspace.yaml"))return!0;try{let e=is(await os("package.json","utf-8"));return e?!!e.workspaces:!1}catch{return!1}}});var _e={};d(_e,{biome:()=>P});import{readFile as rs,writeFile as We}from"fs/promises";import as from"deepmerge";import{parse as cs}from"jsonc-parser";var ls,Le,se,P,ne=l(()=>{"use strict";f();N();ls=v.devDependencies["@biomejs/biome"],Le={$schema:`https://biomejs.dev/schemas/${ls}/schema.json`,extends:["ultracite"]},se=async()=>await i("./biome.json")?"./biome.json":"./biome.jsonc",P={exists:async()=>{let e=await se();return i(e)},create:async()=>{let e=await se();return We(e,JSON.stringify(Le,null,2))},update:async()=>{let e=await se(),t=await rs(e,"utf-8"),n=cs(t)||{},o=n.extends&&Array.isArray(n.extends)?n.extends:[];o.includes("ultracite")||(n.extends=[...o,"ultracite"]);let r={$schema:Le.$schema},c=as(n,r);await We(e,JSON.stringify(c,null,2))}}});var qe,Be,He,Ke,Ve,Ge,Ye,Ze,qn,p,y=l(()=>{"use strict";qe=["Don't use `accessKey` attribute on any HTML element.",'Don\'t set `aria-hidden="true"` on focusable elements.',"Don't add ARIA roles, states, and properties to elements that don't support them.","Don't use distracting elements like `<marquee>` or `<blink>`.","Only use the `scope` prop on `<th>` elements.","Don't assign non-interactive ARIA roles to interactive HTML elements.","Make sure label elements have text content and are associated with an input.","Don't assign interactive ARIA roles to non-interactive HTML elements.","Don't assign `tabIndex` to non-interactive HTML elements.","Don't use positive integers for `tabIndex` property.",`Don't include "image", "picture", or "photo" in img alt prop.`,"Don't use explicit role property that's the same as the implicit/default role.","Make static elements with click handlers use a valid role attribute.","Always include a `title` element for SVG elements.","Give all elements requiring alt text meaningful information for screen readers.","Make sure anchors have content that's accessible to screen readers.","Assign `tabIndex` to non-interactive HTML elements with `aria-activedescendant`.","Include all required ARIA attributes for elements with ARIA roles.","Make sure ARIA properties are valid for the element's supported roles.","Always include a `type` attribute for button elements.","Make elements with interactive roles and handlers focusable.","Give heading elements content that's accessible to screen readers (not hidden with `aria-hidden`).","Always include a `lang` attribute on the html element.","Always include a `title` attribute for iframe elements.","Accompany `onClick` with at least one of: `onKeyUp`, `onKeyDown`, or `onKeyPress`.","Accompany `onMouseOver`/`onMouseOut` with `onFocus`/`onBlur`.","Include caption tracks for audio and video elements.","Use semantic elements instead of role attributes in JSX.","Make sure all anchors are valid and navigable.","Ensure all ARIA properties (`aria-*`) are valid.","Use valid, non-abstract ARIA roles for elements with ARIA roles.","Use valid ARIA state and property values.","Use valid values for the `autocomplete` attribute on input elements.","Use correct ISO language/country codes for the `lang` attribute."],Be=["Don't use consecutive spaces in regular expression literals.","Don't use the `arguments` object.","Don't use primitive type aliases or misleading types.","Don't use the comma operator.","Don't use empty type parameters in type aliases and interfaces.","Don't write functions that exceed a given Cognitive Complexity score.","Don't nest describe() blocks too deeply in test files.","Don't use unnecessary boolean casts.","Don't use unnecessary callbacks with flatMap.","Use for...of statements instead of Array.forEach.","Don't create classes that only have static members (like a static namespace).","Don't use this and super in static contexts.","Don't use unnecessary catch clauses.","Don't use unnecessary constructors.","Don't use unnecessary continue statements.","Don't export empty modules that don't change anything.","Don't use unnecessary escape sequences in regular expression literals.","Don't use unnecessary fragments.","Don't use unnecessary labels.","Don't use unnecessary nested block statements.","Don't rename imports, exports, and destructured assignments to the same name.","Don't use unnecessary string or template literal concatenation.","Don't use String.raw in template literals when there are no escape sequences.","Don't use useless case statements in switch statements.","Don't use ternary operators when simpler alternatives exist.","Don't use useless `this` aliasing.","Don't use any or unknown as type constraints.","Don't initialize variables to undefined.","Don't use the void operators (they're not familiar).","Use arrow functions instead of function expressions.","Use Date.now() to get milliseconds since the Unix Epoch.","Use .flatMap() instead of map().flat() when possible.","Use literal property access instead of computed property access.","Don't use parseInt() or Number.parseInt() when binary, octal, or hexadecimal literals work.","Use concise optional chaining instead of chained logical expressions.","Use regular expression literals instead of the RegExp constructor when possible.","Don't use number literal object member names that aren't base 10 or use underscore separators.","Remove redundant terms from logical expressions.","Use while loops instead of for loops when you don't need initializer and update expressions.","Don't pass children as props.","Don't reassign const variables.","Don't use constant expressions in conditions.","Don't use `Math.min` and `Math.max` to clamp values when the result is constant.","Don't return a value from a constructor.","Don't use empty character classes in regular expression literals.","Don't use empty destructuring patterns.","Don't call global object properties as functions.","Don't declare functions and vars that are accessible outside their block.","Make sure builtins are correctly instantiated.","Don't use super() incorrectly inside classes. Also check that super() is called in classes that extend other constructors.","Don't use variables and function parameters before they're declared.","Don't use 8 and 9 escape sequences in string literals.","Don't use literal numbers that lose precision."],He=["Don't use the return value of React.render.","Make sure all dependencies are correctly specified in React hooks.","Make sure all React hooks are called from the top level of component functions.","Don't forget key props in iterators and collection literals.","Don't destructure props inside JSX components in Solid projects.","Don't define React components inside other components.","Don't use event handlers on non-interactive elements.","Don't assign to React component props.","Don't use both `children` and `dangerouslySetInnerHTML` props on the same element.","Don't use dangerous JSX props.","Don't use Array index in keys.","Don't insert comments as text nodes.","Don't assign JSX properties multiple times.","Don't add extra closing tags for components without children.","Use `<>...</>` instead of `<Fragment>...</Fragment>`.",'Watch out for possible "wrong" semicolons inside JSX elements.'],Ke=["Don't assign a value to itself.","Don't return a value from a setter.","Don't compare expressions that modify string case with non-compliant values.","Don't use lexical declarations in switch clauses.","Don't use variables that haven't been declared in the document.","Don't write unreachable code.","Make sure super() is called exactly once on every code path in a class constructor before this is accessed if the class has a superclass.","Don't use control flow statements in finally blocks.","Don't use optional chaining where undefined values aren't allowed.","Don't have unused function parameters.","Don't have unused imports.","Don't have unused labels.","Don't have unused private class members.","Don't have unused variables.","Make sure void (self-closing) elements don't have children.","Don't return a value from a function with the return type 'void'","Use isNaN() when checking for NaN.",'Make sure "for" loop update clauses move the counter in the right direction.',"Make sure typeof expressions are compared to valid values.","Make sure generator functions contain yield.","Don't use await inside loops.","Don't use bitwise operators.","Don't use expressions where the operation doesn't change the value.","Make sure Promise-like statements are handled appropriately.","Don't use __dirname and __filename in the global scope.","Prevent import cycles.","Don't use configured elements.","Don't hardcode sensitive data like API keys and tokens.","Don't let variable declarations shadow variables from outer scopes.","Don't use the TypeScript directive @ts-ignore.","Prevent duplicate polyfills from Polyfill.io.","Don't use useless backreferences in regular expressions that always match empty strings.","Don't use unnecessary escapes in string literals.","Don't use useless undefined.","Make sure getters and setters for the same property are next to each other in class and object definitions.","Make sure object literals are declared consistently (defaults to explicit definitions).","Use static Response methods instead of new Response() constructor when possible.","Make sure switch-case statements are exhaustive.","Make sure the `preconnect` attribute is used when using Google Fonts.","Use `Array#{indexOf,lastIndexOf}()` instead of `Array#{findIndex,findLastIndex}()` when looking for the index of an item.","Make sure iterable callbacks return consistent values.",'Use `with { type: "json" }` for JSON module imports.',"Use numeric separators in numeric literals.","Use object spread instead of `Object.assign()` when constructing new objects.","Always use the radix argument when using `parseInt()`.","Make sure JSDoc comment lines start with a single asterisk, except for the first one.","Include a description parameter for `Symbol()`.","Don't use spread (`...`) syntax on accumulators.","Don't use the `delete` operator.","Don't access namespace imports dynamically.","Don't use namespace imports.","Declare regex literals at the top level.",'Don\'t use `target="_blank"` without `rel="noopener"`.'],Ve=["Don't use TypeScript enums.","Don't export imported variables.","Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions.","Don't use TypeScript namespaces.","Don't use non-null assertions with the `!` postfix operator.","Don't use parameter properties in class constructors.","Don't use user-defined types.","Use `as const` instead of literal types and type annotations.","Use either `T[]` or `Array<T>` consistently.","Initialize each enum member value explicitly.","Use `export type` for types.","Use `import type` for types.","Make sure all enum members are literal values.","Don't use TypeScript const enum.","Don't declare empty interfaces.","Don't let variables evolve into any type through reassignments.","Don't use the any type.","Don't misuse the non-null assertion operator (!) in TypeScript files.","Don't use implicit any type on variable declarations.","Don't merge interfaces and classes unsafely.","Don't use overload signatures that aren't next to each other.","Use the namespace keyword instead of the module keyword to declare TypeScript namespaces."],Ge=["Don't use global `eval()`.","Don't use callbacks in asynchronous tests and hooks.","Don't use negation in `if` statements that have `else` clauses.","Don't use nested ternary expressions.","Don't reassign function parameters.","This rule lets you specify global variable names you don't want to use in your application.","Don't use specified modules when loaded by import or require.","Don't use constants whose value is the upper-case version of their name.","Use `String.slice()` instead of `String.substr()` and `String.substring()`.","Don't use template literals if you don't need interpolation or special-character handling.","Don't use `else` blocks when the `if` block breaks early.","Don't use yoda expressions.","Don't use Array constructors.","Use `at()` instead of integer index access.","Follow curly brace conventions.","Use `else if` instead of nested `if` statements in `else` clauses.","Use single `if` statements instead of nested `if` clauses.","Use `new` for all builtins except `String`, `Number`, and `Boolean`.","Use consistent accessibility modifiers on class properties and methods.","Use `const` declarations for variables that are only assigned once.","Put default function parameters and optional function parameters last.","Include a `default` clause in switch statements.","Use the `**` operator instead of `Math.pow`.","Use `for-of` loops when you need the index to extract an item from the iterated array.","Use `node:assert/strict` over `node:assert`.","Use the `node:` protocol for Node.js builtin modules.","Use Number properties instead of global ones.","Use assignment operator shorthand where possible.","Use function types instead of object types with call signatures.","Use template literals over string concatenation.","Use `new` when throwing an error.","Don't throw non-Error values.","Use `String.trimStart()` and `String.trimEnd()` over `String.trimLeft()` and `String.trimRight()`.","Use standard constants instead of approximated literals.","Don't assign values in expressions.","Don't use async functions as Promise executors.","Don't reassign exceptions in catch clauses.","Don't reassign class members.","Don't compare against -0.","Don't use labeled statements that aren't loops.","Don't use void type outside of generic or return types.","Don't use console.","Don't use control characters and escape sequences that match control characters in regular expression literals.","Don't use debugger.","Don't assign directly to document.cookie.","Use `===` and `!==`.","Don't use duplicate case labels.","Don't use duplicate class members.","Don't use duplicate conditions in if-else-if chains.","Don't use two keys with the same name inside objects.","Don't use duplicate function parameter names.","Don't have duplicate hooks in describe blocks.","Don't use empty block statements and static blocks.","Don't let switch clauses fall through.","Don't reassign function declarations.","Don't allow assignments to native objects and read-only global variables.","Use Number.isFinite instead of global isFinite.","Use Number.isNaN instead of global isNaN.","Don't assign to imported bindings.","Don't use irregular whitespace characters.","Don't use labels that share a name with a variable.","Don't use characters made with multiple code points in character class syntax.","Make sure to use new and constructor properly.","Don't use shorthand assign when the variable appears on both sides.","Don't use octal escape sequences in string literals.","Don't use Object.prototype builtins directly.","Don't redeclare variables, functions, classes, and types in the same scope.",`Don't have redundant "use strict".`,"Don't compare things where both sides are exactly the same.","Don't let identifiers shadow restricted names.","Don't use sparse arrays (arrays with holes).","Don't use template literal placeholder syntax in regular strings.","Don't use the then property.","Don't use unsafe negation.","Don't use var.","Don't use with statements in non-strict contexts.","Make sure async functions actually use await.","Make sure default clauses in switch statements come last.","Make sure to pass a message value when creating a built-in error.","Make sure get methods always return a value.","Use a recommended display strategy with Google Fonts.","Make sure for-in loops include an if statement.","Use Array.isArray() instead of instanceof Array.","Make sure to use the digits argument with Number#toFixed().",'Make sure to use the "use strict" directive in script files.'],Ye=["Don't use `<img>` elements in Next.js projects.","Don't use `<head>` elements in Next.js projects.","Don't import next/document outside of pages/_document.jsx in Next.js projects.","Don't use the next/head module in pages/_document.js on Next.js projects."],Ze=["Don't use export or module.exports in test files.","Don't use focused tests.","Make sure the assertion function, like expect, is placed inside an it() function call.","Don't use disabled tests."],qn=[...qe,...Be,...He,...Ke,...Ve,...Ge,...Ye,...Ze],p=`# Project Context
|
|
2
|
+
var ee=Object.defineProperty;var Qt=Object.getOwnPropertyDescriptor;var es=Object.getOwnPropertyNames;var ts=Object.prototype.hasOwnProperty;var te=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,s)=>(typeof require<"u"?require:t)[s]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Te=e=>t=>{var s=e[t];if(s)return s();throw new Error("Module not found in bundle: "+t)};var l=(e,t)=>()=>(e&&(t=e(e=0)),t);var d=(e,t)=>{for(var s in t)ee(e,s,{get:t[s],enumerable:!0})},ss=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of es(t))!ts.call(e,o)&&o!==s&&ee(e,o,{get:()=>t[o],enumerable:!(n=Qt(t,o))||n.enumerable});return e};var u=e=>ss(ee({},"__esModule",{value:!0}),e);var b,T=l(()=>{b={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"5.1.2",bin:{ultracite:"dist/index.js"},files:["biome.jsonc","dist"],scripts:{build:"tsup",test:"vitest run","test:coverage":"vitest --coverage"},main:"./biome.jsonc",author:"Hayden Bleasel <hello@haydenbleasel.com>",bugs:{url:"https://github.com/haydenbleasel/ultracite/issues"},homepage:"https://github.com/haydenbleasel/ultracite#readme",keywords:["ultracite","biome","linter","formatter","fixer"],license:"MIT",publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},repository:{type:"git",url:"git+https://github.com/haydenbleasel/ultracite.git"},devDependencies:{"@auto-it/all-contributors":"^11.3.0","@auto-it/first-time-contributor":"^11.3.0","@biomejs/biome":"2.2.0","@types/node":"^24.0.14","@vitest/coverage-v8":"3.2.4",tsup:"^8.5.0"},dependencies:{"@clack/prompts":"^0.11.0",deepmerge:"^4.3.1","jsonc-parser":"^3.3.1","trpc-cli":"^0.10.0",vitest:"^3.2.4",zod:"^4.0.5"},packageManager:"pnpm@10.13.1"}});var We={};d(We,{format:()=>se});import{execSync as os}from"child_process";import is from"process";var se,ne=l(()=>{"use strict";se=(e,t={})=>{try{let s=e.length>0?e.map(o=>`"${o}"`).join(" "):"./",n=t.unsafe?" --unsafe":"";os(`npx @biomejs/biome check --write${n} ${s}`,{stdio:"inherit"})}catch(s){let n=s instanceof Error?s.message:"Unknown error";console.error("Failed to run Ultracite:",n),is.exit(1)}}});var Le={};d(Le,{exists:()=>i,isMonorepo:()=>R});import{access as rs,readFile as as}from"fs/promises";import{parse as cs}from"jsonc-parser";var i,R,f=l(()=>{"use strict";i=async e=>{try{return await rs(e),!0}catch{return!1}},R=async()=>{if(await i("pnpm-workspace.yaml"))return!0;try{let e=cs(await as("package.json","utf-8"));return e?!!e.workspaces:!1}catch{return!1}}});var Be={};d(Be,{biome:()=>P});import{readFile as ls,writeFile as _e}from"fs/promises";import us from"deepmerge";import{parse as ds}from"jsonc-parser";var ps,qe,oe,P,ie=l(()=>{"use strict";f();T();ps=b.devDependencies["@biomejs/biome"],qe={$schema:`https://biomejs.dev/schemas/${ps}/schema.json`,extends:["ultracite"]},oe=async()=>await i("./biome.json")?"./biome.json":"./biome.jsonc",P={exists:async()=>{let e=await oe();return i(e)},create:async()=>{let e=await oe();return _e(e,JSON.stringify(qe,null,2))},update:async()=>{let e=await oe(),t=await ls(e,"utf-8"),n=ds(t)||{},o=n.extends&&Array.isArray(n.extends)?n.extends:[];o.includes("ultracite")||(n.extends=[...o,"ultracite"]);let r={$schema:qe.$schema},c=us(n,r);await _e(e,JSON.stringify(c,null,2))}}});var He,Ve,Ke,Ge,Ye,Ze,Xe,Qe,Vn,p,y=l(()=>{"use strict";He=["Don't use `accessKey` attribute on any HTML element.",'Don\'t set `aria-hidden="true"` on focusable elements.',"Don't add ARIA roles, states, and properties to elements that don't support them.","Don't use distracting elements like `<marquee>` or `<blink>`.","Only use the `scope` prop on `<th>` elements.","Don't assign non-interactive ARIA roles to interactive HTML elements.","Make sure label elements have text content and are associated with an input.","Don't assign interactive ARIA roles to non-interactive HTML elements.","Don't assign `tabIndex` to non-interactive HTML elements.","Don't use positive integers for `tabIndex` property.",`Don't include "image", "picture", or "photo" in img alt prop.`,"Don't use explicit role property that's the same as the implicit/default role.","Make static elements with click handlers use a valid role attribute.","Always include a `title` element for SVG elements.","Give all elements requiring alt text meaningful information for screen readers.","Make sure anchors have content that's accessible to screen readers.","Assign `tabIndex` to non-interactive HTML elements with `aria-activedescendant`.","Include all required ARIA attributes for elements with ARIA roles.","Make sure ARIA properties are valid for the element's supported roles.","Always include a `type` attribute for button elements.","Make elements with interactive roles and handlers focusable.","Give heading elements content that's accessible to screen readers (not hidden with `aria-hidden`).","Always include a `lang` attribute on the html element.","Always include a `title` attribute for iframe elements.","Accompany `onClick` with at least one of: `onKeyUp`, `onKeyDown`, or `onKeyPress`.","Accompany `onMouseOver`/`onMouseOut` with `onFocus`/`onBlur`.","Include caption tracks for audio and video elements.","Use semantic elements instead of role attributes in JSX.","Make sure all anchors are valid and navigable.","Ensure all ARIA properties (`aria-*`) are valid.","Use valid, non-abstract ARIA roles for elements with ARIA roles.","Use valid ARIA state and property values.","Use valid values for the `autocomplete` attribute on input elements.","Use correct ISO language/country codes for the `lang` attribute."],Ve=["Don't use consecutive spaces in regular expression literals.","Don't use the `arguments` object.","Don't use primitive type aliases or misleading types.","Don't use the comma operator.","Don't use empty type parameters in type aliases and interfaces.","Don't write functions that exceed a given Cognitive Complexity score.","Don't nest describe() blocks too deeply in test files.","Don't use unnecessary boolean casts.","Don't use unnecessary callbacks with flatMap.","Use for...of statements instead of Array.forEach.","Don't create classes that only have static members (like a static namespace).","Don't use this and super in static contexts.","Don't use unnecessary catch clauses.","Don't use unnecessary constructors.","Don't use unnecessary continue statements.","Don't export empty modules that don't change anything.","Don't use unnecessary escape sequences in regular expression literals.","Don't use unnecessary fragments.","Don't use unnecessary labels.","Don't use unnecessary nested block statements.","Don't rename imports, exports, and destructured assignments to the same name.","Don't use unnecessary string or template literal concatenation.","Don't use String.raw in template literals when there are no escape sequences.","Don't use useless case statements in switch statements.","Don't use ternary operators when simpler alternatives exist.","Don't use useless `this` aliasing.","Don't use any or unknown as type constraints.","Don't initialize variables to undefined.","Don't use the void operators (they're not familiar).","Use arrow functions instead of function expressions.","Use Date.now() to get milliseconds since the Unix Epoch.","Use .flatMap() instead of map().flat() when possible.","Use literal property access instead of computed property access.","Don't use parseInt() or Number.parseInt() when binary, octal, or hexadecimal literals work.","Use concise optional chaining instead of chained logical expressions.","Use regular expression literals instead of the RegExp constructor when possible.","Don't use number literal object member names that aren't base 10 or use underscore separators.","Remove redundant terms from logical expressions.","Use while loops instead of for loops when you don't need initializer and update expressions.","Don't pass children as props.","Don't reassign const variables.","Don't use constant expressions in conditions.","Don't use `Math.min` and `Math.max` to clamp values when the result is constant.","Don't return a value from a constructor.","Don't use empty character classes in regular expression literals.","Don't use empty destructuring patterns.","Don't call global object properties as functions.","Don't declare functions and vars that are accessible outside their block.","Make sure builtins are correctly instantiated.","Don't use super() incorrectly inside classes. Also check that super() is called in classes that extend other constructors.","Don't use variables and function parameters before they're declared.","Don't use 8 and 9 escape sequences in string literals.","Don't use literal numbers that lose precision."],Ke=["Don't use the return value of React.render.","Make sure all dependencies are correctly specified in React hooks.","Make sure all React hooks are called from the top level of component functions.","Don't forget key props in iterators and collection literals.","Don't destructure props inside JSX components in Solid projects.","Don't define React components inside other components.","Don't use event handlers on non-interactive elements.","Don't assign to React component props.","Don't use both `children` and `dangerouslySetInnerHTML` props on the same element.","Don't use dangerous JSX props.","Don't use Array index in keys.","Don't insert comments as text nodes.","Don't assign JSX properties multiple times.","Don't add extra closing tags for components without children.","Use `<>...</>` instead of `<Fragment>...</Fragment>`.",'Watch out for possible "wrong" semicolons inside JSX elements.'],Ge=["Don't assign a value to itself.","Don't return a value from a setter.","Don't compare expressions that modify string case with non-compliant values.","Don't use lexical declarations in switch clauses.","Don't use variables that haven't been declared in the document.","Don't write unreachable code.","Make sure super() is called exactly once on every code path in a class constructor before this is accessed if the class has a superclass.","Don't use control flow statements in finally blocks.","Don't use optional chaining where undefined values aren't allowed.","Don't have unused function parameters.","Don't have unused imports.","Don't have unused labels.","Don't have unused private class members.","Don't have unused variables.","Make sure void (self-closing) elements don't have children.","Don't return a value from a function with the return type 'void'","Use isNaN() when checking for NaN.",'Make sure "for" loop update clauses move the counter in the right direction.',"Make sure typeof expressions are compared to valid values.","Make sure generator functions contain yield.","Don't use await inside loops.","Don't use bitwise operators.","Don't use expressions where the operation doesn't change the value.","Make sure Promise-like statements are handled appropriately.","Don't use __dirname and __filename in the global scope.","Prevent import cycles.","Don't use configured elements.","Don't hardcode sensitive data like API keys and tokens.","Don't let variable declarations shadow variables from outer scopes.","Don't use the TypeScript directive @ts-ignore.","Prevent duplicate polyfills from Polyfill.io.","Don't use useless backreferences in regular expressions that always match empty strings.","Don't use unnecessary escapes in string literals.","Don't use useless undefined.","Make sure getters and setters for the same property are next to each other in class and object definitions.","Make sure object literals are declared consistently (defaults to explicit definitions).","Use static Response methods instead of new Response() constructor when possible.","Make sure switch-case statements are exhaustive.","Make sure the `preconnect` attribute is used when using Google Fonts.","Use `Array#{indexOf,lastIndexOf}()` instead of `Array#{findIndex,findLastIndex}()` when looking for the index of an item.","Make sure iterable callbacks return consistent values.",'Use `with { type: "json" }` for JSON module imports.',"Use numeric separators in numeric literals.","Use object spread instead of `Object.assign()` when constructing new objects.","Always use the radix argument when using `parseInt()`.","Make sure JSDoc comment lines start with a single asterisk, except for the first one.","Include a description parameter for `Symbol()`.","Don't use spread (`...`) syntax on accumulators.","Don't use the `delete` operator.","Don't access namespace imports dynamically.","Don't use namespace imports.","Declare regex literals at the top level.",'Don\'t use `target="_blank"` without `rel="noopener"`.'],Ye=["Don't use TypeScript enums.","Don't export imported variables.","Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions.","Don't use TypeScript namespaces.","Don't use non-null assertions with the `!` postfix operator.","Don't use parameter properties in class constructors.","Don't use user-defined types.","Use `as const` instead of literal types and type annotations.","Use either `T[]` or `Array<T>` consistently.","Initialize each enum member value explicitly.","Use `export type` for types.","Use `import type` for types.","Make sure all enum members are literal values.","Don't use TypeScript const enum.","Don't declare empty interfaces.","Don't let variables evolve into any type through reassignments.","Don't use the any type.","Don't misuse the non-null assertion operator (!) in TypeScript files.","Don't use implicit any type on variable declarations.","Don't merge interfaces and classes unsafely.","Don't use overload signatures that aren't next to each other.","Use the namespace keyword instead of the module keyword to declare TypeScript namespaces."],Ze=["Don't use global `eval()`.","Don't use callbacks in asynchronous tests and hooks.","Don't use negation in `if` statements that have `else` clauses.","Don't use nested ternary expressions.","Don't reassign function parameters.","This rule lets you specify global variable names you don't want to use in your application.","Don't use specified modules when loaded by import or require.","Don't use constants whose value is the upper-case version of their name.","Use `String.slice()` instead of `String.substr()` and `String.substring()`.","Don't use template literals if you don't need interpolation or special-character handling.","Don't use `else` blocks when the `if` block breaks early.","Don't use yoda expressions.","Don't use Array constructors.","Use `at()` instead of integer index access.","Follow curly brace conventions.","Use `else if` instead of nested `if` statements in `else` clauses.","Use single `if` statements instead of nested `if` clauses.","Use `new` for all builtins except `String`, `Number`, and `Boolean`.","Use consistent accessibility modifiers on class properties and methods.","Use `const` declarations for variables that are only assigned once.","Put default function parameters and optional function parameters last.","Include a `default` clause in switch statements.","Use the `**` operator instead of `Math.pow`.","Use `for-of` loops when you need the index to extract an item from the iterated array.","Use `node:assert/strict` over `node:assert`.","Use the `node:` protocol for Node.js builtin modules.","Use Number properties instead of global ones.","Use assignment operator shorthand where possible.","Use function types instead of object types with call signatures.","Use template literals over string concatenation.","Use `new` when throwing an error.","Don't throw non-Error values.","Use `String.trimStart()` and `String.trimEnd()` over `String.trimLeft()` and `String.trimRight()`.","Use standard constants instead of approximated literals.","Don't assign values in expressions.","Don't use async functions as Promise executors.","Don't reassign exceptions in catch clauses.","Don't reassign class members.","Don't compare against -0.","Don't use labeled statements that aren't loops.","Don't use void type outside of generic or return types.","Don't use console.","Don't use control characters and escape sequences that match control characters in regular expression literals.","Don't use debugger.","Don't assign directly to document.cookie.","Use `===` and `!==`.","Don't use duplicate case labels.","Don't use duplicate class members.","Don't use duplicate conditions in if-else-if chains.","Don't use two keys with the same name inside objects.","Don't use duplicate function parameter names.","Don't have duplicate hooks in describe blocks.","Don't use empty block statements and static blocks.","Don't let switch clauses fall through.","Don't reassign function declarations.","Don't allow assignments to native objects and read-only global variables.","Use Number.isFinite instead of global isFinite.","Use Number.isNaN instead of global isNaN.","Don't assign to imported bindings.","Don't use irregular whitespace characters.","Don't use labels that share a name with a variable.","Don't use characters made with multiple code points in character class syntax.","Make sure to use new and constructor properly.","Don't use shorthand assign when the variable appears on both sides.","Don't use octal escape sequences in string literals.","Don't use Object.prototype builtins directly.","Don't redeclare variables, functions, classes, and types in the same scope.",`Don't have redundant "use strict".`,"Don't compare things where both sides are exactly the same.","Don't let identifiers shadow restricted names.","Don't use sparse arrays (arrays with holes).","Don't use template literal placeholder syntax in regular strings.","Don't use the then property.","Don't use unsafe negation.","Don't use var.","Don't use with statements in non-strict contexts.","Make sure async functions actually use await.","Make sure default clauses in switch statements come last.","Make sure to pass a message value when creating a built-in error.","Make sure get methods always return a value.","Use a recommended display strategy with Google Fonts.","Make sure for-in loops include an if statement.","Use Array.isArray() instead of instanceof Array.","Make sure to use the digits argument with Number#toFixed().",'Make sure to use the "use strict" directive in script files.'],Xe=["Don't use `<img>` elements in Next.js projects.","Don't use `<head>` elements in Next.js projects.","Don't import next/document outside of pages/_document.jsx in Next.js projects.","Don't use the next/head module in pages/_document.js on Next.js projects."],Qe=["Don't use export or module.exports in test files.","Don't use focused tests.","Make sure the assertion function, like expect, is placed inside an it() function call.","Don't use disabled tests."],Vn=[...He,...Ve,...Ke,...Ge,...Ye,...Ze,...Xe,...Qe],p=`# Project Context
|
|
3
3
|
Ultracite enforces strict type safety, accessibility standards, and consistent code quality for JavaScript/TypeScript projects using Biome's lightning-fast formatter and linter.
|
|
4
4
|
|
|
5
5
|
## Key Principles
|
|
@@ -17,35 +17,35 @@ Ultracite enforces strict type safety, accessibility standards, and consistent c
|
|
|
17
17
|
## Rules
|
|
18
18
|
|
|
19
19
|
### Accessibility (a11y)
|
|
20
|
-
${
|
|
20
|
+
${He.map(e=>`- ${e}`).join(`
|
|
21
21
|
`)}
|
|
22
22
|
|
|
23
23
|
### Code Complexity and Quality
|
|
24
|
-
${
|
|
24
|
+
${Ve.map(e=>`- ${e}`).join(`
|
|
25
25
|
`)}
|
|
26
26
|
|
|
27
27
|
### React and JSX Best Practices
|
|
28
|
-
${
|
|
28
|
+
${Ke.map(e=>`- ${e}`).join(`
|
|
29
29
|
`)}
|
|
30
30
|
|
|
31
31
|
### Correctness and Safety
|
|
32
|
-
${
|
|
32
|
+
${Ge.map(e=>`- ${e}`).join(`
|
|
33
33
|
`)}
|
|
34
34
|
|
|
35
35
|
### TypeScript Best Practices
|
|
36
|
-
${
|
|
36
|
+
${Ye.map(e=>`- ${e}`).join(`
|
|
37
37
|
`)}
|
|
38
38
|
|
|
39
39
|
### Style and Consistency
|
|
40
|
-
${
|
|
40
|
+
${Ze.map(e=>`- ${e}`).join(`
|
|
41
41
|
`)}
|
|
42
42
|
|
|
43
43
|
### Next.js Specific Rules
|
|
44
|
-
${
|
|
44
|
+
${Xe.map(e=>`- ${e}`).join(`
|
|
45
45
|
`)}
|
|
46
46
|
|
|
47
47
|
### Testing Best Practices
|
|
48
|
-
${
|
|
48
|
+
${Qe.map(e=>`- ${e}`).join(`
|
|
49
49
|
`)}
|
|
50
50
|
|
|
51
51
|
## Common Tasks
|
|
@@ -70,14 +70,14 @@ try {
|
|
|
70
70
|
} catch (e) {
|
|
71
71
|
console.log(e);
|
|
72
72
|
}
|
|
73
|
-
\`\`\``});var
|
|
73
|
+
\`\`\``});var st={};d(st,{claude:()=>F});import{mkdir as et,writeFile as tt}from"fs/promises";var re,F,ae=l(()=>{"use strict";y();f();re="./.claude/CLAUDE.md",F={exists:()=>i(re),create:async()=>{await et(".claude",{recursive:!0}),await tt(re,p)},update:async()=>{await et(".claude",{recursive:!0}),await tt(re,p)}}});var ot={};d(ot,{codex:()=>A});import{writeFile as nt}from"fs/promises";var ce,A,le=l(()=>{"use strict";y();f();ce="./AGENTS.md",A={exists:()=>i(ce),create:async()=>{await nt(ce,p)},update:async()=>{await nt(ce,p)}}});var at={};d(at,{cursor:()=>$});import{mkdir as it,writeFile as rt}from"fs/promises";var ue,ms,$,de=l(()=>{"use strict";y();f();ue="./.cursor/rules/ultracite.mdc",ms=`---
|
|
74
74
|
description: Ultracite Rules - AI-Ready Formatter and Linter
|
|
75
75
|
globs: "**/*.{ts,tsx,js,jsx}"
|
|
76
76
|
alwaysApply: true
|
|
77
77
|
---
|
|
78
78
|
|
|
79
|
-
${p}`,$={exists:()=>i(
|
|
80
|
-
${
|
|
79
|
+
${p}`,$={exists:()=>i(ue),create:async()=>{await it(".cursor/rules",{recursive:!0}),await rt(ue,ms)},update:async()=>{await it(".cursor/rules",{recursive:!0}),await rt(ue,p)}}});var pt={};d(pt,{eslintCleanup:()=>W});import{execSync as fs}from"child_process";import{unlink as gs}from"fs/promises";import{readFile as ct,writeFile as hs}from"fs/promises";import{parse as lt}from"jsonc-parser";var ut,dt,ys,ws,bs,vs,ks,W,pe=l(()=>{"use strict";f();ut=[".eslintrc",".eslintrc.js",".eslintrc.json",".eslintrc.yml",".eslintrc.yaml",".eslintrc.config.js","eslint.config.js","eslint.config.mjs","eslint.config.cjs",".eslintignore"],dt=async()=>{try{let e=await ct("package.json","utf-8"),t=lt(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(r=>r.startsWith("eslint")||r==="@eslint/js"||r==="@typescript-eslint/parser"||r==="@typescript-eslint/eslint-plugin")}catch{return[]}},ys=(e,t)=>{if(t.length===0)return;let s=t.join(" ");try{fs(`${e} ${s}`,{stdio:"pipe"})}catch{}},ws=async()=>{let e=[];for(let t of ut)if(await i(t))try{await gs(t),e.push(t)}catch{}return e},bs=async()=>{let e="./.vscode/settings.json";if(!await i(e))return!1;try{let t=await ct(e,"utf-8"),s=lt(t);if(!s||typeof s!="object")return!1;let n=!1,o={...s},r=["eslint.enable","eslint.format.enable","eslint.validate","eslint.workingDirectories","eslint.codeAction.showDocumentation","eslint.run","eslint.autoFixOnSave","eslint.quiet","eslint.packageManager","eslint.options","eslint.trace.server"];for(let c of r)c in o&&(delete o[c],n=!0);if("editor.codeActionsOnSave"in o){let c=o["editor.codeActionsOnSave"];if(c&&typeof c=="object"){let a=["source.fixAll.eslint","source.organizeImports.eslint"];for(let m of a)m in c&&(delete c[m],n=!0);Object.keys(c).length===0&&delete o["editor.codeActionsOnSave"]}}return n?(await hs(e,JSON.stringify(o,null,2)),!0):!1}catch{return!1}},vs=async()=>{if((await dt()).length>0)return!0;for(let t of ut)if(await i(t))return!0;return!1},ks=e=>e.startsWith("npm")?"npm uninstall":e.startsWith("yarn")?"yarn remove":e.startsWith("pnpm")?"pnpm remove":e.startsWith("bun")?"bun remove":"npm uninstall",W={hasESLint:vs,remove:async e=>{let t=await dt(),s=ks(e);ys(s,t);let n=await ws(),o=await bs();return{packagesRemoved:t,filesRemoved:n,vsCodeCleaned:o}}}});var gt={};d(gt,{husky:()=>k});import{execSync as xs}from"child_process";import{mkdir as Ds,readFile as js,writeFile as mt}from"fs/promises";var ft,L,k,me=l(()=>{"use strict";f();ft="npx ultracite format",L="./.husky/pre-commit",k={exists:()=>i(L),install:e=>{xs(`${e} -D husky`)},create:async()=>{await Ds(".husky",{recursive:!0}),await mt(L,ft)},update:async()=>{let e=await js(L,"utf-8");await mt(L,`${e}
|
|
80
|
+
${ft}`)}}});var bt={};d(bt,{kiro:()=>wt});import{mkdir as ht,writeFile as yt}from"fs/promises";var fe,wt,ge=l(()=>{"use strict";y();f();fe="./.kiro/steering/linting-and-formatting.md",wt={exists:()=>i(fe),create:async()=>{await ht(".kiro/steering",{recursive:!0}),await yt(fe,p)},update:async()=>{await ht(".kiro/steering",{recursive:!0}),await yt(fe,p)}}});var xt={};d(xt,{lefthook:()=>D});import{execSync as vt}from"child_process";import{readFile as Cs,writeFile as _}from"fs/promises";var q,x,kt,D,he=l(()=>{"use strict";f();q="npx ultracite format",x="./lefthook.yml",kt=`pre-commit:
|
|
81
81
|
jobs:
|
|
82
82
|
- run: ${q}
|
|
83
83
|
glob:
|
|
@@ -89,7 +89,7 @@ ${pt}`)}}});var yt={};d(yt,{kiro:()=>ht});import{mkdir as ft,writeFile as gt}fro
|
|
|
89
89
|
- "*.jsonc"
|
|
90
90
|
- "*.css"
|
|
91
91
|
stage_fixed: true
|
|
92
|
-
`,D={exists:()=>i(
|
|
92
|
+
`,D={exists:()=>i(x),install:e=>{vt(`${e} -D lefthook`),vt("npx lefthook install")},create:async()=>{await _(x,kt)},update:async()=>{let e=await Cs(x,"utf-8");if(!e.includes(q))if(e.includes("pre-commit:"))if(e.includes("jobs:")){let t=` - run: ${q}
|
|
93
93
|
glob:
|
|
94
94
|
- "*.js"
|
|
95
95
|
- "*.jsx"
|
|
@@ -99,7 +99,7 @@ ${pt}`)}}});var yt={};d(yt,{kiro:()=>ht});import{mkdir as ft,writeFile as gt}fro
|
|
|
99
99
|
- "*.jsonc"
|
|
100
100
|
- "*.css"
|
|
101
101
|
stage_fixed: true`,s=e.replace(/(pre-commit:\s*\n\s*jobs:\s*\n)/,`$1${t}
|
|
102
|
-
`);await _(
|
|
102
|
+
`);await _(x,s)}else{let t=` jobs:
|
|
103
103
|
- run: ${q}
|
|
104
104
|
glob:
|
|
105
105
|
- "*.js"
|
|
@@ -110,8 +110,8 @@ ${pt}`)}}});var yt={};d(yt,{kiro:()=>ht});import{mkdir as ft,writeFile as gt}fro
|
|
|
110
110
|
- "*.jsonc"
|
|
111
111
|
- "*.css"
|
|
112
112
|
stage_fixed: true`,s=e.replace(/(pre-commit:\s*\n)/,`$1${t}
|
|
113
|
-
`);await _(
|
|
114
|
-
${
|
|
113
|
+
`);await _(x,s)}else await _(x,`${e}
|
|
114
|
+
${kt}`)}}});var Dt={};d(Dt,{lint:()=>ye});import{execSync as Ss}from"child_process";import Rs from"process";var ye,we=l(()=>{"use strict";ye=e=>{try{let t=e.length>0?e.map(s=>`"${s}"`).join(" "):"./";Ss(`npx @biomejs/biome check ${t}`,{stdio:"inherit"})}catch(t){let s=t instanceof Error?t.message:"Unknown error";console.error("Failed to run Ultracite:",s),Rs.exit(1)}}});var jt={};d(jt,{packageManager:()=>j});import{log as Ps,select as Fs}from"@clack/prompts";var be,j,ve=l(()=>{"use strict";f();be=[{hint:"Recommended",label:"pnpm",value:"pnpm add",lockfiles:["pnpm-lock.yaml"],monorepoSuffix:"-w"},{label:"bun",value:"bun add",lockfiles:["bun.lockb","bun.lock"],monorepoSuffix:""},{label:"yarn",value:"yarn add",lockfiles:["yarn.lock"],monorepoSuffix:""},{label:"npm",value:"npm install --legacy-peer-deps",lockfiles:["package-lock.json"],monorepoSuffix:"--workspace ."}],j={get:async()=>{let e=await R();e&&Ps.info("Monorepo detected, updating install command to include workspace flag");for(let t of be){let s=!1;for(let n of t.lockfiles)if(await i(n)){s=!0;break}if(s)return e&&t.monorepoSuffix?`${t.value} ${t.monorepoSuffix}`:t.value}return null},select:async()=>{let e=await R(),t=await Fs({initialValue:"pnpm",message:"Which package manager do you use?",options:be.map(s=>({label:s.label,value:e&&s.monorepoSuffix?`${s.value} ${s.monorepoSuffix}`:s.value}))});return typeof t!="string"?null:t},isMonorepo:R,options:be}});var Ft={};d(Ft,{prettierCleanup:()=>B});import{execSync as As}from"child_process";import{unlink as $s}from"fs/promises";import{readFile as Ct,writeFile as Is}from"fs/promises";import{parse as St}from"jsonc-parser";var Rt,Pt,Os,Us,Js,Ms,Es,B,ke=l(()=>{"use strict";f();Rt=[".prettierrc",".prettierrc.js",".prettierrc.json",".prettierrc.yml",".prettierrc.yaml",".prettierrc.config.js","prettier.config.js","prettier.config.mjs",".prettierignore"],Pt=async()=>{try{let e=await Ct("package.json","utf-8"),t=St(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(r=>r.startsWith("prettier")||r==="eslint-config-prettier"||r==="eslint-plugin-prettier")}catch{return[]}},Os=(e,t)=>{if(t.length===0)return;let s=t.join(" ");try{As(`${e} ${s}`,{stdio:"pipe"})}catch{}},Us=async()=>{let e=[];for(let t of Rt)if(await i(t))try{await $s(t),e.push(t)}catch{}return e},Js=async()=>{let e="./.vscode/settings.json";if(!await i(e))return!1;try{let t=await Ct(e,"utf-8"),s=St(t);if(!s||typeof s!="object")return!1;let n=!1,o={...s},r=["editor.defaultFormatter","prettier.enable","prettier.requireConfig","prettier.configPath","prettier.printWidth","prettier.tabWidth","prettier.useTabs","prettier.semi","prettier.singleQuote","prettier.quoteProps","prettier.trailingComma","prettier.bracketSpacing","prettier.arrowParens","prettier.endOfLine"];for(let a of r)a in o&&(a==="editor.defaultFormatter"&&o[a]==="esbenp.prettier-vscode"||a!=="editor.defaultFormatter")&&(delete o[a],n=!0);let c=Object.keys(o).filter(a=>a.startsWith("[")&&a.includes("javascript"));for(let a of c){let m=o[a];m&&typeof m=="object"&&"editor.defaultFormatter"in m&&m["editor.defaultFormatter"]==="esbenp.prettier-vscode"&&(delete m["editor.defaultFormatter"],n=!0,Object.keys(m).length===0&&delete o[a])}return n?(await Is(e,JSON.stringify(o,null,2)),!0):!1}catch{return!1}},Ms=async()=>{if((await Pt()).length>0)return!0;for(let t of Rt)if(await i(t))return!0;return!1},Es=e=>e.startsWith("npm")?"npm uninstall":e.startsWith("yarn")?"yarn remove":e.startsWith("pnpm")?"pnpm remove":e.startsWith("bun")?"bun remove":"npm uninstall",B={hasPrettier:Ms,remove:async e=>{let t=await Pt(),s=Es(e);Os(s,t);let n=await Us(),o=await Js();return{packagesRemoved:t,filesRemoved:n,vsCodeCleaned:o}}}});var At={};d(At,{title:()=>xe});var xe,De=l(()=>{"use strict";xe=`
|
|
115
115
|
888 888 888 88888888888 8888888b. d8888 .d8888b. 8888888 88888888888 8888888888
|
|
116
116
|
888 888 888 888 888 Y88b d88888 d88P Y88b 888 888 888
|
|
117
117
|
888 888 888 888 888 888 d88P888 888 888 888 888 888
|
|
@@ -120,16 +120,16 @@ ${bt}`)}}});var xt={};d(xt,{lint:()=>ge});import{execSync as Ds}from"child_proce
|
|
|
120
120
|
888 888 888 888 888 T88b d88P 888 888 888 888 888 888
|
|
121
121
|
Y88b. .d88P 888 888 888 T88b d8888888888 Y88b d88P 888 888 888
|
|
122
122
|
"Y88888P" 88888888 888 888 T88b d88P 888 "Y8888P" 8888888 888 8888888888
|
|
123
|
-
`});var
|
|
123
|
+
`});var Ot={};d(Ot,{tsconfig:()=>I});import{readFile as Ns,writeFile as $t}from"fs/promises";import zs from"deepmerge";import{parse as Ts}from"jsonc-parser";var It,H,I,je=l(()=>{"use strict";f();It={compilerOptions:{strictNullChecks:!0}},H="./tsconfig.json",I={exists:()=>i(H),create:()=>$t(H,JSON.stringify(It,null,2)),update:async()=>{let e=await Ns(H,"utf-8"),s=Ts(e)||{},n=zs(s,It);await $t(H,JSON.stringify(n,null,2))}}});var Et={};d(Et,{vscodeCopilot:()=>O});import{mkdir as Ut,writeFile as Jt}from"fs/promises";var Ce,Mt,O,Se=l(()=>{"use strict";y();f();Ce="./.github/copilot-instructions.md",Mt=`---
|
|
124
124
|
applyTo: "**/*.{ts,tsx,js,jsx}"
|
|
125
125
|
---
|
|
126
126
|
|
|
127
|
-
${p}`,
|
|
127
|
+
${p}`,O={exists:()=>i(Ce),create:async()=>{await Ut(".github",{recursive:!0}),await Jt(Ce,Mt)},update:async()=>{await Ut(".github",{recursive:!0}),await Jt(Ce,Mt)}}});var Tt={};d(Tt,{vscode:()=>U});import{mkdir as Ws,readFile as Ls,writeFile as Nt}from"fs/promises";import _s from"deepmerge";import{parse as qs}from"jsonc-parser";var zt,V,U,Re=l(()=>{"use strict";f();zt={"editor.defaultFormatter":"esbenp.prettier-vscode","[javascript]":{"editor.defaultFormatter":"biomejs.biome"},"[typescript]":{"editor.defaultFormatter":"biomejs.biome"},"[javascriptreact]":{"editor.defaultFormatter":"biomejs.biome"},"[typescriptreact]":{"editor.defaultFormatter":"biomejs.biome"},"[json]":{"editor.defaultFormatter":"biomejs.biome"},"[jsonc]":{"editor.defaultFormatter":"biomejs.biome"},"[css]":{"editor.defaultFormatter":"biomejs.biome"},"[graphql]":{"editor.defaultFormatter":"biomejs.biome"},"typescript.tsdk":"node_modules/typescript/lib","editor.formatOnSave":!0,"editor.formatOnPaste":!0,"emmet.showExpandedAbbreviation":"never","editor.codeActionsOnSave":{"source.fixAll.biome":"explicit","source.organizeImports.biome":"explicit"}},V="./.vscode/settings.json",U={exists:()=>i(V),create:async()=>{await Ws(".vscode",{recursive:!0}),await Nt(V,JSON.stringify(zt,null,2))},update:async()=>{let e=await Ls(V,"utf-8"),s=qs(e)||{},n=_s(s,zt);await Nt(V,JSON.stringify(n,null,2))}}});var _t={};d(_t,{windsurf:()=>J});import{mkdir as Wt,writeFile as Lt}from"fs/promises";var Pe,J,Fe=l(()=>{"use strict";y();f();Pe="./.windsurf/rules/ultracite.md",J={exists:()=>i(Pe),create:async()=>{await Wt(".windsurf/rules",{recursive:!0}),await Lt(Pe,p)},update:async()=>{await Wt(".windsurf/rules",{recursive:!0}),await Lt(Pe,p)}}});var Ht={};d(Ht,{zed:()=>M});import{mkdir as Bs,readFile as Hs,writeFile as qt}from"fs/promises";import Vs from"deepmerge";import{parse as Ks}from"jsonc-parser";var Bt,K,M,Ae=l(()=>{"use strict";f();Bt={formatter:"language_server",format_on_save:"on",languages:{JavaScript:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},TypeScript:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},JSX:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},TSX:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}}},lsp:{"typescript-language-server":{settings:{typescript:{preferences:{includePackageJsonAutoImports:"on"}}}}}},K="./.zed/settings.json",M={exists:()=>i(K),create:async()=>{await Bs(".zed",{recursive:!0}),await qt(K,JSON.stringify(Bt,null,2))},update:async()=>{let e=await Hs(K,"utf-8"),s=Ks(e)||{},n=Vs(s,Bt);await qt(K,JSON.stringify(n,null,2))}}});var Vt={};d(Vt,{zedCopilot:()=>E});import{readFile as Gs,writeFile as $e}from"fs/promises";var C,E,Ie=l(()=>{"use strict";y();f();C="./.rules",E={exists:()=>i(C),create:async()=>{await $e(C,p)},update:async()=>{if(!await i(C)){await $e(C,p);return}let e=await Gs(C,"utf-8");e.includes(p.trim())||await $e(C,`${e}
|
|
128
128
|
|
|
129
|
-
${p}`)}}});var
|
|
130
|
-
`).filter(r=>r.trim()&&!r.trim().startsWith("#")),s={},n=null,o=[];for(let r of t){let c=
|
|
129
|
+
${p}`)}}});var Zs,Oe=l(()=>{Zs=Te({"./biome.ts":()=>(ie(),u(Be)),"./claude.ts":()=>(ae(),u(st)),"./codex.ts":()=>(le(),u(ot)),"./cursor.ts":()=>(de(),u(at)),"./eslint-cleanup.ts":()=>(pe(),u(pt)),"./format.ts":()=>(ne(),u(We)),"./husky.ts":()=>(me(),u(gt)),"./index.ts":()=>(Yt(),u(Ys)),"./initialize.ts":()=>(Je(),u(Gt)),"./kiro.ts":()=>(ge(),u(bt)),"./lefthook.ts":()=>(he(),u(xt)),"./lint-staged.ts":()=>(Ue(),u(Kt)),"./lint.ts":()=>(we(),u(Dt)),"./package-manager.ts":()=>(ve(),u(jt)),"./prettier-cleanup.ts":()=>(ke(),u(Ft)),"./title.ts":()=>(De(),u(At)),"./tsconfig.ts":()=>(je(),u(Ot)),"./utils.ts":()=>(f(),u(Le)),"./vscode-copilot.ts":()=>(Se(),u(Et)),"./vscode-settings.ts":()=>(Re(),u(Tt)),"./windsurf.ts":()=>(Fe(),u(_t)),"./zed-settings.ts":()=>(Ae(),u(Ht)),"./zed.ts":()=>(Ie(),u(Vt))})});var Kt={};d(Kt,{lintStaged:()=>S});import{execSync as Xs}from"child_process";import{readFile as G,writeFile as v}from"fs/promises";import{pathToFileURL as Qs}from"url";import N from"deepmerge";import{parse as Ee}from"jsonc-parser";var w,Zt,en,tn,sn,nn,on,rn,an,cn,ln,Me,un,S,Ue=l(()=>{"use strict";f();Oe();w={"*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}":["npx ultracite format"]},Zt=["./package.json","./.lintstagedrc.json","./.lintstagedrc.js","./.lintstagedrc.cjs","./.lintstagedrc.mjs","./lint-staged.config.js","./lint-staged.config.cjs","./lint-staged.config.mjs","./.lintstagedrc.yaml","./.lintstagedrc.yml","./.lintstagedrc"],en=(e,t,s,n)=>{let o=e.trim();if(o.includes(":")&&!o.startsWith("-")){s&&n.length>0&&(t[s]=n);let[r,...c]=o.split(":"),a=c.join(":").trim(),m=r.trim().replace(/['"]/g,"");return a&&a!==""?(a.startsWith("[")&&a.endsWith("]")?t[m]=a.slice(1,-1).split(",").map(z=>z.trim().replace(/['"]/g,"")):t[m]=a.replace(/['"]/g,""),{newCurrentKey:null,newCurrentArray:[]}):{newCurrentKey:m,newCurrentArray:[]}}if(o.startsWith("-")&&s){let r=[...n,o.slice(1).trim().replace(/['"]/g,"")];return{newCurrentKey:s,newCurrentArray:r}}return{newCurrentKey:s,newCurrentArray:n}},tn=e=>{let t=e.split(`
|
|
130
|
+
`).filter(r=>r.trim()&&!r.trim().startsWith("#")),s={},n=null,o=[];for(let r of t){let c=en(r,s,n,o);n=c.newCurrentKey,o=c.newCurrentArray}return n&&o.length>0&&(s[n]=o),s},sn=e=>{let t="";for(let[s,n]of Object.entries(e))if(Array.isArray(n)){t+=`${s}:
|
|
131
131
|
`;for(let o of n)t+=` - '${o}'
|
|
132
132
|
`}else t+=`${s}: '${n}'
|
|
133
|
-
`;return t},
|
|
134
|
-
`;await
|
|
135
|
-
`;await b(e,n)},Me=async()=>{await b(".lintstagedrc.json",JSON.stringify(w,null,2))},an=async e=>{if(e==="./package.json"){await tn();return}if(e.endsWith(".json")||e==="./.lintstagedrc"){await sn(e);return}if(e.endsWith(".yaml")||e.endsWith(".yml")){await nn(e);return}let t=await en();if(e.endsWith(".mjs")||e.endsWith(".js")&&t){try{await on(e)}catch{await Me()}return}if(e.endsWith(".cjs")||e.endsWith(".js")&&!t)try{await rn(e)}catch{await Me()}},S={exists:async()=>{for(let e of Gt)if(await i(e))return!0;return!1},install:e=>{Gs(`${e} -D lint-staged`)},create:async()=>{await b(".lintstagedrc.json",JSON.stringify(w,null,2))},update:async()=>{let e=null;for(let t of Gt)if(await i(t)){e=t;break}if(!e){await Me();return}await an(e)}}});var Kt={};d(Kt,{initialize:()=>ze});import{execSync as cn}from"child_process";import ln from"process";import{intro as un,log as Ee,multiselect as Y,spinner as h}from"@clack/prompts";var dn,pn,mn,fn,gn,hn,yn,wn,bn,vn,xn,kn,Dn,Cn,jn,Sn,Rn,Pn,ze,Ie=l(()=>{"use strict";ne();ie();ae();le();ue();de();me();fe();Ue();we();be();xe();ke();Ce();je();Re();Ae();Pe();N();dn=v.devDependencies["@biomejs/biome"],pn=e=>{let t=h();t.start("Installing dependencies..."),cn(`${e} -D -E ultracite @biomejs/biome@${dn}`),t.stop("Dependencies installed.")},mn=async()=>{let e=h();if(e.start("Checking for tsconfig.json..."),await U.exists()){e.message("tsconfig.json found, updating..."),await U.update(),e.stop("tsconfig.json updated.");return}e.message("tsconfig.json not found, creating..."),await U.create(),e.stop("tsconfig.json created.")},fn=async()=>{let e=h();if(e.start("Checking for .vscode/settings.json..."),await M.exists()){e.message("settings.json found, updating..."),await M.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await M.create(),e.stop("settings.json created.")},gn=async()=>{let e=h();if(e.start("Checking for .zed/settings.json..."),await E.exists()){e.message("settings.json found, updating..."),await E.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await E.create(),e.stop("settings.json created.")},hn=async()=>{let e=h();if(e.start("Checking for Biome configuration..."),await P.exists()){e.message("Biome configuration found, updating..."),await P.update(),e.stop("Biome configuration updated.");return}e.message("Biome configuration not found, creating..."),await P.create(),e.stop("Biome configuration created.")},yn=async e=>{let t=h();if(t.start("Initializing pre-commit hooks..."),t.message("Installing Husky..."),x.install(e),await x.exists()){t.message("Pre-commit hook found, updating..."),await x.update(),t.stop("Pre-commit hook updated.");return}t.message("Pre-commit hook not found, creating..."),await x.create(),t.stop("Pre-commit hook created.")},wn=async e=>{let t=h();if(t.start("Initializing lefthook..."),t.message("Installing lefthook..."),D.install(e),await D.exists()){t.message("lefthook.yml found, updating..."),await D.update(),t.stop("lefthook.yml updated.");return}t.message("lefthook.yml not found, creating..."),await D.create(),t.stop("lefthook.yml created.")},bn=async e=>{let t=h();if(t.start("Initializing lint-staged..."),t.message("Installing lint-staged..."),S.install(e),await S.exists()){t.message("lint-staged found, updating..."),await S.update(),t.stop("lint-staged updated.");return}t.message("lint-staged not found, creating..."),await S.create(),t.stop("lint-staged created.")},vn=async()=>{let e=h();if(e.start("Checking for GitHub Copilot rules..."),await I.exists()){e.message("GitHub Copilot rules found, updating..."),await I.update(),e.stop("GitHub Copilot rules updated.");return}e.message("GitHub Copilot rules not found, creating..."),await I.create(),e.stop("GitHub Copilot rules created.")},xn=async()=>{let e=h();if(e.start("Checking for Cursor rules..."),await $.exists()){e.message("Cursor rules found, updating..."),await $.update(),e.stop("Cursor rules updated.");return}e.message("Cursor rules not found, creating..."),await $.create(),e.stop("Cursor rules created.")},kn=async()=>{let e=h();if(e.start("Checking for Windsurf rules..."),await O.exists()){e.message("Windsurf rules found, updating..."),await O.update(),e.stop("Windsurf rules updated.");return}e.message("Windsurf rules not found, creating..."),await O.create(),e.stop("Windsurf rules created.")},Dn=async()=>{let e=h();if(e.start("Checking for Zed rules..."),await z.exists()){e.message("Zed rules found, updating..."),await z.update(),e.stop("Zed rules updated.");return}e.message("Zed rules not found, creating..."),await z.create(),e.stop("Zed rules created.")},Cn=async()=>{let e=h();if(e.start("Checking for Claude Code rules..."),await F.exists()){e.message("Claude Code rules found, updating..."),await F.update(),e.stop("Claude Code rules updated.");return}e.message("Claude Code rules not found, creating..."),await F.create(),e.stop("Claude Code rules created.")},jn=async()=>{let e=h();if(e.start("Checking for OpenAI Codex rules..."),await A.exists()){e.message("OpenAI Codex rules found, updating..."),await A.update(),e.stop("OpenAI Codex rules updated.");return}e.message("OpenAI Codex rules not found, creating..."),await A.create(),e.stop("OpenAI Codex rules created.")},Sn=async e=>{let t=h();t.start("Removing Prettier dependencies and configuration...");try{let s=await B.remove(e);s.packagesRemoved.length>0&&t.message(`Removed Prettier packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&t.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&t.message("Cleaned VS Code settings"),t.stop("Prettier removed successfully.")}catch{t.stop("Failed to remove Prettier completely, but continuing...")}},Rn=async e=>{let t=h();t.start("Removing ESLint dependencies and configuration...");try{let s=await W.remove(e);s.packagesRemoved.length>0&&t.message(`Removed ESLint packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&t.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&t.message("Cleaned VS Code settings"),t.stop("ESLint removed successfully.")}catch{t.stop("Failed to remove ESLint completely, but continuing...")}},Pn=async e=>{if(e){let n=C.options.find(r=>r.label===e);if(!n)throw new Error(`Unsupported package manager: ${e}`);return await C.isMonorepo()&&n.monorepoSuffix?`${n.value} ${n.monorepoSuffix}`:n.value}let t=await C.get();if(t)return Ee.info(`Detected lockfile, using ${t}`),t;let s=await C.select();if(!s)throw new Error("No package manager selected");return s},ze=async e=>{un(ve);try{let t=e??{},s=await Pn(t.pm),n=t.removePrettier,o=t.removeEslint;if(n===void 0||o===void 0){let m=[];if(n===void 0&&await B.hasPrettier()&&m.push({label:"Remove Prettier (dependencies, config files, VS Code settings)",value:"prettier"}),o===void 0&&await W.hasESLint()&&m.push({label:"Remove ESLint (dependencies, config files, VS Code settings)",value:"eslint"}),m.length>0){let T=await Y({message:"Remove existing formatters/linters (recommended for clean migration)?",options:m,required:!1});n===void 0&&(n=T.includes("prettier")),o===void 0&&(o=T.includes("eslint"))}}let r=t.editors;r||(r=await Y({message:"Which editors do you want to configure (recommended)?",options:[{label:"VSCode / Cursor / Windsurf",value:"vscode"},{label:"Zed",value:"zed"}],required:!1}));let c=t.rules;c||(c=await Y({message:"Which editor rules do you want to enable (optional)?",options:[{label:"GitHub Copilot (VSCode)",value:"vscode-copilot"},{label:"Cursor",value:"cursor"},{label:"Windsurf",value:"windsurf"},{label:"Zed",value:"zed"},{label:"Claude Code",value:"claude"},{label:"OpenAI Codex",value:"codex"}],required:!1}));let a=t.features;a===void 0&&(t.pm||t.editors||t.rules||t.removePrettier!==void 0||t.removeEslint!==void 0?a=[]:a=await Y({message:"Would you like any of the following (optional)?",options:[{label:"Husky pre-commit hook",value:"husky"},{label:"Lefthook pre-commit hook",value:"lefthook"},{label:"Lint-staged",value:"lint-staged"}],required:!1})),n&&await Sn(s),o&&await Rn(s),pn(s),await mn(),await hn(),r?.includes("vscode")&&await fn(),r?.includes("zed")&&await gn(),c?.includes("vscode-copilot")&&await vn(),c?.includes("cursor")&&await xn(),c?.includes("windsurf")&&await kn(),c?.includes("zed")&&await Dn(),c?.includes("claude")&&await Cn(),c?.includes("codex")&&await jn(),a?.includes("husky")&&await yn(s),a?.includes("lefthook")&&await wn(s),a?.includes("lint-staged")&&await bn(s),Ee.success("Successfully initialized Ultracite configuration!")}catch(t){let s=t instanceof Error?t.message:"Unknown error";Ee.error(`Failed to initialize Ultracite configuration: ${s}`),ln.exit(1)}}});var Ks={};import{createCli as Fn,trpcServer as An}from"trpc-cli";import g from"zod";var Z,$n,Un,Vt=l(()=>{N();te();Ie();he();Z=An.initTRPC.meta().create(),$n=Z.router({init:Z.procedure.meta({description:"Initialize Ultracite in the current directory"}).input(g.object({pm:g.enum(["pnpm","bun","yarn","npm"]).optional().describe("Package manager to use"),editors:g.array(g.enum(["vscode","zed"])).optional().describe("Editors to configure"),rules:g.array(g.enum(["vscode-copilot","cursor","windsurf","zed","claude","codex"])).optional().describe("Editor rules to enable"),features:g.array(g.enum(["husky","lefthook","lint-staged"])).optional().describe("Additional features to enable"),removePrettier:g.boolean().optional().describe("Remove Prettier dependencies and configuration"),removeEslint:g.boolean().optional().describe("Remove ESLint dependencies and configuration")})).mutation(async({input:e})=>{await ze(e)}),lint:Z.procedure.meta({description:"Run Biome linter without fixing files"}).input(g.array(g.string()).optional().default([]).describe("specific files to lint")).query(({input:e})=>{ge(e)}),format:Z.procedure.meta({description:"Run Biome linter and fixes files"}).input(g.tuple([g.array(g.string()).optional().default([]).describe("specific files to format"),g.object({unsafe:g.boolean().optional().describe("apply unsafe fixes")})])).mutation(({input:e})=>{let[t,s]=e;ee(t,{unsafe:s.unsafe})})}),Un=Fn({router:$n,name:"ultracite",version:v.version,description:"Ship code faster and with more confidence."});process.env.VITEST||Un.run()});Vt();
|
|
133
|
+
`;return t},nn=async()=>{try{let e=Ee(await G("./package.json","utf-8"));return e?e.type==="module":!1}catch{return!1}},on=async()=>{let e=Ee(await G("./package.json","utf-8"));e&&(e["lint-staged"]?e["lint-staged"]=N(e["lint-staged"],w):e["lint-staged"]=w,await v("./package.json",JSON.stringify(e,null,2)))},rn=async e=>{let t=await G(e,"utf-8"),s=Ee(t);if(!s)return;let n=N(s,w);await v(e,JSON.stringify(n,null,2))},an=async e=>{let t=await G(e,"utf-8"),s=tn(t);if(!s)return;let n=N(s,w);await v(e,sn(n))},cn=async e=>{let n=(await import(Qs(e).href)).default||{},o=N(n,w),r=`export default ${JSON.stringify(o,null,2)};
|
|
134
|
+
`;await v(e,r)},ln=async e=>{delete te.cache[te.resolve(`./${e}`)];let t=Zs(`./${e}`),s=N(t,w),n=`module.exports = ${JSON.stringify(s,null,2)};
|
|
135
|
+
`;await v(e,n)},Me=async()=>{await v(".lintstagedrc.json",JSON.stringify(w,null,2))},un=async e=>{if(e==="./package.json"){await on();return}if(e.endsWith(".json")||e==="./.lintstagedrc"){await rn(e);return}if(e.endsWith(".yaml")||e.endsWith(".yml")){await an(e);return}let t=await nn();if(e.endsWith(".mjs")||e.endsWith(".js")&&t){try{await cn(e)}catch{await Me()}return}if(e.endsWith(".cjs")||e.endsWith(".js")&&!t)try{await ln(e)}catch{await Me()}},S={exists:async()=>{for(let e of Zt)if(await i(e))return!0;return!1},install:e=>{Xs(`${e} -D lint-staged`)},create:async()=>{await v(".lintstagedrc.json",JSON.stringify(w,null,2))},update:async()=>{let e=null;for(let t of Zt)if(await i(t)){e=t;break}if(!e){await Me();return}await un(e)}}});var Gt={};d(Gt,{initialize:()=>ze});import{execSync as dn}from"child_process";import{readFile as Z,writeFile as X}from"fs/promises";import pn from"process";import{intro as mn,log as Ne,multiselect as Y,spinner as h}from"@clack/prompts";var Xt,fn,gn,hn,yn,wn,bn,vn,kn,xn,Dn,jn,Cn,Sn,Rn,Pn,Fn,An,$n,ze,Je=l(()=>{"use strict";T();ie();ae();le();de();pe();me();ge();he();Ue();ve();ke();De();je();Se();Re();Fe();Ie();Ae();Xt=b.devDependencies["@biomejs/biome"],fn=b.version,gn=async(e,t=!0)=>{let s=h();if(s.start("Installing dependencies..."),t)dn(`${e} -D -E ultracite @biomejs/biome@${Xt}`);else{let n=await Z("package.json","utf8"),o=JSON.parse(n),r={...o,devDependencies:{...o.devDependencies,"@biomejs/biome":Xt,ultracite:`^${fn}`}};await X("package.json",JSON.stringify(r,null,2))}s.stop("Dependencies installed.")},hn=async()=>{let e=h();if(e.start("Checking for tsconfig.json..."),await I.exists()){e.message("tsconfig.json found, updating..."),await I.update(),e.stop("tsconfig.json updated.");return}e.message("tsconfig.json not found, creating..."),await I.create(),e.stop("tsconfig.json created.")},yn=async()=>{let e=h();if(e.start("Checking for .vscode/settings.json..."),await U.exists()){e.message("settings.json found, updating..."),await U.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await U.create(),e.stop("settings.json created.")},wn=async()=>{let e=h();if(e.start("Checking for .zed/settings.json..."),await M.exists()){e.message("settings.json found, updating..."),await M.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await M.create(),e.stop("settings.json created.")},bn=async()=>{let e=h();if(e.start("Checking for Biome configuration..."),await P.exists()){e.message("Biome configuration found, updating..."),await P.update(),e.stop("Biome configuration updated.");return}e.message("Biome configuration not found, creating..."),await P.create(),e.stop("Biome configuration created.")},vn=async(e,t=!0)=>{let s=h();if(s.start("Initializing pre-commit hooks..."),s.message("Installing Husky..."),t)k.install(e);else{let n=await Z("package.json","utf8"),o=JSON.parse(n),r={...o,devDependencies:{...o.devDependencies,husky:"latest"}};await X("package.json",JSON.stringify(r,null,2))}if(await k.exists()){s.message("Pre-commit hook found, updating..."),await k.update(),s.stop("Pre-commit hook updated.");return}s.message("Pre-commit hook not found, creating..."),await k.create(),s.stop("Pre-commit hook created.")},kn=async(e,t=!0)=>{let s=h();if(s.start("Initializing lefthook..."),s.message("Installing lefthook..."),t)D.install(e);else{let n=await Z("package.json","utf8"),o=JSON.parse(n),r={...o,devDependencies:{...o.devDependencies,lefthook:"latest"}};await X("package.json",JSON.stringify(r,null,2))}if(await D.exists()){s.message("lefthook.yml found, updating..."),await D.update(),s.stop("lefthook.yml updated.");return}s.message("lefthook.yml not found, creating..."),await D.create(),s.stop("lefthook.yml created.")},xn=async(e,t=!0)=>{let s=h();if(s.start("Initializing lint-staged..."),s.message("Installing lint-staged..."),t)S.install(e);else{let n=await Z("package.json","utf8"),o=JSON.parse(n),r={...o,devDependencies:{...o.devDependencies,"lint-staged":"latest"}};await X("package.json",JSON.stringify(r,null,2))}if(await S.exists()){s.message("lint-staged found, updating..."),await S.update(),s.stop("lint-staged updated.");return}s.message("lint-staged not found, creating..."),await S.create(),s.stop("lint-staged created.")},Dn=async()=>{let e=h();if(e.start("Checking for GitHub Copilot rules..."),await O.exists()){e.message("GitHub Copilot rules found, updating..."),await O.update(),e.stop("GitHub Copilot rules updated.");return}e.message("GitHub Copilot rules not found, creating..."),await O.create(),e.stop("GitHub Copilot rules created.")},jn=async()=>{let e=h();if(e.start("Checking for Cursor rules..."),await $.exists()){e.message("Cursor rules found, updating..."),await $.update(),e.stop("Cursor rules updated.");return}e.message("Cursor rules not found, creating..."),await $.create(),e.stop("Cursor rules created.")},Cn=async()=>{let e=h();if(e.start("Checking for Windsurf rules..."),await J.exists()){e.message("Windsurf rules found, updating..."),await J.update(),e.stop("Windsurf rules updated.");return}e.message("Windsurf rules not found, creating..."),await J.create(),e.stop("Windsurf rules created.")},Sn=async()=>{let e=h();if(e.start("Checking for Zed rules..."),await E.exists()){e.message("Zed rules found, updating..."),await E.update(),e.stop("Zed rules updated.");return}e.message("Zed rules not found, creating..."),await E.create(),e.stop("Zed rules created.")},Rn=async()=>{let e=h();if(e.start("Checking for Claude Code rules..."),await F.exists()){e.message("Claude Code rules found, updating..."),await F.update(),e.stop("Claude Code rules updated.");return}e.message("Claude Code rules not found, creating..."),await F.create(),e.stop("Claude Code rules created.")},Pn=async()=>{let e=h();if(e.start("Checking for OpenAI Codex rules..."),await A.exists()){e.message("OpenAI Codex rules found, updating..."),await A.update(),e.stop("OpenAI Codex rules updated.");return}e.message("OpenAI Codex rules not found, creating..."),await A.create(),e.stop("OpenAI Codex rules created.")},Fn=async e=>{let t=h();t.start("Removing Prettier dependencies and configuration...");try{let s=await B.remove(e);s.packagesRemoved.length>0&&t.message(`Removed Prettier packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&t.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&t.message("Cleaned VS Code settings"),t.stop("Prettier removed successfully.")}catch{t.stop("Failed to remove Prettier completely, but continuing...")}},An=async e=>{let t=h();t.start("Removing ESLint dependencies and configuration...");try{let s=await W.remove(e);s.packagesRemoved.length>0&&t.message(`Removed ESLint packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&t.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&t.message("Cleaned VS Code settings"),t.stop("ESLint removed successfully.")}catch{t.stop("Failed to remove ESLint completely, but continuing...")}},$n=async e=>{if(e){let n=j.options.find(r=>r.label===e);if(!n)throw new Error(`Unsupported package manager: ${e}`);return await j.isMonorepo()&&n.monorepoSuffix?`${n.value} ${n.monorepoSuffix}`:n.value}let t=await j.get();if(t)return Ne.info(`Detected lockfile, using ${t}`),t;let s=await j.select();if(!s)throw new Error("No package manager selected");return s},ze=async e=>{mn(xe);try{let t=e??{},s=await $n(t.pm),n=t.removePrettier,o=t.removeEslint;if(n===void 0||o===void 0){let m=[];if(n===void 0&&await B.hasPrettier()&&m.push({label:"Remove Prettier (dependencies, config files, VS Code settings)",value:"prettier"}),o===void 0&&await W.hasESLint()&&m.push({label:"Remove ESLint (dependencies, config files, VS Code settings)",value:"eslint"}),m.length>0){let z=await Y({message:"Remove existing formatters/linters (recommended for clean migration)?",options:m,required:!1});n===void 0&&(n=z.includes("prettier")),o===void 0&&(o=z.includes("eslint"))}}let r=t.editors;r||(r=await Y({message:"Which editors do you want to configure (recommended)?",options:[{label:"VSCode / Cursor / Windsurf",value:"vscode"},{label:"Zed",value:"zed"}],required:!1}));let c=t.rules;c||(c=await Y({message:"Which editor rules do you want to enable (optional)?",options:[{label:"GitHub Copilot (VSCode)",value:"vscode-copilot"},{label:"Cursor",value:"cursor"},{label:"Windsurf",value:"windsurf"},{label:"Zed",value:"zed"},{label:"Claude Code",value:"claude"},{label:"OpenAI Codex",value:"codex"}],required:!1}));let a=t.features;a===void 0&&(t.pm||t.editors||t.rules||t.removePrettier!==void 0||t.removeEslint!==void 0?a=[]:a=await Y({message:"Would you like any of the following (optional)?",options:[{label:"Husky pre-commit hook",value:"husky"},{label:"Lefthook pre-commit hook",value:"lefthook"},{label:"Lint-staged",value:"lint-staged"}],required:!1})),n&&await Fn(s),o&&await An(s),await gn(s,!t.skipInstall),await hn(),await bn(),r?.includes("vscode")&&await yn(),r?.includes("zed")&&await wn(),c?.includes("vscode-copilot")&&await Dn(),c?.includes("cursor")&&await jn(),c?.includes("windsurf")&&await Cn(),c?.includes("zed")&&await Sn(),c?.includes("claude")&&await Rn(),c?.includes("codex")&&await Pn(),a?.includes("husky")&&await vn(s,!t.skipInstall),a?.includes("lefthook")&&await kn(s,!t.skipInstall),a?.includes("lint-staged")&&await xn(s,!t.skipInstall),Ne.success("Successfully initialized Ultracite configuration!")}catch(t){let s=t instanceof Error?t.message:"Unknown error";Ne.error(`Failed to initialize Ultracite configuration: ${s}`),pn.exit(1)}}});var Ys={};import{createCli as In,trpcServer as On}from"trpc-cli";import g from"zod";var Q,Un,Jn,Yt=l(()=>{T();ne();Je();we();Q=On.initTRPC.meta().create(),Un=Q.router({init:Q.procedure.meta({description:"Initialize Ultracite in the current directory"}).input(g.object({pm:g.enum(["pnpm","bun","yarn","npm"]).optional().describe("Package manager to use"),editors:g.array(g.enum(["vscode","zed"])).optional().describe("Editors to configure"),rules:g.array(g.enum(["vscode-copilot","cursor","windsurf","zed","claude","codex"])).optional().describe("Editor rules to enable"),features:g.array(g.enum(["husky","lefthook","lint-staged"])).optional().describe("Additional features to enable"),removePrettier:g.boolean().optional().describe("Remove Prettier dependencies and configuration"),removeEslint:g.boolean().optional().describe("Remove ESLint dependencies and configuration"),skipInstall:g.boolean().default(!1).describe("Skip installing dependencies")})).mutation(async({input:e})=>{await ze(e)}),lint:Q.procedure.meta({description:"Run Biome linter without fixing files"}).input(g.array(g.string()).optional().default([]).describe("specific files to lint")).query(({input:e})=>{ye(e)}),format:Q.procedure.meta({description:"Run Biome linter and fixes files"}).input(g.tuple([g.array(g.string()).optional().default([]).describe("specific files to format"),g.object({unsafe:g.boolean().optional().describe("apply unsafe fixes")})])).mutation(({input:e})=>{let[t,s]=e;se(t,{unsafe:s.unsafe})})}),Jn=In({router:Un,name:"ultracite",version:b.version,description:"Ship code faster and with more confidence."});process.env.VITEST||Jn.run()});Yt();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ultracite",
|
|
3
3
|
"description": "The AI-ready formatter that helps you write and generate code faster.",
|
|
4
|
-
"version": "5.1.
|
|
4
|
+
"version": "5.1.3",
|
|
5
5
|
"bin": {
|
|
6
6
|
"ultracite": "dist/index.js"
|
|
7
7
|
},
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@auto-it/all-contributors": "^11.3.0",
|
|
41
41
|
"@auto-it/first-time-contributor": "^11.3.0",
|
|
42
|
-
"@biomejs/biome": "2.
|
|
42
|
+
"@biomejs/biome": "2.2.0",
|
|
43
43
|
"@types/node": "^24.0.14",
|
|
44
44
|
"@vitest/coverage-v8": "3.2.4",
|
|
45
45
|
"tsup": "^8.5.0"
|