ultracite 5.1.2 → 5.1.4

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://biomejs.dev/schemas/2.1.2/schema.json",
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
- // Enforce file extensions for relative imports.
272
- "useImportExtensions": "off",
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
- /** ------------------------ JavaScript Rules ------------------------ **/
306
-
307
- // Disallow await inside loops.
308
- "noAwaitInLoop": "error",
309
- // Disallow bitwise operators.
310
- "noBitwiseOperators": "error",
311
- // Disallow expressions where the operation doesn't affect the value
312
- "noConstantBinaryExpression": "error",
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
- // Prevents the use of the TypeScript directive @ts-ignore.
326
- "noTsIgnore": "error",
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 getters and setters for the same property are adjacent in class and object definitions.
336
- "useAdjacentGetterSetter": "error",
337
- // Require the consistent declaration of object literals. Defaults to explicit definitions.
338
- "useConsistentObjectDefinition": "error",
339
- // Use static Response methods instead of new Response() constructor when possible.
340
- "useConsistentResponse": "error",
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
- // Ensure the preconnect attribute is used when using Google Fonts.
344
- "useGoogleFontPreconnect": "error",
345
- // Prefer Array#{indexOf,lastIndexOf}() over Array#{findIndex,findLastIndex}() when looking for the index of an item.
346
- "useIndexOf": "error",
347
- // Enforce consistent return values in iterable callbacks.
348
- "useIterableCallbackReturn": "error",
349
- // Enforces the use of with { type: "json" } for JSON module imports.
350
- "useJsonImportAttribute": "error",
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
- // // Enforce naming conventions for everything across a codebase.
558
- "useNamingConvention": "off",
559
- // // Disallow multiple variable declarations in the same variable statement
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 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.1",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 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
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.3",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
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
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.1",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 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
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.3",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
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.2",
4
+ "version": "5.1.4",
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.1.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"