ultracite 5.0.48 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var ms=Object.create;var X=Object.defineProperty;var fs=Object.getOwnPropertyDescriptor;var gs=Object.getOwnPropertyNames;var hs=Object.getPrototypeOf,ys=Object.prototype.hasOwnProperty;var Ze=e=>t=>{var s=e[t];if(s)return s();throw new Error("Module not found in bundle: "+t)};var c=(e,t)=>()=>(e&&(t=e(e=0)),t);var u=(e,t)=>{for(var s in t)X(e,s,{get:t[s],enumerable:!0})},Xe=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of gs(t))!ys.call(e,o)&&o!==s&&X(e,o,{get:()=>t[o],enumerable:!(n=fs(t,o))||n.enumerable});return e};var y=(e,t,s)=>(s=e!=null?ms(hs(e)):{},Xe(t||!e||!e.__esModule?X(s,"default",{value:e,enumerable:!0}):s,e)),l=e=>Xe(X({},"__esModule",{value:!0}),e);var tt={};u(tt,{format:()=>pe});var Qe,et,pe,me=c(()=>{"use strict";Qe=require("child_process"),et=y(require("process")),pe=(e,t={})=>{try{let s=e.length>0?e.map(o=>`"${o}"`).join(" "):"./",n=t.unsafe?" --unsafe":"";(0,Qe.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),et.default.exit(1)}}});var nt={};u(nt,{exists:()=>i,isMonorepo:()=>ee});var Q,st,i,ee,m=c(()=>{"use strict";Q=require("fs/promises"),st=require("jsonc-parser"),i=async e=>{try{return await(0,Q.access)(e),!0}catch{return!1}},ee=async()=>{if(await i("pnpm-workspace.yaml"))return!0;try{let e=(0,st.parse)(await(0,Q.readFile)("package.json","utf-8"));return e?!!e.workspaces:!1}catch{return!1}}});var te,fe=c(()=>{te={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"5.0.47",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",commander:"^14.0.0",deepmerge:"^4.3.1","jsonc-parser":"^3.3.1",vitest:"^3.2.4"},packageManager:"pnpm@10.13.1"}});var at={};u(at,{biome:()=>N});var J,it,rt,bs,ot,ge,N,he=c(()=>{"use strict";J=require("fs/promises"),it=y(require("deepmerge")),rt=require("jsonc-parser");m();fe();bs=te.devDependencies["@biomejs/biome"],ot={$schema:`https://biomejs.dev/schemas/${bs}/schema.json`,extends:["ultracite"]},ge=async()=>await i("./biome.json")?"./biome.json":"./biome.jsonc",N={exists:async()=>{let e=await ge();return i(e)},create:async()=>{let e=await ge();return(0,J.writeFile)(e,JSON.stringify(ot,null,2))},update:async()=>{let e=await ge(),t=await(0,J.readFile)(e,"utf-8"),n=(0,rt.parse)(t)||{},o=n.extends&&Array.isArray(n.extends)?n.extends:[];o.includes("ultracite")||(n.extends=[...o,"ultracite"]);let r={$schema:ot.$schema},f=(0,it.default)(n,r);await(0,J.writeFile)(e,JSON.stringify(f,null,2))}}});var ct,lt,ut,dt,pt,mt,ft,gt,pn,d,w=c(()=>{"use strict";ct=["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."],lt=["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."],ut=["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.'],dt=["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"`.'],pt=["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."],mt=["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.'],ft=["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."],gt=["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."],pn=[...ct,...lt,...ut,...dt,...pt,...mt,...ft,...gt],d=`# Project Context
2
+ "use strict";var fs=Object.create;var te=Object.defineProperty;var gs=Object.getOwnPropertyDescriptor;var hs=Object.getOwnPropertyNames;var ys=Object.getPrototypeOf,ws=Object.prototype.hasOwnProperty;var et=e=>t=>{var s=e[t];if(s)return s();throw new Error("Module not found in bundle: "+t)};var u=(e,t)=>()=>(e&&(t=e(e=0)),t);var p=(e,t)=>{for(var s in t)te(e,s,{get:t[s],enumerable:!0})},tt=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of hs(t))!ws.call(e,o)&&o!==s&&te(e,o,{get:()=>t[o],enumerable:!(n=gs(t,o))||n.enumerable});return e};var w=(e,t,s)=>(s=e!=null?fs(ys(e)):{},tt(t||!e||!e.__esModule?te(s,"default",{value:e,enumerable:!0}):s,e)),d=e=>tt(te({},"__esModule",{value:!0}),e);var j,se=u(()=>{j={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"5.0.49",bin:{ultracite:"dist/index.js"},files:["biome.jsonc","dist"],scripts:{build:"tsup",test:"vitest run","test:coverage":"vitest --coverage"},main:"./biome.jsonc",author:"Hayden Bleasel <hello@haydenbleasel.com>",bugs:{url:"https://github.com/haydenbleasel/ultracite/issues"},homepage:"https://github.com/haydenbleasel/ultracite#readme",keywords:["ultracite","biome","linter","formatter","fixer"],license:"MIT",publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},repository:{type:"git",url:"git+https://github.com/haydenbleasel/ultracite.git"},devDependencies:{"@auto-it/all-contributors":"^11.3.0","@auto-it/first-time-contributor":"^11.3.0","@biomejs/biome":"2.1.2","@types/node":"^24.0.14","@vitest/coverage-v8":"3.2.4",tsup:"^8.5.0"},dependencies:{"@clack/prompts":"^0.11.0",deepmerge:"^4.3.1","jsonc-parser":"^3.3.1","trpc-cli":"^0.10.0",vitest:"^3.2.4",zod:"^4.0.5"},packageManager:"pnpm@10.13.1"}});var ot={};p(ot,{format:()=>ge});var st,nt,ge,he=u(()=>{"use strict";st=require("child_process"),nt=w(require("process")),ge=(e,t={})=>{try{let s=e.length>0?e.map(o=>`"${o}"`).join(" "):"./",n=t.unsafe?" --unsafe":"";(0,st.execSync)(`npx @biomejs/biome check --write${n} ${s}`,{stdio:"inherit"})}catch(s){let n=s instanceof Error?s.message:"Unknown error";console.error("Failed to run Ultracite:",n),nt.default.exit(1)}}});var rt={};p(rt,{exists:()=>i,isMonorepo:()=>T});var ne,it,i,T,f=u(()=>{"use strict";ne=require("fs/promises"),it=require("jsonc-parser"),i=async e=>{try{return await(0,ne.access)(e),!0}catch{return!1}},T=async()=>{if(await i("pnpm-workspace.yaml"))return!0;try{let e=(0,it.parse)(await(0,ne.readFile)("package.json","utf-8"));return e?!!e.workspaces:!1}catch{return!1}}});var ut={};p(ut,{biome:()=>W});var N,ct,lt,vs,at,ye,W,we=u(()=>{"use strict";N=require("fs/promises"),ct=w(require("deepmerge")),lt=require("jsonc-parser");f();se();vs=j.devDependencies["@biomejs/biome"],at={$schema:`https://biomejs.dev/schemas/${vs}/schema.json`,extends:["ultracite"]},ye=async()=>await i("./biome.json")?"./biome.json":"./biome.jsonc",W={exists:async()=>{let e=await ye();return i(e)},create:async()=>{let e=await ye();return(0,N.writeFile)(e,JSON.stringify(at,null,2))},update:async()=>{let e=await ye(),t=await(0,N.readFile)(e,"utf-8"),n=(0,lt.parse)(t)||{},o=n.extends&&Array.isArray(n.extends)?n.extends:[];o.includes("ultracite")||(n.extends=[...o,"ultracite"]);let r={$schema:at.$schema},l=(0,ct.default)(n,r);await(0,N.writeFile)(e,JSON.stringify(l,null,2))}}});var dt,pt,mt,ft,gt,ht,yt,wt,gn,m,b=u(()=>{"use strict";dt=["Don't use `accessKey` attribute on any HTML element.",'Don\'t set `aria-hidden="true"` on focusable elements.',"Don't add ARIA roles, states, and properties to elements that don't support them.","Don't use distracting elements like `<marquee>` or `<blink>`.","Only use the `scope` prop on `<th>` elements.","Don't assign non-interactive ARIA roles to interactive HTML elements.","Make sure label elements have text content and are associated with an input.","Don't assign interactive ARIA roles to non-interactive HTML elements.","Don't assign `tabIndex` to non-interactive HTML elements.","Don't use positive integers for `tabIndex` property.",`Don't include "image", "picture", or "photo" in img alt prop.`,"Don't use explicit role property that's the same as the implicit/default role.","Make static elements with click handlers use a valid role attribute.","Always include a `title` element for SVG elements.","Give all elements requiring alt text meaningful information for screen readers.","Make sure anchors have content that's accessible to screen readers.","Assign `tabIndex` to non-interactive HTML elements with `aria-activedescendant`.","Include all required ARIA attributes for elements with ARIA roles.","Make sure ARIA properties are valid for the element's supported roles.","Always include a `type` attribute for button elements.","Make elements with interactive roles and handlers focusable.","Give heading elements content that's accessible to screen readers (not hidden with `aria-hidden`).","Always include a `lang` attribute on the html element.","Always include a `title` attribute for iframe elements.","Accompany `onClick` with at least one of: `onKeyUp`, `onKeyDown`, or `onKeyPress`.","Accompany `onMouseOver`/`onMouseOut` with `onFocus`/`onBlur`.","Include caption tracks for audio and video elements.","Use semantic elements instead of role attributes in JSX.","Make sure all anchors are valid and navigable.","Ensure all ARIA properties (`aria-*`) are valid.","Use valid, non-abstract ARIA roles for elements with ARIA roles.","Use valid ARIA state and property values.","Use valid values for the `autocomplete` attribute on input elements.","Use correct ISO language/country codes for the `lang` attribute."],pt=["Don't use consecutive spaces in regular expression literals.","Don't use the `arguments` object.","Don't use primitive type aliases or misleading types.","Don't use the comma operator.","Don't use empty type parameters in type aliases and interfaces.","Don't write functions that exceed a given Cognitive Complexity score.","Don't nest describe() blocks too deeply in test files.","Don't use unnecessary boolean casts.","Don't use unnecessary callbacks with flatMap.","Use for...of statements instead of Array.forEach.","Don't create classes that only have static members (like a static namespace).","Don't use this and super in static contexts.","Don't use unnecessary catch clauses.","Don't use unnecessary constructors.","Don't use unnecessary continue statements.","Don't export empty modules that don't change anything.","Don't use unnecessary escape sequences in regular expression literals.","Don't use unnecessary fragments.","Don't use unnecessary labels.","Don't use unnecessary nested block statements.","Don't rename imports, exports, and destructured assignments to the same name.","Don't use unnecessary string or template literal concatenation.","Don't use String.raw in template literals when there are no escape sequences.","Don't use useless case statements in switch statements.","Don't use ternary operators when simpler alternatives exist.","Don't use useless `this` aliasing.","Don't use any or unknown as type constraints.","Don't initialize variables to undefined.","Don't use the void operators (they're not familiar).","Use arrow functions instead of function expressions.","Use Date.now() to get milliseconds since the Unix Epoch.","Use .flatMap() instead of map().flat() when possible.","Use literal property access instead of computed property access.","Don't use parseInt() or Number.parseInt() when binary, octal, or hexadecimal literals work.","Use concise optional chaining instead of chained logical expressions.","Use regular expression literals instead of the RegExp constructor when possible.","Don't use number literal object member names that aren't base 10 or use underscore separators.","Remove redundant terms from logical expressions.","Use while loops instead of for loops when you don't need initializer and update expressions.","Don't pass children as props.","Don't reassign const variables.","Don't use constant expressions in conditions.","Don't use `Math.min` and `Math.max` to clamp values when the result is constant.","Don't return a value from a constructor.","Don't use empty character classes in regular expression literals.","Don't use empty destructuring patterns.","Don't call global object properties as functions.","Don't declare functions and vars that are accessible outside their block.","Make sure builtins are correctly instantiated.","Don't use super() incorrectly inside classes. Also check that super() is called in classes that extend other constructors.","Don't use variables and function parameters before they're declared.","Don't use 8 and 9 escape sequences in string literals.","Don't use literal numbers that lose precision."],mt=["Don't use the return value of React.render.","Make sure all dependencies are correctly specified in React hooks.","Make sure all React hooks are called from the top level of component functions.","Don't forget key props in iterators and collection literals.","Don't destructure props inside JSX components in Solid projects.","Don't define React components inside other components.","Don't use event handlers on non-interactive elements.","Don't assign to React component props.","Don't use both `children` and `dangerouslySetInnerHTML` props on the same element.","Don't use dangerous JSX props.","Don't use Array index in keys.","Don't insert comments as text nodes.","Don't assign JSX properties multiple times.","Don't add extra closing tags for components without children.","Use `<>...</>` instead of `<Fragment>...</Fragment>`.",'Watch out for possible "wrong" semicolons inside JSX elements.'],ft=["Don't assign a value to itself.","Don't return a value from a setter.","Don't compare expressions that modify string case with non-compliant values.","Don't use lexical declarations in switch clauses.","Don't use variables that haven't been declared in the document.","Don't write unreachable code.","Make sure super() is called exactly once on every code path in a class constructor before this is accessed if the class has a superclass.","Don't use control flow statements in finally blocks.","Don't use optional chaining where undefined values aren't allowed.","Don't have unused function parameters.","Don't have unused imports.","Don't have unused labels.","Don't have unused private class members.","Don't have unused variables.","Make sure void (self-closing) elements don't have children.","Don't return a value from a function with the return type 'void'","Use isNaN() when checking for NaN.",'Make sure "for" loop update clauses move the counter in the right direction.',"Make sure typeof expressions are compared to valid values.","Make sure generator functions contain yield.","Don't use await inside loops.","Don't use bitwise operators.","Don't use expressions where the operation doesn't change the value.","Make sure Promise-like statements are handled appropriately.","Don't use __dirname and __filename in the global scope.","Prevent import cycles.","Don't use configured elements.","Don't hardcode sensitive data like API keys and tokens.","Don't let variable declarations shadow variables from outer scopes.","Don't use the TypeScript directive @ts-ignore.","Prevent duplicate polyfills from Polyfill.io.","Don't use useless backreferences in regular expressions that always match empty strings.","Don't use unnecessary escapes in string literals.","Don't use useless undefined.","Make sure getters and setters for the same property are next to each other in class and object definitions.","Make sure object literals are declared consistently (defaults to explicit definitions).","Use static Response methods instead of new Response() constructor when possible.","Make sure switch-case statements are exhaustive.","Make sure the `preconnect` attribute is used when using Google Fonts.","Use `Array#{indexOf,lastIndexOf}()` instead of `Array#{findIndex,findLastIndex}()` when looking for the index of an item.","Make sure iterable callbacks return consistent values.",'Use `with { type: "json" }` for JSON module imports.',"Use numeric separators in numeric literals.","Use object spread instead of `Object.assign()` when constructing new objects.","Always use the radix argument when using `parseInt()`.","Make sure JSDoc comment lines start with a single asterisk, except for the first one.","Include a description parameter for `Symbol()`.","Don't use spread (`...`) syntax on accumulators.","Don't use the `delete` operator.","Don't access namespace imports dynamically.","Don't use namespace imports.","Declare regex literals at the top level.",'Don\'t use `target="_blank"` without `rel="noopener"`.'],gt=["Don't use TypeScript enums.","Don't export imported variables.","Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions.","Don't use TypeScript namespaces.","Don't use non-null assertions with the `!` postfix operator.","Don't use parameter properties in class constructors.","Don't use user-defined types.","Use `as const` instead of literal types and type annotations.","Use either `T[]` or `Array<T>` consistently.","Initialize each enum member value explicitly.","Use `export type` for types.","Use `import type` for types.","Make sure all enum members are literal values.","Don't use TypeScript const enum.","Don't declare empty interfaces.","Don't let variables evolve into any type through reassignments.","Don't use the any type.","Don't misuse the non-null assertion operator (!) in TypeScript files.","Don't use implicit any type on variable declarations.","Don't merge interfaces and classes unsafely.","Don't use overload signatures that aren't next to each other.","Use the namespace keyword instead of the module keyword to declare TypeScript namespaces."],ht=["Don't use global `eval()`.","Don't use callbacks in asynchronous tests and hooks.","Don't use negation in `if` statements that have `else` clauses.","Don't use nested ternary expressions.","Don't reassign function parameters.","This rule lets you specify global variable names you don't want to use in your application.","Don't use specified modules when loaded by import or require.","Don't use constants whose value is the upper-case version of their name.","Use `String.slice()` instead of `String.substr()` and `String.substring()`.","Don't use template literals if you don't need interpolation or special-character handling.","Don't use `else` blocks when the `if` block breaks early.","Don't use yoda expressions.","Don't use Array constructors.","Use `at()` instead of integer index access.","Follow curly brace conventions.","Use `else if` instead of nested `if` statements in `else` clauses.","Use single `if` statements instead of nested `if` clauses.","Use `new` for all builtins except `String`, `Number`, and `Boolean`.","Use consistent accessibility modifiers on class properties and methods.","Use `const` declarations for variables that are only assigned once.","Put default function parameters and optional function parameters last.","Include a `default` clause in switch statements.","Use the `**` operator instead of `Math.pow`.","Use `for-of` loops when you need the index to extract an item from the iterated array.","Use `node:assert/strict` over `node:assert`.","Use the `node:` protocol for Node.js builtin modules.","Use Number properties instead of global ones.","Use assignment operator shorthand where possible.","Use function types instead of object types with call signatures.","Use template literals over string concatenation.","Use `new` when throwing an error.","Don't throw non-Error values.","Use `String.trimStart()` and `String.trimEnd()` over `String.trimLeft()` and `String.trimRight()`.","Use standard constants instead of approximated literals.","Don't assign values in expressions.","Don't use async functions as Promise executors.","Don't reassign exceptions in catch clauses.","Don't reassign class members.","Don't compare against -0.","Don't use labeled statements that aren't loops.","Don't use void type outside of generic or return types.","Don't use console.","Don't use control characters and escape sequences that match control characters in regular expression literals.","Don't use debugger.","Don't assign directly to document.cookie.","Use `===` and `!==`.","Don't use duplicate case labels.","Don't use duplicate class members.","Don't use duplicate conditions in if-else-if chains.","Don't use two keys with the same name inside objects.","Don't use duplicate function parameter names.","Don't have duplicate hooks in describe blocks.","Don't use empty block statements and static blocks.","Don't let switch clauses fall through.","Don't reassign function declarations.","Don't allow assignments to native objects and read-only global variables.","Use Number.isFinite instead of global isFinite.","Use Number.isNaN instead of global isNaN.","Don't assign to imported bindings.","Don't use irregular whitespace characters.","Don't use labels that share a name with a variable.","Don't use characters made with multiple code points in character class syntax.","Make sure to use new and constructor properly.","Don't use shorthand assign when the variable appears on both sides.","Don't use octal escape sequences in string literals.","Don't use Object.prototype builtins directly.","Don't redeclare variables, functions, classes, and types in the same scope.",`Don't have redundant "use strict".`,"Don't compare things where both sides are exactly the same.","Don't let identifiers shadow restricted names.","Don't use sparse arrays (arrays with holes).","Don't use template literal placeholder syntax in regular strings.","Don't use the then property.","Don't use unsafe negation.","Don't use var.","Don't use with statements in non-strict contexts.","Make sure async functions actually use await.","Make sure default clauses in switch statements come last.","Make sure to pass a message value when creating a built-in error.","Make sure get methods always return a value.","Use a recommended display strategy with Google Fonts.","Make sure for-in loops include an if statement.","Use Array.isArray() instead of instanceof Array.","Make sure to use the digits argument with Number#toFixed().",'Make sure to use the "use strict" directive in script files.'],yt=["Don't use `<img>` elements in Next.js projects.","Don't use `<head>` elements in Next.js projects.","Don't import next/document outside of pages/_document.jsx in Next.js projects.","Don't use the next/head module in pages/_document.js on Next.js projects."],wt=["Don't use export or module.exports in test files.","Don't use focused tests.","Make sure the assertion function, like expect, is placed inside an it() function call.","Don't use disabled tests."],gn=[...dt,...pt,...mt,...ft,...gt,...ht,...yt,...wt],m=`# Project Context
3
3
  Ultracite enforces strict type safety, accessibility standards, and consistent code quality for JavaScript/TypeScript projects using Biome's lightning-fast formatter and linter.
4
4
 
5
5
  ## Key Principles
@@ -17,35 +17,35 @@ Ultracite enforces strict type safety, accessibility standards, and consistent c
17
17
  ## Rules
18
18
 
19
19
  ### Accessibility (a11y)
20
- ${ct.map(e=>`- ${e}`).join(`
20
+ ${dt.map(e=>`- ${e}`).join(`
21
21
  `)}
22
22
 
23
23
  ### Code Complexity and Quality
24
- ${lt.map(e=>`- ${e}`).join(`
24
+ ${pt.map(e=>`- ${e}`).join(`
25
25
  `)}
26
26
 
27
27
  ### React and JSX Best Practices
28
- ${ut.map(e=>`- ${e}`).join(`
28
+ ${mt.map(e=>`- ${e}`).join(`
29
29
  `)}
30
30
 
31
31
  ### Correctness and Safety
32
- ${dt.map(e=>`- ${e}`).join(`
32
+ ${ft.map(e=>`- ${e}`).join(`
33
33
  `)}
34
34
 
35
35
  ### TypeScript Best Practices
36
- ${pt.map(e=>`- ${e}`).join(`
36
+ ${gt.map(e=>`- ${e}`).join(`
37
37
  `)}
38
38
 
39
39
  ### Style and Consistency
40
- ${mt.map(e=>`- ${e}`).join(`
40
+ ${ht.map(e=>`- ${e}`).join(`
41
41
  `)}
42
42
 
43
43
  ### Next.js Specific Rules
44
- ${ft.map(e=>`- ${e}`).join(`
44
+ ${yt.map(e=>`- ${e}`).join(`
45
45
  `)}
46
46
 
47
47
  ### Testing Best Practices
48
- ${gt.map(e=>`- ${e}`).join(`
48
+ ${wt.map(e=>`- ${e}`).join(`
49
49
  `)}
50
50
 
51
51
  ## Common Tasks
@@ -70,16 +70,16 @@ try {
70
70
  } catch (e) {
71
71
  console.log(e);
72
72
  }
73
- \`\`\``});var ht={};u(ht,{claude:()=>W});var C,ye,W,we=c(()=>{"use strict";C=require("fs/promises");w();m();ye="./.claude/CLAUDE.md",W={exists:()=>i(ye),create:async()=>{await(0,C.mkdir)(".claude",{recursive:!0}),await(0,C.writeFile)(ye,d)},update:async()=>{await(0,C.mkdir)(".claude",{recursive:!0}),await(0,C.writeFile)(ye,d)}}});var yt={};u(yt,{codex:()=>E});var ve,be,E,xe=c(()=>{"use strict";ve=require("fs/promises");w();m();be="./AGENTS.md",E={exists:()=>i(be),create:async()=>{await(0,ve.writeFile)(be,d)},update:async()=>{await(0,ve.writeFile)(be,d)}}});var wt={};u(wt,{cursor:()=>T});var j,ke,vs,T,De=c(()=>{"use strict";j=require("fs/promises");w();m();ke="./.cursor/rules/ultracite.mdc",vs=`---
73
+ \`\`\``});var bt={};p(bt,{claude:()=>L});var S,be,L,ve=u(()=>{"use strict";S=require("fs/promises");b();f();be="./.claude/CLAUDE.md",L={exists:()=>i(be),create:async()=>{await(0,S.mkdir)(".claude",{recursive:!0}),await(0,S.writeFile)(be,m)},update:async()=>{await(0,S.mkdir)(".claude",{recursive:!0}),await(0,S.writeFile)(be,m)}}});var vt={};p(vt,{codex:()=>_});var ke,xe,_,De=u(()=>{"use strict";ke=require("fs/promises");b();f();xe="./AGENTS.md",_={exists:()=>i(xe),create:async()=>{await(0,ke.writeFile)(xe,m)},update:async()=>{await(0,ke.writeFile)(xe,m)}}});var xt={};p(xt,{cursor:()=>q});var R,Ce,xs,q,je=u(()=>{"use strict";R=require("fs/promises");b();f();Ce="./.cursor/rules/ultracite.mdc",xs=`---
74
74
  description: Ultracite Rules - AI-Ready Formatter and Linter
75
75
  globs: "**/*.{ts,tsx,js,jsx}"
76
76
  alwaysApply: true
77
77
  ---
78
78
 
79
- ${d}`,T={exists:()=>i(ke),create:async()=>{await(0,j.mkdir)(".cursor/rules",{recursive:!0}),await(0,j.writeFile)(ke,vs)},update:async()=>{await(0,j.mkdir)(".cursor/rules",{recursive:!0}),await(0,j.writeFile)(ke,d)}}});var Dt={};u(Dt,{eslintCleanup:()=>se});var bt,vt,z,Ce,xt,kt,xs,ks,Ds,Cs,js,se,je=c(()=>{"use strict";bt=require("child_process"),vt=require("fs/promises"),z=require("fs/promises"),Ce=require("jsonc-parser");m();xt=[".eslintrc",".eslintrc.js",".eslintrc.json",".eslintrc.yml",".eslintrc.yaml",".eslintrc.config.js","eslint.config.js","eslint.config.mjs","eslint.config.cjs",".eslintignore"],kt=async()=>{try{let e=await(0,z.readFile)("package.json","utf-8"),t=(0,Ce.parse)(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(r=>r.startsWith("eslint")||r==="@eslint/js"||r==="@typescript-eslint/parser"||r==="@typescript-eslint/eslint-plugin")}catch{return[]}},xs=(e,t)=>{if(t.length===0)return;let s=t.join(" ");try{(0,bt.execSync)(`${e} ${s}`,{stdio:"pipe"})}catch{}},ks=async()=>{let e=[];for(let t of xt)if(await i(t))try{await(0,vt.unlink)(t),e.push(t)}catch{}return e},Ds=async()=>{let e="./.vscode/settings.json";if(!await i(e))return!1;try{let t=await(0,z.readFile)(e,"utf-8"),s=(0,Ce.parse)(t);if(!s||typeof s!="object")return!1;let n=!1,o={...s},r=["eslint.enable","eslint.format.enable","eslint.validate","eslint.workingDirectories","eslint.codeAction.showDocumentation","eslint.run","eslint.autoFixOnSave","eslint.quiet","eslint.packageManager","eslint.options","eslint.trace.server"];for(let f of r)f in o&&(delete o[f],n=!0);if("editor.codeActionsOnSave"in o){let f=o["editor.codeActionsOnSave"];if(f&&typeof f=="object"){let p=["source.fixAll.eslint","source.organizeImports.eslint"];for(let g of p)g in f&&(delete f[g],n=!0);Object.keys(f).length===0&&delete o["editor.codeActionsOnSave"]}}return n?(await(0,z.writeFile)(e,JSON.stringify(o,null,2)),!0):!1}catch{return!1}},Cs=async()=>{if((await kt()).length>0)return!0;for(let t of xt)if(await i(t))return!0;return!1},js=e=>e.startsWith("npm")?"npm uninstall":e.startsWith("yarn")?"yarn remove":e.startsWith("pnpm")?"pnpm remove":e.startsWith("bun")?"bun remove":"npm uninstall",se={hasESLint:Cs,remove:async e=>{let t=await kt(),s=js(e);xs(s,t);let n=await ks(),o=await Ds();return{packagesRemoved:t,filesRemoved:n,vsCodeCleaned:o}}}});var St={};u(St,{husky:()=>S});var jt,v,Ct,ne,S,Se=c(()=>{"use strict";jt=require("child_process"),v=require("fs/promises");m();Ct="npx ultracite format",ne="./.husky/pre-commit",S={exists:()=>i(ne),install:e=>{(0,jt.execSync)(`${e} -D husky`)},create:async()=>{await(0,v.mkdir)(".husky",{recursive:!0}),await(0,v.writeFile)(ne,Ct)},update:async()=>{let e=await(0,v.readFile)(ne,"utf-8");await(0,v.writeFile)(ne,`${e}
80
- ${Ct}`)}}});var Rt={};u(Rt,{kiro:()=>L});var R,Re,L,Ae=c(()=>{"use strict";R=require("fs/promises");w();m();Re="./.kiro/steering/linting-and-formatting.md",L={exists:()=>i(Re),create:async()=>{await(0,R.mkdir)(".kiro/steering",{recursive:!0}),await(0,R.writeFile)(Re,d)},update:async()=>{await(0,R.mkdir)(".kiro/steering",{recursive:!0}),await(0,R.writeFile)(Re,d)}}});var Pt={};u(Pt,{lefthook:()=>P});var Pe,x,oe,A,At,P,Fe=c(()=>{"use strict";Pe=require("child_process"),x=require("fs/promises");m();oe="npx ultracite format",A="./lefthook.yml",At=`pre-commit:
79
+ ${m}`,q={exists:()=>i(Ce),create:async()=>{await(0,R.mkdir)(".cursor/rules",{recursive:!0}),await(0,R.writeFile)(Ce,xs)},update:async()=>{await(0,R.mkdir)(".cursor/rules",{recursive:!0}),await(0,R.writeFile)(Ce,m)}}});var St={};p(St,{eslintCleanup:()=>oe});var kt,Dt,B,Se,Ct,jt,ks,Ds,Cs,js,Ss,oe,Re=u(()=>{"use strict";kt=require("child_process"),Dt=require("fs/promises"),B=require("fs/promises"),Se=require("jsonc-parser");f();Ct=[".eslintrc",".eslintrc.js",".eslintrc.json",".eslintrc.yml",".eslintrc.yaml",".eslintrc.config.js","eslint.config.js","eslint.config.mjs","eslint.config.cjs",".eslintignore"],jt=async()=>{try{let e=await(0,B.readFile)("package.json","utf-8"),t=(0,Se.parse)(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(r=>r.startsWith("eslint")||r==="@eslint/js"||r==="@typescript-eslint/parser"||r==="@typescript-eslint/eslint-plugin")}catch{return[]}},ks=(e,t)=>{if(t.length===0)return;let s=t.join(" ");try{(0,kt.execSync)(`${e} ${s}`,{stdio:"pipe"})}catch{}},Ds=async()=>{let e=[];for(let t of Ct)if(await i(t))try{await(0,Dt.unlink)(t),e.push(t)}catch{}return e},Cs=async()=>{let e="./.vscode/settings.json";if(!await i(e))return!1;try{let t=await(0,B.readFile)(e,"utf-8"),s=(0,Se.parse)(t);if(!s||typeof s!="object")return!1;let n=!1,o={...s},r=["eslint.enable","eslint.format.enable","eslint.validate","eslint.workingDirectories","eslint.codeAction.showDocumentation","eslint.run","eslint.autoFixOnSave","eslint.quiet","eslint.packageManager","eslint.options","eslint.trace.server"];for(let l of r)l in o&&(delete o[l],n=!0);if("editor.codeActionsOnSave"in o){let l=o["editor.codeActionsOnSave"];if(l&&typeof l=="object"){let c=["source.fixAll.eslint","source.organizeImports.eslint"];for(let g of c)g in l&&(delete l[g],n=!0);Object.keys(l).length===0&&delete o["editor.codeActionsOnSave"]}}return n?(await(0,B.writeFile)(e,JSON.stringify(o,null,2)),!0):!1}catch{return!1}},js=async()=>{if((await jt()).length>0)return!0;for(let t of Ct)if(await i(t))return!0;return!1},Ss=e=>e.startsWith("npm")?"npm uninstall":e.startsWith("yarn")?"yarn remove":e.startsWith("pnpm")?"pnpm remove":e.startsWith("bun")?"bun remove":"npm uninstall",oe={hasESLint:js,remove:async e=>{let t=await jt(),s=Ss(e);ks(s,t);let n=await Ds(),o=await Cs();return{packagesRemoved:t,filesRemoved:n,vsCodeCleaned:o}}}});var Ft={};p(Ft,{husky:()=>P});var Pt,x,Rt,ie,P,Pe=u(()=>{"use strict";Pt=require("child_process"),x=require("fs/promises");f();Rt="npx ultracite format",ie="./.husky/pre-commit",P={exists:()=>i(ie),install:e=>{(0,Pt.execSync)(`${e} -D husky`)},create:async()=>{await(0,x.mkdir)(".husky",{recursive:!0}),await(0,x.writeFile)(ie,Rt)},update:async()=>{let e=await(0,x.readFile)(ie,"utf-8");await(0,x.writeFile)(ie,`${e}
80
+ ${Rt}`)}}});var $t={};p($t,{kiro:()=>At});var F,Fe,At,Ae=u(()=>{"use strict";F=require("fs/promises");b();f();Fe="./.kiro/steering/linting-and-formatting.md",At={exists:()=>i(Fe),create:async()=>{await(0,F.mkdir)(".kiro/steering",{recursive:!0}),await(0,F.writeFile)(Fe,m)},update:async()=>{await(0,F.mkdir)(".kiro/steering",{recursive:!0}),await(0,F.writeFile)(Fe,m)}}});var It={};p(It,{lefthook:()=>$});var $e,k,re,A,Ut,$,Ue=u(()=>{"use strict";$e=require("child_process"),k=require("fs/promises");f();re="npx ultracite format",A="./lefthook.yml",Ut=`pre-commit:
81
81
  jobs:
82
- - run: ${oe}
82
+ - run: ${re}
83
83
  glob:
84
84
  - "*.js"
85
85
  - "*.jsx"
@@ -89,7 +89,7 @@ ${Ct}`)}}});var Rt={};u(Rt,{kiro:()=>L});var R,Re,L,Ae=c(()=>{"use strict";R=req
89
89
  - "*.jsonc"
90
90
  - "*.css"
91
91
  stage_fixed: true
92
- `,P={exists:()=>i(A),install:e=>{(0,Pe.execSync)(`${e} -D lefthook`),(0,Pe.execSync)("npx lefthook install")},create:async()=>{await(0,x.writeFile)(A,At)},update:async()=>{let e=await(0,x.readFile)(A,"utf-8");if(!e.includes(oe))if(e.includes("pre-commit:"))if(e.includes("jobs:")){let t=` - run: ${oe}
92
+ `,$={exists:()=>i(A),install:e=>{(0,$e.execSync)(`${e} -D lefthook`),(0,$e.execSync)("npx lefthook install")},create:async()=>{await(0,k.writeFile)(A,Ut)},update:async()=>{let e=await(0,k.readFile)(A,"utf-8");if(!e.includes(re))if(e.includes("pre-commit:"))if(e.includes("jobs:")){let t=` - run: ${re}
93
93
  glob:
94
94
  - "*.js"
95
95
  - "*.jsx"
@@ -99,8 +99,8 @@ ${Ct}`)}}});var Rt={};u(Rt,{kiro:()=>L});var R,Re,L,Ae=c(()=>{"use strict";R=req
99
99
  - "*.jsonc"
100
100
  - "*.css"
101
101
  stage_fixed: true`,s=e.replace(/(pre-commit:\s*\n\s*jobs:\s*\n)/,`$1${t}
102
- `);await(0,x.writeFile)(A,s)}else{let t=` jobs:
103
- - run: ${oe}
102
+ `);await(0,k.writeFile)(A,s)}else{let t=` jobs:
103
+ - run: ${re}
104
104
  glob:
105
105
  - "*.js"
106
106
  - "*.jsx"
@@ -110,8 +110,8 @@ ${Ct}`)}}});var Rt={};u(Rt,{kiro:()=>L});var R,Re,L,Ae=c(()=>{"use strict";R=req
110
110
  - "*.jsonc"
111
111
  - "*.css"
112
112
  stage_fixed: true`,s=e.replace(/(pre-commit:\s*\n)/,`$1${t}
113
- `);await(0,x.writeFile)(A,s)}else await(0,x.writeFile)(A,`${e}
114
- ${At}`)}}});var $t={};u($t,{lint:()=>Ue});var Ft,Ut,Ue,$e=c(()=>{"use strict";Ft=require("child_process"),Ut=y(require("process")),Ue=e=>{try{let t=e.length>0?e.map(s=>`"${s}"`).join(" "):"./";(0,Ft.execSync)(`npx @biomejs/biome check ${t}`,{stdio:"inherit"})}catch(t){let s=t instanceof Error?t.message:"Unknown error";console.error("Failed to run Ultracite:",s),Ut.default.exit(1)}}});var Mt={};u(Mt,{packageManager:()=>re});var ie,It,re,Ie=c(()=>{"use strict";ie=require("@clack/prompts");m();It=[{hint:"Recommended",label:"pnpm",value:"pnpm add",lockfile:"pnpm-lock.yaml",monorepoSuffix:"-w"},{label:"bun",value:"bun add",lockfile:"bun.lockb",monorepoSuffix:""},{label:"yarn",value:"yarn add",lockfile:"yarn.lock",monorepoSuffix:""},{label:"npm",value:"npm install --legacy-peer-deps",lockfile:"package-lock.json",monorepoSuffix:"--workspace ."}],re={get:async()=>{let e=await ee();e&&ie.log.info("Monorepo detected, updating install command to include workspace flag");for(let t of It)if(await i(t.lockfile))return e&&t.monorepoSuffix?`${t.value} ${t.monorepoSuffix}`:t.value;return null},select:async()=>{let e=await ee(),t=await(0,ie.select)({initialValue:"pnpm",message:"Which package manager do you use?",options:It.map(s=>({label:s.label,value:e&&s.monorepoSuffix?`${s.value} ${s.monorepoSuffix}`:s.value}))});return typeof t!="string"?null:t}}});var Et={};u(Et,{prettierCleanup:()=>ae});var Ot,Jt,_,Me,Nt,Wt,Ss,Rs,As,Ps,Fs,ae,Oe=c(()=>{"use strict";Ot=require("child_process"),Jt=require("fs/promises"),_=require("fs/promises"),Me=require("jsonc-parser");m();Nt=[".prettierrc",".prettierrc.js",".prettierrc.json",".prettierrc.yml",".prettierrc.yaml",".prettierrc.config.js","prettier.config.js","prettier.config.mjs",".prettierignore"],Wt=async()=>{try{let e=await(0,_.readFile)("package.json","utf-8"),t=(0,Me.parse)(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(r=>r.startsWith("prettier")||r==="eslint-config-prettier"||r==="eslint-plugin-prettier")}catch{return[]}},Ss=(e,t)=>{if(t.length===0)return;let s=t.join(" ");try{(0,Ot.execSync)(`${e} ${s}`,{stdio:"pipe"})}catch{}},Rs=async()=>{let e=[];for(let t of Nt)if(await i(t))try{await(0,Jt.unlink)(t),e.push(t)}catch{}return e},As=async()=>{let e="./.vscode/settings.json";if(!await i(e))return!1;try{let t=await(0,_.readFile)(e,"utf-8"),s=(0,Me.parse)(t);if(!s||typeof s!="object")return!1;let n=!1,o={...s},r=["editor.defaultFormatter","prettier.enable","prettier.requireConfig","prettier.configPath","prettier.printWidth","prettier.tabWidth","prettier.useTabs","prettier.semi","prettier.singleQuote","prettier.quoteProps","prettier.trailingComma","prettier.bracketSpacing","prettier.arrowParens","prettier.endOfLine"];for(let p of r)p in o&&(p==="editor.defaultFormatter"&&o[p]==="esbenp.prettier-vscode"||p!=="editor.defaultFormatter")&&(delete o[p],n=!0);let f=Object.keys(o).filter(p=>p.startsWith("[")&&p.includes("javascript"));for(let p of f){let g=o[p];g&&typeof g=="object"&&"editor.defaultFormatter"in g&&g["editor.defaultFormatter"]==="esbenp.prettier-vscode"&&(delete g["editor.defaultFormatter"],n=!0,Object.keys(g).length===0&&delete o[p])}return n?(await(0,_.writeFile)(e,JSON.stringify(o,null,2)),!0):!1}catch{return!1}},Ps=async()=>{if((await Wt()).length>0)return!0;for(let t of Nt)if(await i(t))return!0;return!1},Fs=e=>e.startsWith("npm")?"npm uninstall":e.startsWith("yarn")?"yarn remove":e.startsWith("pnpm")?"pnpm remove":e.startsWith("bun")?"bun remove":"npm uninstall",ae={hasPrettier:Ps,remove:async e=>{let t=await Wt(),s=Fs(e);Ss(s,t);let n=await Rs(),o=await As();return{packagesRemoved:t,filesRemoved:n,vsCodeCleaned:o}}}});var Tt={};u(Tt,{title:()=>Je});var Je,Ne=c(()=>{"use strict";Je=`
113
+ `);await(0,k.writeFile)(A,s)}else await(0,k.writeFile)(A,`${e}
114
+ ${Ut}`)}}});var Et={};p(Et,{lint:()=>Ie});var Mt,Ot,Ie,Me=u(()=>{"use strict";Mt=require("child_process"),Ot=w(require("process")),Ie=e=>{try{let t=e.length>0?e.map(s=>`"${s}"`).join(" "):"./";(0,Mt.execSync)(`npx @biomejs/biome check ${t}`,{stdio:"inherit"})}catch(t){let s=t instanceof Error?t.message:"Unknown error";console.error("Failed to run Ultracite:",s),Ot.default.exit(1)}}});var zt={};p(zt,{packageManager:()=>U});var ae,Oe,U,Ee=u(()=>{"use strict";ae=require("@clack/prompts");f();Oe=[{hint:"Recommended",label:"pnpm",value:"pnpm add",lockfiles:["pnpm-lock.yaml"],monorepoSuffix:"-w"},{label:"bun",value:"bun add",lockfiles:["bun.lockb","bun.lock"],monorepoSuffix:""},{label:"yarn",value:"yarn add",lockfiles:["yarn.lock"],monorepoSuffix:""},{label:"npm",value:"npm install --legacy-peer-deps",lockfiles:["package-lock.json"],monorepoSuffix:"--workspace ."}],U={get:async()=>{let e=await T();e&&ae.log.info("Monorepo detected, updating install command to include workspace flag");for(let t of Oe){let s=!1;for(let n of t.lockfiles)if(await i(n)){s=!0;break}if(s)return e&&t.monorepoSuffix?`${t.value} ${t.monorepoSuffix}`:t.value}return null},select:async()=>{let e=await T(),t=await(0,ae.select)({initialValue:"pnpm",message:"Which package manager do you use?",options:Oe.map(s=>({label:s.label,value:e&&s.monorepoSuffix?`${s.value} ${s.monorepoSuffix}`:s.value}))});return typeof t!="string"?null:t},isMonorepo:T,options:Oe}});var Lt={};p(Lt,{prettierCleanup:()=>ce});var Jt,Tt,H,ze,Nt,Wt,Rs,Ps,Fs,As,$s,ce,Je=u(()=>{"use strict";Jt=require("child_process"),Tt=require("fs/promises"),H=require("fs/promises"),ze=require("jsonc-parser");f();Nt=[".prettierrc",".prettierrc.js",".prettierrc.json",".prettierrc.yml",".prettierrc.yaml",".prettierrc.config.js","prettier.config.js","prettier.config.mjs",".prettierignore"],Wt=async()=>{try{let e=await(0,H.readFile)("package.json","utf-8"),t=(0,ze.parse)(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(r=>r.startsWith("prettier")||r==="eslint-config-prettier"||r==="eslint-plugin-prettier")}catch{return[]}},Rs=(e,t)=>{if(t.length===0)return;let s=t.join(" ");try{(0,Jt.execSync)(`${e} ${s}`,{stdio:"pipe"})}catch{}},Ps=async()=>{let e=[];for(let t of Nt)if(await i(t))try{await(0,Tt.unlink)(t),e.push(t)}catch{}return e},Fs=async()=>{let e="./.vscode/settings.json";if(!await i(e))return!1;try{let t=await(0,H.readFile)(e,"utf-8"),s=(0,ze.parse)(t);if(!s||typeof s!="object")return!1;let n=!1,o={...s},r=["editor.defaultFormatter","prettier.enable","prettier.requireConfig","prettier.configPath","prettier.printWidth","prettier.tabWidth","prettier.useTabs","prettier.semi","prettier.singleQuote","prettier.quoteProps","prettier.trailingComma","prettier.bracketSpacing","prettier.arrowParens","prettier.endOfLine"];for(let c of r)c in o&&(c==="editor.defaultFormatter"&&o[c]==="esbenp.prettier-vscode"||c!=="editor.defaultFormatter")&&(delete o[c],n=!0);let l=Object.keys(o).filter(c=>c.startsWith("[")&&c.includes("javascript"));for(let c of l){let g=o[c];g&&typeof g=="object"&&"editor.defaultFormatter"in g&&g["editor.defaultFormatter"]==="esbenp.prettier-vscode"&&(delete g["editor.defaultFormatter"],n=!0,Object.keys(g).length===0&&delete o[c])}return n?(await(0,H.writeFile)(e,JSON.stringify(o,null,2)),!0):!1}catch{return!1}},As=async()=>{if((await Wt()).length>0)return!0;for(let t of Nt)if(await i(t))return!0;return!1},$s=e=>e.startsWith("npm")?"npm uninstall":e.startsWith("yarn")?"yarn remove":e.startsWith("pnpm")?"pnpm remove":e.startsWith("bun")?"bun remove":"npm uninstall",ce={hasPrettier:As,remove:async e=>{let t=await Wt(),s=$s(e);Rs(s,t);let n=await Ps(),o=await Fs();return{packagesRemoved:t,filesRemoved:n,vsCodeCleaned:o}}}});var _t={};p(_t,{title:()=>Te});var Te,Ne=u(()=>{"use strict";Te=`
115
115
  888 888 888 88888888888 8888888b. d8888 .d8888b. 8888888 88888888888 8888888888
116
116
  888 888 888 888 888 Y88b d88888 d88P Y88b 888 888 888
117
117
  888 888 888 888 888 888 d88P888 888 888 888 888 888
@@ -120,16 +120,16 @@ ${At}`)}}});var $t={};u($t,{lint:()=>Ue});var Ft,Ut,Ue,$e=c(()=>{"use strict";Ft
120
120
  888 888 888 888 888 T88b d88P 888 888 888 888 888 888
121
121
  Y88b. .d88P 888 888 888 T88b d8888888888 Y88b d88P 888 888 888
122
122
  "Y88888P" 88888888 888 888 T88b d88P 888 "Y8888P" 8888888 888 8888888888
123
- `});var qt={};u(qt,{tsconfig:()=>B});var q,Lt,_t,zt,ce,B,We=c(()=>{"use strict";q=require("fs/promises"),Lt=y(require("deepmerge")),_t=require("jsonc-parser");m();zt={compilerOptions:{strictNullChecks:!0}},ce="./tsconfig.json",B={exists:()=>i(ce),create:()=>(0,q.writeFile)(ce,JSON.stringify(zt,null,2)),update:async()=>{let e=await(0,q.readFile)(ce,"utf-8"),s=(0,_t.parse)(e)||{},n=(0,Lt.default)(s,zt);await(0,q.writeFile)(ce,JSON.stringify(n,null,2))}}});var Ht={};u(Ht,{vscodeCopilot:()=>H});var F,Ee,Bt,H,Te=c(()=>{"use strict";F=require("fs/promises");w();m();Ee="./.github/copilot-instructions.md",Bt=`---
123
+ `});var Kt={};p(Kt,{tsconfig:()=>V});var K,Bt,Ht,qt,le,V,We=u(()=>{"use strict";K=require("fs/promises"),Bt=w(require("deepmerge")),Ht=require("jsonc-parser");f();qt={compilerOptions:{strictNullChecks:!0}},le="./tsconfig.json",V={exists:()=>i(le),create:()=>(0,K.writeFile)(le,JSON.stringify(qt,null,2)),update:async()=>{let e=await(0,K.readFile)(le,"utf-8"),s=(0,Ht.parse)(e)||{},n=(0,Bt.default)(s,qt);await(0,K.writeFile)(le,JSON.stringify(n,null,2))}}});var Gt={};p(Gt,{vscodeCopilot:()=>G});var I,Le,Vt,G,_e=u(()=>{"use strict";I=require("fs/promises");b();f();Le="./.github/copilot-instructions.md",Vt=`---
124
124
  applyTo: "**/*.{ts,tsx,js,jsx}"
125
125
  ---
126
126
 
127
- ${d}`,H={exists:()=>i(Ee),create:async()=>{await(0,F.mkdir)(".github",{recursive:!0}),await(0,F.writeFile)(Ee,Bt)},update:async()=>{await(0,F.mkdir)(".github",{recursive:!0}),await(0,F.writeFile)(Ee,Bt)}}});var Yt={};u(Yt,{vscode:()=>K});var k,Vt,Gt,Kt,le,K,ze=c(()=>{"use strict";k=require("fs/promises"),Vt=y(require("deepmerge")),Gt=require("jsonc-parser");m();Kt={"editor.defaultFormatter":"esbenp.prettier-vscode","[javascript][typescript][javascriptreact][typescriptreact][json][jsonc][css][graphql]":{"editor.defaultFormatter":"biomejs.biome"},"typescript.tsdk":"node_modules/typescript/lib","editor.formatOnSave":!0,"editor.formatOnPaste":!0,"emmet.showExpandedAbbreviation":"never","editor.codeActionsOnSave":{"source.fixAll.biome":"explicit","source.organizeImports.biome":"explicit"}},le="./.vscode/settings.json",K={exists:()=>i(le),create:async()=>{await(0,k.mkdir)(".vscode",{recursive:!0}),await(0,k.writeFile)(le,JSON.stringify(Kt,null,2))},update:async()=>{let e=await(0,k.readFile)(le,"utf-8"),s=(0,Gt.parse)(e)||{},n=(0,Vt.default)(s,Kt);await(0,k.writeFile)(le,JSON.stringify(n,null,2))}}});var Zt={};u(Zt,{windsurf:()=>V});var U,Le,V,_e=c(()=>{"use strict";U=require("fs/promises");w();m();Le="./.windsurf/rules/ultracite.md",V={exists:()=>i(Le),create:async()=>{await(0,U.mkdir)(".windsurf/rules",{recursive:!0}),await(0,U.writeFile)(Le,d)},update:async()=>{await(0,U.mkdir)(".windsurf/rules",{recursive:!0}),await(0,U.writeFile)(Le,d)}}});var ts={};u(ts,{zed:()=>G});var D,Qt,es,Xt,ue,G,qe=c(()=>{"use strict";D=require("fs/promises"),Qt=y(require("deepmerge")),es=require("jsonc-parser");m();Xt={formatter:"language_server",format_on_save:"on",languages:{JavaScript:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},TypeScript:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},JSX:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},TSX:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}}},lsp:{"typescript-language-server":{settings:{typescript:{preferences:{includePackageJsonAutoImports:"on"}}}}}},ue="./.zed/settings.json",G={exists:()=>i(ue),create:async()=>{await(0,D.mkdir)(".zed",{recursive:!0}),await(0,D.writeFile)(ue,JSON.stringify(Xt,null,2))},update:async()=>{let e=await(0,D.readFile)(ue,"utf-8"),s=(0,es.parse)(e)||{},n=(0,Qt.default)(s,Xt);await(0,D.writeFile)(ue,JSON.stringify(n,null,2))}}});var ss={};u(ss,{zedCopilot:()=>Y});var I,$,Y,Be=c(()=>{"use strict";I=require("fs/promises");w();m();$="./.rules",Y={exists:()=>i($),create:async()=>{await(0,I.writeFile)($,d)},update:async()=>{if(!await i($)){await(0,I.writeFile)($,d);return}let e=await(0,I.readFile)($,"utf-8");e.includes(d.trim())||await(0,I.writeFile)($,`${e}
127
+ ${m}`,G={exists:()=>i(Le),create:async()=>{await(0,I.mkdir)(".github",{recursive:!0}),await(0,I.writeFile)(Le,Vt)},update:async()=>{await(0,I.mkdir)(".github",{recursive:!0}),await(0,I.writeFile)(Le,Vt)}}});var Qt={};p(Qt,{vscode:()=>Y});var D,Zt,Xt,Yt,ue,Y,qe=u(()=>{"use strict";D=require("fs/promises"),Zt=w(require("deepmerge")),Xt=require("jsonc-parser");f();Yt={"editor.defaultFormatter":"esbenp.prettier-vscode","[javascript]":{"editor.defaultFormatter":"biomejs.biome"},"[typescript]":{"editor.defaultFormatter":"biomejs.biome"},"[javascriptreact]":{"editor.defaultFormatter":"biomejs.biome"},"[typescriptreact]":{"editor.defaultFormatter":"biomejs.biome"},"[json]":{"editor.defaultFormatter":"biomejs.biome"},"[jsonc]":{"editor.defaultFormatter":"biomejs.biome"},"[css]":{"editor.defaultFormatter":"biomejs.biome"},"[graphql]":{"editor.defaultFormatter":"biomejs.biome"},"typescript.tsdk":"node_modules/typescript/lib","editor.formatOnSave":!0,"editor.formatOnPaste":!0,"emmet.showExpandedAbbreviation":"never","editor.codeActionsOnSave":{"source.fixAll.biome":"explicit","source.organizeImports.biome":"explicit"}},ue="./.vscode/settings.json",Y={exists:()=>i(ue),create:async()=>{await(0,D.mkdir)(".vscode",{recursive:!0}),await(0,D.writeFile)(ue,JSON.stringify(Yt,null,2))},update:async()=>{let e=await(0,D.readFile)(ue,"utf-8"),s=(0,Xt.parse)(e)||{},n=(0,Zt.default)(s,Yt);await(0,D.writeFile)(ue,JSON.stringify(n,null,2))}}});var es={};p(es,{windsurf:()=>Z});var M,Be,Z,He=u(()=>{"use strict";M=require("fs/promises");b();f();Be="./.windsurf/rules/ultracite.md",Z={exists:()=>i(Be),create:async()=>{await(0,M.mkdir)(".windsurf/rules",{recursive:!0}),await(0,M.writeFile)(Be,m)},update:async()=>{await(0,M.mkdir)(".windsurf/rules",{recursive:!0}),await(0,M.writeFile)(Be,m)}}});var os={};p(os,{zed:()=>X});var C,ss,ns,ts,de,X,Ke=u(()=>{"use strict";C=require("fs/promises"),ss=w(require("deepmerge")),ns=require("jsonc-parser");f();ts={formatter:"language_server",format_on_save:"on",languages:{JavaScript:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},TypeScript:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},JSX:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},TSX:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}}},lsp:{"typescript-language-server":{settings:{typescript:{preferences:{includePackageJsonAutoImports:"on"}}}}}},de="./.zed/settings.json",X={exists:()=>i(de),create:async()=>{await(0,C.mkdir)(".zed",{recursive:!0}),await(0,C.writeFile)(de,JSON.stringify(ts,null,2))},update:async()=>{let e=await(0,C.readFile)(de,"utf-8"),s=(0,ns.parse)(e)||{},n=(0,ss.default)(s,ts);await(0,C.writeFile)(de,JSON.stringify(n,null,2))}}});var is={};p(is,{zedCopilot:()=>Q});var E,O,Q,Ve=u(()=>{"use strict";E=require("fs/promises");b();f();O="./.rules",Q={exists:()=>i(O),create:async()=>{await(0,E.writeFile)(O,m)},update:async()=>{if(!await i(O)){await(0,E.writeFile)(O,m);return}let e=await(0,E.readFile)(O,"utf-8");e.includes(m.trim())||await(0,E.writeFile)(O,`${e}
128
128
 
129
- ${d}`)}}});var $s,He=c(()=>{$s=Ze({"./biome.ts":()=>(he(),l(at)),"./claude.ts":()=>(we(),l(ht)),"./codex.ts":()=>(xe(),l(yt)),"./cursor.ts":()=>(De(),l(wt)),"./eslint-cleanup.ts":()=>(je(),l(Dt)),"./format.ts":()=>(me(),l(tt)),"./husky.ts":()=>(Se(),l(St)),"./index.ts":()=>(is(),l(Us)),"./initialize.ts":()=>(Ve(),l(os)),"./kiro.ts":()=>(Ae(),l(Rt)),"./lefthook.ts":()=>(Fe(),l(Pt)),"./lint-staged.ts":()=>(Ke(),l(ns)),"./lint.ts":()=>($e(),l($t)),"./package-manager.ts":()=>(Ie(),l(Mt)),"./prettier-cleanup.ts":()=>(Oe(),l(Et)),"./title.ts":()=>(Ne(),l(Tt)),"./tsconfig.ts":()=>(We(),l(qt)),"./utils.ts":()=>(m(),l(nt)),"./vscode-copilot.ts":()=>(Te(),l(Ht)),"./vscode-settings.ts":()=>(ze(),l(Yt)),"./windsurf.ts":()=>(_e(),l(Zt)),"./zed-settings.ts":()=>(qe(),l(ts)),"./zed.ts":()=>(Be(),l(ss))})});var ns={};u(ns,{lintStaged:()=>O});var as,h,cs,M,de,b,rs,Is,Ms,Os,Js,Ns,Ws,Es,Ts,zs,Ge,Ls,O,Ke=c(()=>{"use strict";as=require("child_process"),h=require("fs/promises"),cs=require("url"),M=y(require("deepmerge")),de=require("jsonc-parser");m();He();b={"*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}":["npx ultracite format"]},rs=["./package.json","./.lintstagedrc.json","./.lintstagedrc.js","./.lintstagedrc.cjs","./.lintstagedrc.mjs","./lint-staged.config.js","./lint-staged.config.cjs","./lint-staged.config.mjs","./.lintstagedrc.yaml","./.lintstagedrc.yml","./.lintstagedrc"],Is=(e,t,s,n)=>{let o=e.trim();if(o.includes(":")&&!o.startsWith("-")){s&&n.length>0&&(t[s]=n);let[r,...f]=o.split(":"),p=f.join(":").trim(),g=r.trim().replace(/['"]/g,"");return p&&p!==""?(p.startsWith("[")&&p.endsWith("]")?t[g]=p.slice(1,-1).split(",").map(ps=>ps.trim().replace(/['"]/g,"")):t[g]=p.replace(/['"]/g,""),{newCurrentKey:null,newCurrentArray:[]}):{newCurrentKey:g,newCurrentArray:[]}}if(o.startsWith("-")&&s){let r=[...n,o.slice(1).trim().replace(/['"]/g,"")];return{newCurrentKey:s,newCurrentArray:r}}return{newCurrentKey:s,newCurrentArray:n}},Ms=e=>{let t=e.split(`
130
- `).filter(r=>r.trim()&&!r.trim().startsWith("#")),s={},n=null,o=[];for(let r of t){let f=Is(r,s,n,o);n=f.newCurrentKey,o=f.newCurrentArray}return n&&o.length>0&&(s[n]=o),s},Os=e=>{let t="";for(let[s,n]of Object.entries(e))if(Array.isArray(n)){t+=`${s}:
129
+ ${m}`)}}});var Is,Ge=u(()=>{Is=et({"./biome.ts":()=>(we(),d(ut)),"./claude.ts":()=>(ve(),d(bt)),"./codex.ts":()=>(De(),d(vt)),"./cursor.ts":()=>(je(),d(xt)),"./eslint-cleanup.ts":()=>(Re(),d(St)),"./format.ts":()=>(he(),d(ot)),"./husky.ts":()=>(Pe(),d(Ft)),"./index.ts":()=>(cs(),d(Us)),"./initialize.ts":()=>(Ze(),d(as)),"./kiro.ts":()=>(Ae(),d($t)),"./lefthook.ts":()=>(Ue(),d(It)),"./lint-staged.ts":()=>(Ye(),d(rs)),"./lint.ts":()=>(Me(),d(Et)),"./package-manager.ts":()=>(Ee(),d(zt)),"./prettier-cleanup.ts":()=>(Je(),d(Lt)),"./title.ts":()=>(Ne(),d(_t)),"./tsconfig.ts":()=>(We(),d(Kt)),"./utils.ts":()=>(f(),d(rt)),"./vscode-copilot.ts":()=>(_e(),d(Gt)),"./vscode-settings.ts":()=>(qe(),d(Qt)),"./windsurf.ts":()=>(He(),d(es)),"./zed-settings.ts":()=>(Ke(),d(os)),"./zed.ts":()=>(Ve(),d(is))})});var rs={};p(rs,{lintStaged:()=>J});var us,y,ds,z,pe,v,ls,Ms,Os,Es,zs,Js,Ts,Ns,Ws,Ls,Xe,_s,J,Ye=u(()=>{"use strict";us=require("child_process"),y=require("fs/promises"),ds=require("url"),z=w(require("deepmerge")),pe=require("jsonc-parser");f();Ge();v={"*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}":["npx ultracite format"]},ls=["./package.json","./.lintstagedrc.json","./.lintstagedrc.js","./.lintstagedrc.cjs","./.lintstagedrc.mjs","./lint-staged.config.js","./lint-staged.config.cjs","./lint-staged.config.mjs","./.lintstagedrc.yaml","./.lintstagedrc.yml","./.lintstagedrc"],Ms=(e,t,s,n)=>{let o=e.trim();if(o.includes(":")&&!o.startsWith("-")){s&&n.length>0&&(t[s]=n);let[r,...l]=o.split(":"),c=l.join(":").trim(),g=r.trim().replace(/['"]/g,"");return c&&c!==""?(c.startsWith("[")&&c.endsWith("]")?t[g]=c.slice(1,-1).split(",").map(ee=>ee.trim().replace(/['"]/g,"")):t[g]=c.replace(/['"]/g,""),{newCurrentKey:null,newCurrentArray:[]}):{newCurrentKey:g,newCurrentArray:[]}}if(o.startsWith("-")&&s){let r=[...n,o.slice(1).trim().replace(/['"]/g,"")];return{newCurrentKey:s,newCurrentArray:r}}return{newCurrentKey:s,newCurrentArray:n}},Os=e=>{let t=e.split(`
130
+ `).filter(r=>r.trim()&&!r.trim().startsWith("#")),s={},n=null,o=[];for(let r of t){let l=Ms(r,s,n,o);n=l.newCurrentKey,o=l.newCurrentArray}return n&&o.length>0&&(s[n]=o),s},Es=e=>{let t="";for(let[s,n]of Object.entries(e))if(Array.isArray(n)){t+=`${s}:
131
131
  `;for(let o of n)t+=` - '${o}'
132
132
  `}else t+=`${s}: '${n}'
133
- `;return t},Js=async()=>{try{let e=(0,de.parse)(await(0,h.readFile)("./package.json","utf-8"));return e?e.type==="module":!1}catch{return!1}},Ns=async()=>{let e=(0,de.parse)(await(0,h.readFile)("./package.json","utf-8"));e&&(e["lint-staged"]?e["lint-staged"]=(0,M.default)(e["lint-staged"],b):e["lint-staged"]=b,await(0,h.writeFile)("./package.json",JSON.stringify(e,null,2)))},Ws=async e=>{let t=await(0,h.readFile)(e,"utf-8"),s=(0,de.parse)(t);if(!s)return;let n=(0,M.default)(s,b);await(0,h.writeFile)(e,JSON.stringify(n,null,2))},Es=async e=>{let t=await(0,h.readFile)(e,"utf-8"),s=Ms(t);if(!s)return;let n=(0,M.default)(s,b);await(0,h.writeFile)(e,Os(n))},Ts=async e=>{let n=(await import((0,cs.pathToFileURL)(e).href)).default||{},o=(0,M.default)(n,b),r=`export default ${JSON.stringify(o,null,2)};
134
- `;await(0,h.writeFile)(e,r)},zs=async e=>{delete require.cache[require.resolve(`./${e}`)];let t=$s(`./${e}`),s=(0,M.default)(t,b),n=`module.exports = ${JSON.stringify(s,null,2)};
135
- `;await(0,h.writeFile)(e,n)},Ge=async()=>{await(0,h.writeFile)(".lintstagedrc.json",JSON.stringify(b,null,2))},Ls=async e=>{if(e==="./package.json"){await Ns();return}if(e.endsWith(".json")||e==="./.lintstagedrc"){await Ws(e);return}if(e.endsWith(".yaml")||e.endsWith(".yml")){await Es(e);return}let t=await Js();if(e.endsWith(".mjs")||e.endsWith(".js")&&t){try{await Ts(e)}catch{await Ge()}return}if(e.endsWith(".cjs")||e.endsWith(".js")&&!t)try{await zs(e)}catch{await Ge()}},O={exists:async()=>{for(let e of rs)if(await i(e))return!0;return!1},install:e=>{(0,as.execSync)(`${e} -D lint-staged`)},create:async()=>{await(0,h.writeFile)(".lintstagedrc.json",JSON.stringify(b,null,2))},update:async()=>{let e=null;for(let t of rs)if(await i(t)){e=t;break}if(!e){await Ge();return}await Ls(e)}}});var os={};u(os,{initialize:()=>Ye});var ls,us,a,_s,qs,Bs,Hs,Ks,Vs,Gs,Ys,Zs,Xs,Qs,en,tn,sn,nn,on,rn,an,Ye,Ve=c(()=>{"use strict";ls=require("child_process"),us=y(require("process")),a=require("@clack/prompts");he();we();xe();De();je();Se();Ae();Fe();Ke();Ie();Oe();Ne();We();Te();ze();_e();Be();qe();fe();_s=te.devDependencies["@biomejs/biome"],qs=e=>{let t=(0,a.spinner)();t.start("Installing dependencies..."),(0,ls.execSync)(`${e} -D -E ultracite @biomejs/biome@${_s}`),t.stop("Dependencies installed.")},Bs=async()=>{let e=(0,a.spinner)();if(e.start("Checking for tsconfig.json..."),await B.exists()){e.message("tsconfig.json found, updating..."),await B.update(),e.stop("tsconfig.json updated.");return}e.message("tsconfig.json not found, creating..."),await B.create(),e.stop("tsconfig.json created.")},Hs=async()=>{let e=(0,a.spinner)();if(e.start("Checking for .vscode/settings.json..."),await K.exists()){e.message("settings.json found, updating..."),await K.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await K.create(),e.stop("settings.json created.")},Ks=async()=>{let e=(0,a.spinner)();if(e.start("Checking for .zed/settings.json..."),await G.exists()){e.message("settings.json found, updating..."),await G.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await G.create(),e.stop("settings.json created.")},Vs=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Biome configuration..."),await N.exists()){e.message("Biome configuration found, updating..."),await N.update(),e.stop("Biome configuration updated.");return}e.message("Biome configuration not found, creating..."),await N.create(),e.stop("Biome configuration created.")},Gs=async e=>{let t=(0,a.spinner)();if(t.start("Initializing pre-commit hooks..."),t.message("Installing Husky..."),S.install(e),await S.exists()){t.message("Pre-commit hook found, updating..."),await S.update(),t.stop("Pre-commit hook updated.");return}t.message("Updating pre-commit hook..."),t.message("Pre-commit hook not found, creating..."),await S.create(),t.stop("Pre-commit hook created.")},Ys=async e=>{let t=(0,a.spinner)();if(t.start("Initializing lefthook..."),t.message("Installing lefthook..."),P.install(e),await P.exists()){t.message("lefthook.yml found, updating..."),await P.update(),t.stop("lefthook.yml updated.");return}t.message("lefthook.yml not found, creating..."),await P.create(),t.stop("lefthook.yml created.")},Zs=async e=>{let t=(0,a.spinner)();if(t.start("Initializing lint-staged..."),t.message("Installing lint-staged..."),O.install(e),await O.exists()){t.message("lint-staged found, updating..."),await O.update(),t.stop("lint-staged updated.");return}t.message("lint-staged not found, creating..."),await O.create(),t.stop("lint-staged created.")},Xs=async()=>{let e=(0,a.spinner)();if(e.start("Checking for GitHub Copilot rules..."),await H.exists()){e.message("GitHub Copilot rules found, updating..."),await H.update(),e.stop("GitHub Copilot rules updated.");return}e.message("GitHub Copilot rules not found, creating..."),await H.create(),e.stop("GitHub Copilot rules created.")},Qs=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Cursor rules..."),await T.exists()){e.message("Cursor rules found, updating..."),await T.update(),e.stop("Cursor rules updated.");return}e.message("Cursor rules not found, creating..."),await T.create(),e.stop("Cursor rules created.")},en=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Windsurf rules..."),await V.exists()){e.message("Windsurf rules found, updating..."),await V.update(),e.stop("Windsurf rules updated.");return}e.message("Windsurf rules not found, creating..."),await V.create(),e.stop("Windsurf rules created.")},tn=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Zed rules..."),await Y.exists()){e.message("Zed rules found, updating..."),await Y.update(),e.stop("Zed rules updated.");return}e.message("Zed rules not found, creating..."),await Y.create(),e.stop("Zed rules created.")},sn=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Claude Code rules..."),await W.exists()){e.message("Claude Code rules found, updating..."),await W.update(),e.stop("Claude Code rules updated.");return}e.message("Claude Code rules not found, creating..."),await W.create(),e.stop("Claude Code rules created.")},nn=async()=>{let e=(0,a.spinner)();if(e.start("Checking for OpenAI Codex rules..."),await E.exists()){e.message("OpenAI Codex rules found, updating..."),await E.update(),e.stop("OpenAI Codex rules updated.");return}e.message("OpenAI Codex rules not found, creating..."),await E.create(),e.stop("OpenAI Codex rules created.")},on=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Kiro IDE steering files..."),await L.exists()){e.message("Kiro IDE steering files found, updating..."),await L.update(),e.stop("Kiro IDE steering files updated.");return}e.message("Kiro IDE steering files not found, creating..."),await L.create(),e.stop("Kiro IDE steering files created.")},rn=async e=>{let t=(0,a.spinner)();t.start("Removing Prettier dependencies and configuration...");try{let s=await ae.remove(e);s.packagesRemoved.length>0&&t.message(`Removed Prettier packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&t.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&t.message("Cleaned VS Code settings"),t.stop("Prettier removed successfully.")}catch{t.stop("Failed to remove Prettier completely, but continuing...")}},an=async e=>{let t=(0,a.spinner)();t.start("Removing ESLint dependencies and configuration...");try{let s=await se.remove(e);s.packagesRemoved.length>0&&t.message(`Removed ESLint packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&t.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&t.message("Cleaned VS Code settings"),t.stop("ESLint removed successfully.")}catch{t.stop("Failed to remove ESLint completely, but continuing...")}},Ye=async()=>{(0,a.intro)(Je);try{let e=await re.get();if(e?a.log.info(`Detected lockfile, using ${e}`):e=await re.select(),!e||typeof e!="string")throw new Error("No package manager selected");let t=[];await ae.hasPrettier()&&t.push({label:"Remove Prettier (dependencies, config files, VS Code settings)",value:"prettier"}),await se.hasESLint()&&t.push({label:"Remove ESLint (dependencies, config files, VS Code settings)",value:"eslint"});let s=[];t.length>0&&(s=await(0,a.multiselect)({message:"Remove existing formatters/linters (recommended for clean migration)?",options:t,required:!1}));let n=await(0,a.multiselect)({message:"Which editors do you want to configure (recommended)?",options:[{label:"VSCode / Cursor / Windsurf",value:"vscode"},{label:"Zed",value:"zed"}],required:!1}),o=await(0,a.multiselect)({message:"Which editor rules do you want to enable (optional)?",options:[{label:"GitHub Copilot (VSCode)",value:"vscode-copilot"},{label:"Cursor",value:"cursor"},{label:"Windsurf",value:"windsurf"},{label:"Zed",value:"zed"},{label:"Claude Code",value:"claude"},{label:"OpenAI Codex",value:"codex"},{label:"Kiro IDE",value:"kiro"}],required:!1}),r=await(0,a.multiselect)({message:"Would you like any of the following (optional)?",options:[{label:"Husky pre-commit hook",value:"precommit-hooks"},{label:"Lefthook pre-commit hook",value:"lefthook"},{label:"Lint-staged",value:"lint-staged"}],required:!1});Array.isArray(s)&&(s.includes("prettier")&&await rn(e),s.includes("eslint")&&await an(e)),qs(e),await Bs(),await Vs(),Array.isArray(n)&&(n.includes("zed")&&await Ks(),n.includes("vscode")&&await Hs()),Array.isArray(o)&&(o.includes("vscode-copilot")&&await Xs(),o.includes("cursor")&&await Qs(),o.includes("windsurf")&&await en(),o.includes("zed")&&await tn(),o.includes("claude")&&await sn(),o.includes("codex")&&await nn(),o.includes("kiro")&&await on()),Array.isArray(r)&&(r.includes("precommit-hooks")&&await Gs(e),r.includes("lefthook")&&await Ys(e),r.includes("lint-staged")&&await Zs(e)),a.log.success("Successfully initialized Ultracite configuration!")}catch(e){let t=e instanceof Error?e.message:"Unknown error";a.log.error(`Failed to initialize Ultracite configuration: ${t}`),us.default.exit(1)}}});var Us={};var ds,Z,is=c(()=>{ds=require("commander");me();Ve();$e();Z=new ds.Command;Z.name("Ultracite").description("Ship code faster and with more confidence.");Z.command("init").description("Initialize Ultracite in the current directory").action(Ye);Z.command("lint").description("Run Biome linter without fixing files").argument("[files...]","specific files to lint (optional)").action(Ue);Z.command("format").description("Run Biome linter and fixes files").argument("[files...]","specific files to format (optional)").option("--unsafe","apply unsafe fixes").action(pe);Z.parse()});is();
133
+ `;return t},zs=async()=>{try{let e=(0,pe.parse)(await(0,y.readFile)("./package.json","utf-8"));return e?e.type==="module":!1}catch{return!1}},Js=async()=>{let e=(0,pe.parse)(await(0,y.readFile)("./package.json","utf-8"));e&&(e["lint-staged"]?e["lint-staged"]=(0,z.default)(e["lint-staged"],v):e["lint-staged"]=v,await(0,y.writeFile)("./package.json",JSON.stringify(e,null,2)))},Ts=async e=>{let t=await(0,y.readFile)(e,"utf-8"),s=(0,pe.parse)(t);if(!s)return;let n=(0,z.default)(s,v);await(0,y.writeFile)(e,JSON.stringify(n,null,2))},Ns=async e=>{let t=await(0,y.readFile)(e,"utf-8"),s=Os(t);if(!s)return;let n=(0,z.default)(s,v);await(0,y.writeFile)(e,Es(n))},Ws=async e=>{let n=(await import((0,ds.pathToFileURL)(e).href)).default||{},o=(0,z.default)(n,v),r=`export default ${JSON.stringify(o,null,2)};
134
+ `;await(0,y.writeFile)(e,r)},Ls=async e=>{delete require.cache[require.resolve(`./${e}`)];let t=Is(`./${e}`),s=(0,z.default)(t,v),n=`module.exports = ${JSON.stringify(s,null,2)};
135
+ `;await(0,y.writeFile)(e,n)},Xe=async()=>{await(0,y.writeFile)(".lintstagedrc.json",JSON.stringify(v,null,2))},_s=async e=>{if(e==="./package.json"){await Js();return}if(e.endsWith(".json")||e==="./.lintstagedrc"){await Ts(e);return}if(e.endsWith(".yaml")||e.endsWith(".yml")){await Ns(e);return}let t=await zs();if(e.endsWith(".mjs")||e.endsWith(".js")&&t){try{await Ws(e)}catch{await Xe()}return}if(e.endsWith(".cjs")||e.endsWith(".js")&&!t)try{await Ls(e)}catch{await Xe()}},J={exists:async()=>{for(let e of ls)if(await i(e))return!0;return!1},install:e=>{(0,us.execSync)(`${e} -D lint-staged`)},create:async()=>{await(0,y.writeFile)(".lintstagedrc.json",JSON.stringify(v,null,2))},update:async()=>{let e=null;for(let t of ls)if(await i(t)){e=t;break}if(!e){await Xe();return}await _s(e)}}});var as={};p(as,{initialize:()=>Qe});var ps,ms,a,qs,Bs,Hs,Ks,Vs,Gs,Ys,Zs,Xs,Qs,en,tn,sn,nn,on,rn,an,cn,Qe,Ze=u(()=>{"use strict";ps=require("child_process"),ms=w(require("process")),a=require("@clack/prompts");we();ve();De();je();Re();Pe();Ae();Ue();Ye();Ee();Je();Ne();We();_e();qe();He();Ve();Ke();se();qs=j.devDependencies["@biomejs/biome"],Bs=e=>{let t=(0,a.spinner)();t.start("Installing dependencies..."),(0,ps.execSync)(`${e} -D -E ultracite @biomejs/biome@${qs}`),t.stop("Dependencies installed.")},Hs=async()=>{let e=(0,a.spinner)();if(e.start("Checking for tsconfig.json..."),await V.exists()){e.message("tsconfig.json found, updating..."),await V.update(),e.stop("tsconfig.json updated.");return}e.message("tsconfig.json not found, creating..."),await V.create(),e.stop("tsconfig.json created.")},Ks=async()=>{let e=(0,a.spinner)();if(e.start("Checking for .vscode/settings.json..."),await Y.exists()){e.message("settings.json found, updating..."),await Y.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await Y.create(),e.stop("settings.json created.")},Vs=async()=>{let e=(0,a.spinner)();if(e.start("Checking for .zed/settings.json..."),await X.exists()){e.message("settings.json found, updating..."),await X.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await X.create(),e.stop("settings.json created.")},Gs=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Biome configuration..."),await W.exists()){e.message("Biome configuration found, updating..."),await W.update(),e.stop("Biome configuration updated.");return}e.message("Biome configuration not found, creating..."),await W.create(),e.stop("Biome configuration created.")},Ys=async e=>{let t=(0,a.spinner)();if(t.start("Initializing pre-commit hooks..."),t.message("Installing Husky..."),P.install(e),await P.exists()){t.message("Pre-commit hook found, updating..."),await P.update(),t.stop("Pre-commit hook updated.");return}t.message("Pre-commit hook not found, creating..."),await P.create(),t.stop("Pre-commit hook created.")},Zs=async e=>{let t=(0,a.spinner)();if(t.start("Initializing lefthook..."),t.message("Installing lefthook..."),$.install(e),await $.exists()){t.message("lefthook.yml found, updating..."),await $.update(),t.stop("lefthook.yml updated.");return}t.message("lefthook.yml not found, creating..."),await $.create(),t.stop("lefthook.yml created.")},Xs=async e=>{let t=(0,a.spinner)();if(t.start("Initializing lint-staged..."),t.message("Installing lint-staged..."),J.install(e),await J.exists()){t.message("lint-staged found, updating..."),await J.update(),t.stop("lint-staged updated.");return}t.message("lint-staged not found, creating..."),await J.create(),t.stop("lint-staged created.")},Qs=async()=>{let e=(0,a.spinner)();if(e.start("Checking for GitHub Copilot rules..."),await G.exists()){e.message("GitHub Copilot rules found, updating..."),await G.update(),e.stop("GitHub Copilot rules updated.");return}e.message("GitHub Copilot rules not found, creating..."),await G.create(),e.stop("GitHub Copilot rules created.")},en=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Cursor rules..."),await q.exists()){e.message("Cursor rules found, updating..."),await q.update(),e.stop("Cursor rules updated.");return}e.message("Cursor rules not found, creating..."),await q.create(),e.stop("Cursor rules created.")},tn=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Windsurf rules..."),await Z.exists()){e.message("Windsurf rules found, updating..."),await Z.update(),e.stop("Windsurf rules updated.");return}e.message("Windsurf rules not found, creating..."),await Z.create(),e.stop("Windsurf rules created.")},sn=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Zed rules..."),await Q.exists()){e.message("Zed rules found, updating..."),await Q.update(),e.stop("Zed rules updated.");return}e.message("Zed rules not found, creating..."),await Q.create(),e.stop("Zed rules created.")},nn=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Claude Code rules..."),await L.exists()){e.message("Claude Code rules found, updating..."),await L.update(),e.stop("Claude Code rules updated.");return}e.message("Claude Code rules not found, creating..."),await L.create(),e.stop("Claude Code rules created.")},on=async()=>{let e=(0,a.spinner)();if(e.start("Checking for OpenAI Codex rules..."),await _.exists()){e.message("OpenAI Codex rules found, updating..."),await _.update(),e.stop("OpenAI Codex rules updated.");return}e.message("OpenAI Codex rules not found, creating..."),await _.create(),e.stop("OpenAI Codex rules created.")},rn=async e=>{let t=(0,a.spinner)();t.start("Removing Prettier dependencies and configuration...");try{let s=await ce.remove(e);s.packagesRemoved.length>0&&t.message(`Removed Prettier packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&t.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&t.message("Cleaned VS Code settings"),t.stop("Prettier removed successfully.")}catch{t.stop("Failed to remove Prettier completely, but continuing...")}},an=async e=>{let t=(0,a.spinner)();t.start("Removing ESLint dependencies and configuration...");try{let s=await oe.remove(e);s.packagesRemoved.length>0&&t.message(`Removed ESLint packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&t.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&t.message("Cleaned VS Code settings"),t.stop("ESLint removed successfully.")}catch{t.stop("Failed to remove ESLint completely, but continuing...")}},cn=async e=>{if(e){let n=U.options.find(r=>r.label===e);if(!n)throw new Error(`Unsupported package manager: ${e}`);return await U.isMonorepo()&&n.monorepoSuffix?`${n.value} ${n.monorepoSuffix}`:n.value}let t=await U.get();if(t)return a.log.info(`Detected lockfile, using ${t}`),t;let s=await U.select();if(!s)throw new Error("No package manager selected");return s},Qe=async e=>{(0,a.intro)(Te);try{let t=e??{},s=await cn(t.pm),n=t.removePrettier,o=t.removeEslint;if(n===void 0||o===void 0){let g=[];if(n===void 0&&await ce.hasPrettier()&&g.push({label:"Remove Prettier (dependencies, config files, VS Code settings)",value:"prettier"}),o===void 0&&await oe.hasESLint()&&g.push({label:"Remove ESLint (dependencies, config files, VS Code settings)",value:"eslint"}),g.length>0){let ee=await(0,a.multiselect)({message:"Remove existing formatters/linters (recommended for clean migration)?",options:g,required:!1});n===void 0&&(n=ee.includes("prettier")),o===void 0&&(o=ee.includes("eslint"))}}let r=t.editors;r||(r=await(0,a.multiselect)({message:"Which editors do you want to configure (recommended)?",options:[{label:"VSCode / Cursor / Windsurf",value:"vscode"},{label:"Zed",value:"zed"}],required:!1}));let l=t.rules;l||(l=await(0,a.multiselect)({message:"Which editor rules do you want to enable (optional)?",options:[{label:"GitHub Copilot (VSCode)",value:"vscode-copilot"},{label:"Cursor",value:"cursor"},{label:"Windsurf",value:"windsurf"},{label:"Zed",value:"zed"},{label:"Claude Code",value:"claude"},{label:"OpenAI Codex",value:"codex"}],required:!1}));let c=t.features;c||(c=await(0,a.multiselect)({message:"Would you like any of the following (optional)?",options:[{label:"Husky pre-commit hook",value:"husky"},{label:"Lefthook pre-commit hook",value:"lefthook"},{label:"Lint-staged",value:"lint-staged"}],required:!1})),n&&await rn(s),o&&await an(s),Bs(s),await Hs(),await Gs(),r?.includes("vscode")&&await Ks(),r?.includes("zed")&&await Vs(),l?.includes("vscode-copilot")&&await Qs(),l?.includes("cursor")&&await en(),l?.includes("windsurf")&&await tn(),l?.includes("zed")&&await sn(),l?.includes("claude")&&await nn(),l?.includes("codex")&&await on(),c?.includes("husky")&&await Ys(s),c?.includes("lefthook")&&await Zs(s),c?.includes("lint-staged")&&await Xs(s),a.log.success("Successfully initialized Ultracite configuration!")}catch(t){let s=t instanceof Error?t.message:"Unknown error";a.log.error(`Failed to initialize Ultracite configuration: ${s}`),ms.default.exit(1)}}});var Us={};var fe,h,me,ln,un,cs=u(()=>{fe=require("trpc-cli"),h=w(require("zod"));se();he();Ze();Me();me=fe.trpcServer.initTRPC.meta().create(),ln=me.router({init:me.procedure.meta({description:"Initialize Ultracite in the current directory"}).input(h.default.object({pm:h.default.enum(["pnpm","bun","yarn","npm"]).optional().describe("Package manager to use"),editors:h.default.array(h.default.enum(["vscode","zed"])).optional().describe("Editors to configure"),rules:h.default.array(h.default.enum(["vscode-copilot","cursor","windsurf","zed","claude","codex"])).optional().describe("Editor rules to enable"),features:h.default.array(h.default.enum(["husky","lefthook","lint-staged"])).optional().describe("Additional features to enable"),removePrettier:h.default.boolean().optional().describe("Remove Prettier dependencies and configuration"),removeEslint:h.default.boolean().optional().describe("Remove ESLint dependencies and configuration")})).mutation(async({input:e})=>{await Qe(e)}),lint:me.procedure.meta({description:"Run Biome linter without fixing files"}).input(h.default.array(h.default.string()).optional().default([]).describe("specific files to lint")).query(({input:e})=>{Ie(e)}),format:me.procedure.meta({description:"Run Biome linter and fixes files"}).input(h.default.tuple([h.default.array(h.default.string()).optional().default([]).describe("specific files to format"),h.default.object({unsafe:h.default.boolean().optional().describe("apply unsafe fixes")})])).mutation(({input:e})=>{let[t,s]=e;ge(t,{unsafe:s.unsafe})})}),un=(0,fe.createCli)({router:ln,name:"ultracite",version:j.version,description:"Ship code faster and with more confidence."});process.env.VITEST||un.run()});cs();
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- var Y=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var Yt=Object.getOwnPropertyNames;var Zt=Object.prototype.hasOwnProperty;var Z=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,s)=>(typeof require<"u"?require:t)[s]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Je=e=>t=>{var s=e[t];if(s)return s();throw new Error("Module not found in bundle: "+t)};var a=(e,t)=>()=>(e&&(t=e(e=0)),t);var l=(e,t)=>{for(var s in t)Y(e,s,{get:t[s],enumerable:!0})},Xt=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Yt(t))!Zt.call(e,o)&&o!==s&&Y(e,o,{get:()=>t[o],enumerable:!(n=Gt(t,o))||n.enumerable});return e};var c=e=>Xt(Y({},"__esModule",{value:!0}),e);var Ne={};l(Ne,{format:()=>X});import{execSync as Qt}from"child_process";import es from"process";var X,Q=a(()=>{"use strict";X=(e,t={})=>{try{let s=e.length>0?e.map(o=>`"${o}"`).join(" "):"./",n=t.unsafe?" --unsafe":"";Qt(`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),es.exit(1)}}});var We={};l(We,{exists:()=>i,isMonorepo:()=>N});import{access as ts,readFile as ss}from"fs/promises";import{parse as ns}from"jsonc-parser";var i,N,p=a(()=>{"use strict";i=async e=>{try{return await ts(e),!0}catch{return!1}},N=async()=>{if(await i("pnpm-workspace.yaml"))return!0;try{let e=ns(await ss("package.json","utf-8"));return e?!!e.workspaces:!1}catch{return!1}}});var W,ee=a(()=>{W={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"5.0.47",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",commander:"^14.0.0",deepmerge:"^4.3.1","jsonc-parser":"^3.3.1",vitest:"^3.2.4"},packageManager:"pnpm@10.13.1"}});var ze={};l(ze,{biome:()=>C});import{readFile as is,writeFile as Ee}from"fs/promises";import rs from"deepmerge";import{parse as as}from"jsonc-parser";var cs,Te,te,C,se=a(()=>{"use strict";p();ee();cs=W.devDependencies["@biomejs/biome"],Te={$schema:`https://biomejs.dev/schemas/${cs}/schema.json`,extends:["ultracite"]},te=async()=>await i("./biome.json")?"./biome.json":"./biome.jsonc",C={exists:async()=>{let e=await te();return i(e)},create:async()=>{let e=await te();return Ee(e,JSON.stringify(Te,null,2))},update:async()=>{let e=await te(),t=await is(e,"utf-8"),n=as(t)||{},o=n.extends&&Array.isArray(n.extends)?n.extends:[];o.includes("ultracite")||(n.extends=[...o,"ultracite"]);let r={$schema:Te.$schema},m=rs(n,r);await Ee(e,JSON.stringify(m,null,2))}}});var Le,_e,qe,Be,He,Ke,Ve,Ge,Tn,u,h=a(()=>{"use strict";Le=["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."],_e=["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."],qe=["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.'],Be=["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"`.'],He=["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."],Ke=["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.'],Ve=["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."],Ge=["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."],Tn=[...Le,..._e,...qe,...Be,...He,...Ke,...Ve,...Ge],u=`# Project Context
2
+ var X=Object.defineProperty;var Yt=Object.getOwnPropertyDescriptor;var Zt=Object.getOwnPropertyNames;var Xt=Object.prototype.hasOwnProperty;var Q=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,s)=>(typeof require<"u"?require:t)[s]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Je=e=>t=>{var s=e[t];if(s)return s();throw new Error("Module not found in bundle: "+t)};var l=(e,t)=>()=>(e&&(t=e(e=0)),t);var d=(e,t)=>{for(var s in t)X(e,s,{get:t[s],enumerable:!0})},Qt=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Zt(t))!Xt.call(e,o)&&o!==s&&X(e,o,{get:()=>t[o],enumerable:!(n=Yt(t,o))||n.enumerable});return e};var u=e=>Qt(X({},"__esModule",{value:!0}),e);var v,N=l(()=>{v={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"5.0.49",bin:{ultracite:"dist/index.js"},files:["biome.jsonc","dist"],scripts:{build:"tsup",test:"vitest run","test:coverage":"vitest --coverage"},main:"./biome.jsonc",author:"Hayden Bleasel <hello@haydenbleasel.com>",bugs:{url:"https://github.com/haydenbleasel/ultracite/issues"},homepage:"https://github.com/haydenbleasel/ultracite#readme",keywords:["ultracite","biome","linter","formatter","fixer"],license:"MIT",publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},repository:{type:"git",url:"git+https://github.com/haydenbleasel/ultracite.git"},devDependencies:{"@auto-it/all-contributors":"^11.3.0","@auto-it/first-time-contributor":"^11.3.0","@biomejs/biome":"2.1.2","@types/node":"^24.0.14","@vitest/coverage-v8":"3.2.4",tsup:"^8.5.0"},dependencies:{"@clack/prompts":"^0.11.0",deepmerge:"^4.3.1","jsonc-parser":"^3.3.1","trpc-cli":"^0.10.0",vitest:"^3.2.4",zod:"^4.0.5"},packageManager:"pnpm@10.13.1"}});var Te={};d(Te,{format:()=>ee});import{execSync as ts}from"child_process";import ss from"process";var ee,te=l(()=>{"use strict";ee=(e,t={})=>{try{let s=e.length>0?e.map(o=>`"${o}"`).join(" "):"./",n=t.unsafe?" --unsafe":"";ts(`npx @biomejs/biome check --write${n} ${s}`,{stdio:"inherit"})}catch(s){let n=s instanceof Error?s.message:"Unknown error";console.error("Failed to run Ultracite:",n),ss.exit(1)}}});var Ne={};d(Ne,{exists:()=>i,isMonorepo:()=>R});import{access as ns,readFile as os}from"fs/promises";import{parse as is}from"jsonc-parser";var i,R,m=l(()=>{"use strict";i=async e=>{try{return await ns(e),!0}catch{return!1}},R=async()=>{if(await i("pnpm-workspace.yaml"))return!0;try{let e=is(await os("package.json","utf-8"));return e?!!e.workspaces:!1}catch{return!1}}});var _e={};d(_e,{biome:()=>P});import{readFile as rs,writeFile as We}from"fs/promises";import as from"deepmerge";import{parse as cs}from"jsonc-parser";var ls,Le,se,P,ne=l(()=>{"use strict";m();N();ls=v.devDependencies["@biomejs/biome"],Le={$schema:`https://biomejs.dev/schemas/${ls}/schema.json`,extends:["ultracite"]},se=async()=>await i("./biome.json")?"./biome.json":"./biome.jsonc",P={exists:async()=>{let e=await se();return i(e)},create:async()=>{let e=await se();return We(e,JSON.stringify(Le,null,2))},update:async()=>{let e=await se(),t=await rs(e,"utf-8"),n=cs(t)||{},o=n.extends&&Array.isArray(n.extends)?n.extends:[];o.includes("ultracite")||(n.extends=[...o,"ultracite"]);let r={$schema:Le.$schema},c=as(n,r);await We(e,JSON.stringify(c,null,2))}}});var qe,Be,He,Ke,Ve,Ge,Ye,Ze,qn,p,y=l(()=>{"use strict";qe=["Don't use `accessKey` attribute on any HTML element.",'Don\'t set `aria-hidden="true"` on focusable elements.',"Don't add ARIA roles, states, and properties to elements that don't support them.","Don't use distracting elements like `<marquee>` or `<blink>`.","Only use the `scope` prop on `<th>` elements.","Don't assign non-interactive ARIA roles to interactive HTML elements.","Make sure label elements have text content and are associated with an input.","Don't assign interactive ARIA roles to non-interactive HTML elements.","Don't assign `tabIndex` to non-interactive HTML elements.","Don't use positive integers for `tabIndex` property.",`Don't include "image", "picture", or "photo" in img alt prop.`,"Don't use explicit role property that's the same as the implicit/default role.","Make static elements with click handlers use a valid role attribute.","Always include a `title` element for SVG elements.","Give all elements requiring alt text meaningful information for screen readers.","Make sure anchors have content that's accessible to screen readers.","Assign `tabIndex` to non-interactive HTML elements with `aria-activedescendant`.","Include all required ARIA attributes for elements with ARIA roles.","Make sure ARIA properties are valid for the element's supported roles.","Always include a `type` attribute for button elements.","Make elements with interactive roles and handlers focusable.","Give heading elements content that's accessible to screen readers (not hidden with `aria-hidden`).","Always include a `lang` attribute on the html element.","Always include a `title` attribute for iframe elements.","Accompany `onClick` with at least one of: `onKeyUp`, `onKeyDown`, or `onKeyPress`.","Accompany `onMouseOver`/`onMouseOut` with `onFocus`/`onBlur`.","Include caption tracks for audio and video elements.","Use semantic elements instead of role attributes in JSX.","Make sure all anchors are valid and navigable.","Ensure all ARIA properties (`aria-*`) are valid.","Use valid, non-abstract ARIA roles for elements with ARIA roles.","Use valid ARIA state and property values.","Use valid values for the `autocomplete` attribute on input elements.","Use correct ISO language/country codes for the `lang` attribute."],Be=["Don't use consecutive spaces in regular expression literals.","Don't use the `arguments` object.","Don't use primitive type aliases or misleading types.","Don't use the comma operator.","Don't use empty type parameters in type aliases and interfaces.","Don't write functions that exceed a given Cognitive Complexity score.","Don't nest describe() blocks too deeply in test files.","Don't use unnecessary boolean casts.","Don't use unnecessary callbacks with flatMap.","Use for...of statements instead of Array.forEach.","Don't create classes that only have static members (like a static namespace).","Don't use this and super in static contexts.","Don't use unnecessary catch clauses.","Don't use unnecessary constructors.","Don't use unnecessary continue statements.","Don't export empty modules that don't change anything.","Don't use unnecessary escape sequences in regular expression literals.","Don't use unnecessary fragments.","Don't use unnecessary labels.","Don't use unnecessary nested block statements.","Don't rename imports, exports, and destructured assignments to the same name.","Don't use unnecessary string or template literal concatenation.","Don't use String.raw in template literals when there are no escape sequences.","Don't use useless case statements in switch statements.","Don't use ternary operators when simpler alternatives exist.","Don't use useless `this` aliasing.","Don't use any or unknown as type constraints.","Don't initialize variables to undefined.","Don't use the void operators (they're not familiar).","Use arrow functions instead of function expressions.","Use Date.now() to get milliseconds since the Unix Epoch.","Use .flatMap() instead of map().flat() when possible.","Use literal property access instead of computed property access.","Don't use parseInt() or Number.parseInt() when binary, octal, or hexadecimal literals work.","Use concise optional chaining instead of chained logical expressions.","Use regular expression literals instead of the RegExp constructor when possible.","Don't use number literal object member names that aren't base 10 or use underscore separators.","Remove redundant terms from logical expressions.","Use while loops instead of for loops when you don't need initializer and update expressions.","Don't pass children as props.","Don't reassign const variables.","Don't use constant expressions in conditions.","Don't use `Math.min` and `Math.max` to clamp values when the result is constant.","Don't return a value from a constructor.","Don't use empty character classes in regular expression literals.","Don't use empty destructuring patterns.","Don't call global object properties as functions.","Don't declare functions and vars that are accessible outside their block.","Make sure builtins are correctly instantiated.","Don't use super() incorrectly inside classes. Also check that super() is called in classes that extend other constructors.","Don't use variables and function parameters before they're declared.","Don't use 8 and 9 escape sequences in string literals.","Don't use literal numbers that lose precision."],He=["Don't use the return value of React.render.","Make sure all dependencies are correctly specified in React hooks.","Make sure all React hooks are called from the top level of component functions.","Don't forget key props in iterators and collection literals.","Don't destructure props inside JSX components in Solid projects.","Don't define React components inside other components.","Don't use event handlers on non-interactive elements.","Don't assign to React component props.","Don't use both `children` and `dangerouslySetInnerHTML` props on the same element.","Don't use dangerous JSX props.","Don't use Array index in keys.","Don't insert comments as text nodes.","Don't assign JSX properties multiple times.","Don't add extra closing tags for components without children.","Use `<>...</>` instead of `<Fragment>...</Fragment>`.",'Watch out for possible "wrong" semicolons inside JSX elements.'],Ke=["Don't assign a value to itself.","Don't return a value from a setter.","Don't compare expressions that modify string case with non-compliant values.","Don't use lexical declarations in switch clauses.","Don't use variables that haven't been declared in the document.","Don't write unreachable code.","Make sure super() is called exactly once on every code path in a class constructor before this is accessed if the class has a superclass.","Don't use control flow statements in finally blocks.","Don't use optional chaining where undefined values aren't allowed.","Don't have unused function parameters.","Don't have unused imports.","Don't have unused labels.","Don't have unused private class members.","Don't have unused variables.","Make sure void (self-closing) elements don't have children.","Don't return a value from a function with the return type 'void'","Use isNaN() when checking for NaN.",'Make sure "for" loop update clauses move the counter in the right direction.',"Make sure typeof expressions are compared to valid values.","Make sure generator functions contain yield.","Don't use await inside loops.","Don't use bitwise operators.","Don't use expressions where the operation doesn't change the value.","Make sure Promise-like statements are handled appropriately.","Don't use __dirname and __filename in the global scope.","Prevent import cycles.","Don't use configured elements.","Don't hardcode sensitive data like API keys and tokens.","Don't let variable declarations shadow variables from outer scopes.","Don't use the TypeScript directive @ts-ignore.","Prevent duplicate polyfills from Polyfill.io.","Don't use useless backreferences in regular expressions that always match empty strings.","Don't use unnecessary escapes in string literals.","Don't use useless undefined.","Make sure getters and setters for the same property are next to each other in class and object definitions.","Make sure object literals are declared consistently (defaults to explicit definitions).","Use static Response methods instead of new Response() constructor when possible.","Make sure switch-case statements are exhaustive.","Make sure the `preconnect` attribute is used when using Google Fonts.","Use `Array#{indexOf,lastIndexOf}()` instead of `Array#{findIndex,findLastIndex}()` when looking for the index of an item.","Make sure iterable callbacks return consistent values.",'Use `with { type: "json" }` for JSON module imports.',"Use numeric separators in numeric literals.","Use object spread instead of `Object.assign()` when constructing new objects.","Always use the radix argument when using `parseInt()`.","Make sure JSDoc comment lines start with a single asterisk, except for the first one.","Include a description parameter for `Symbol()`.","Don't use spread (`...`) syntax on accumulators.","Don't use the `delete` operator.","Don't access namespace imports dynamically.","Don't use namespace imports.","Declare regex literals at the top level.",'Don\'t use `target="_blank"` without `rel="noopener"`.'],Ve=["Don't use TypeScript enums.","Don't export imported variables.","Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions.","Don't use TypeScript namespaces.","Don't use non-null assertions with the `!` postfix operator.","Don't use parameter properties in class constructors.","Don't use user-defined types.","Use `as const` instead of literal types and type annotations.","Use either `T[]` or `Array<T>` consistently.","Initialize each enum member value explicitly.","Use `export type` for types.","Use `import type` for types.","Make sure all enum members are literal values.","Don't use TypeScript const enum.","Don't declare empty interfaces.","Don't let variables evolve into any type through reassignments.","Don't use the any type.","Don't misuse the non-null assertion operator (!) in TypeScript files.","Don't use implicit any type on variable declarations.","Don't merge interfaces and classes unsafely.","Don't use overload signatures that aren't next to each other.","Use the namespace keyword instead of the module keyword to declare TypeScript namespaces."],Ge=["Don't use global `eval()`.","Don't use callbacks in asynchronous tests and hooks.","Don't use negation in `if` statements that have `else` clauses.","Don't use nested ternary expressions.","Don't reassign function parameters.","This rule lets you specify global variable names you don't want to use in your application.","Don't use specified modules when loaded by import or require.","Don't use constants whose value is the upper-case version of their name.","Use `String.slice()` instead of `String.substr()` and `String.substring()`.","Don't use template literals if you don't need interpolation or special-character handling.","Don't use `else` blocks when the `if` block breaks early.","Don't use yoda expressions.","Don't use Array constructors.","Use `at()` instead of integer index access.","Follow curly brace conventions.","Use `else if` instead of nested `if` statements in `else` clauses.","Use single `if` statements instead of nested `if` clauses.","Use `new` for all builtins except `String`, `Number`, and `Boolean`.","Use consistent accessibility modifiers on class properties and methods.","Use `const` declarations for variables that are only assigned once.","Put default function parameters and optional function parameters last.","Include a `default` clause in switch statements.","Use the `**` operator instead of `Math.pow`.","Use `for-of` loops when you need the index to extract an item from the iterated array.","Use `node:assert/strict` over `node:assert`.","Use the `node:` protocol for Node.js builtin modules.","Use Number properties instead of global ones.","Use assignment operator shorthand where possible.","Use function types instead of object types with call signatures.","Use template literals over string concatenation.","Use `new` when throwing an error.","Don't throw non-Error values.","Use `String.trimStart()` and `String.trimEnd()` over `String.trimLeft()` and `String.trimRight()`.","Use standard constants instead of approximated literals.","Don't assign values in expressions.","Don't use async functions as Promise executors.","Don't reassign exceptions in catch clauses.","Don't reassign class members.","Don't compare against -0.","Don't use labeled statements that aren't loops.","Don't use void type outside of generic or return types.","Don't use console.","Don't use control characters and escape sequences that match control characters in regular expression literals.","Don't use debugger.","Don't assign directly to document.cookie.","Use `===` and `!==`.","Don't use duplicate case labels.","Don't use duplicate class members.","Don't use duplicate conditions in if-else-if chains.","Don't use two keys with the same name inside objects.","Don't use duplicate function parameter names.","Don't have duplicate hooks in describe blocks.","Don't use empty block statements and static blocks.","Don't let switch clauses fall through.","Don't reassign function declarations.","Don't allow assignments to native objects and read-only global variables.","Use Number.isFinite instead of global isFinite.","Use Number.isNaN instead of global isNaN.","Don't assign to imported bindings.","Don't use irregular whitespace characters.","Don't use labels that share a name with a variable.","Don't use characters made with multiple code points in character class syntax.","Make sure to use new and constructor properly.","Don't use shorthand assign when the variable appears on both sides.","Don't use octal escape sequences in string literals.","Don't use Object.prototype builtins directly.","Don't redeclare variables, functions, classes, and types in the same scope.",`Don't have redundant "use strict".`,"Don't compare things where both sides are exactly the same.","Don't let identifiers shadow restricted names.","Don't use sparse arrays (arrays with holes).","Don't use template literal placeholder syntax in regular strings.","Don't use the then property.","Don't use unsafe negation.","Don't use var.","Don't use with statements in non-strict contexts.","Make sure async functions actually use await.","Make sure default clauses in switch statements come last.","Make sure to pass a message value when creating a built-in error.","Make sure get methods always return a value.","Use a recommended display strategy with Google Fonts.","Make sure for-in loops include an if statement.","Use Array.isArray() instead of instanceof Array.","Make sure to use the digits argument with Number#toFixed().",'Make sure to use the "use strict" directive in script files.'],Ye=["Don't use `<img>` elements in Next.js projects.","Don't use `<head>` elements in Next.js projects.","Don't import next/document outside of pages/_document.jsx in Next.js projects.","Don't use the next/head module in pages/_document.js on Next.js projects."],Ze=["Don't use export or module.exports in test files.","Don't use focused tests.","Make sure the assertion function, like expect, is placed inside an it() function call.","Don't use disabled tests."],qn=[...qe,...Be,...He,...Ke,...Ve,...Ge,...Ye,...Ze],p=`# Project Context
3
3
  Ultracite enforces strict type safety, accessibility standards, and consistent code quality for JavaScript/TypeScript projects using Biome's lightning-fast formatter and linter.
4
4
 
5
5
  ## Key Principles
@@ -17,35 +17,35 @@ Ultracite enforces strict type safety, accessibility standards, and consistent c
17
17
  ## Rules
18
18
 
19
19
  ### Accessibility (a11y)
20
- ${Le.map(e=>`- ${e}`).join(`
20
+ ${qe.map(e=>`- ${e}`).join(`
21
21
  `)}
22
22
 
23
23
  ### Code Complexity and Quality
24
- ${_e.map(e=>`- ${e}`).join(`
24
+ ${Be.map(e=>`- ${e}`).join(`
25
25
  `)}
26
26
 
27
27
  ### React and JSX Best Practices
28
- ${qe.map(e=>`- ${e}`).join(`
28
+ ${He.map(e=>`- ${e}`).join(`
29
29
  `)}
30
30
 
31
31
  ### Correctness and Safety
32
- ${Be.map(e=>`- ${e}`).join(`
32
+ ${Ke.map(e=>`- ${e}`).join(`
33
33
  `)}
34
34
 
35
35
  ### TypeScript Best Practices
36
- ${He.map(e=>`- ${e}`).join(`
36
+ ${Ve.map(e=>`- ${e}`).join(`
37
37
  `)}
38
38
 
39
39
  ### Style and Consistency
40
- ${Ke.map(e=>`- ${e}`).join(`
40
+ ${Ge.map(e=>`- ${e}`).join(`
41
41
  `)}
42
42
 
43
43
  ### Next.js Specific Rules
44
- ${Ve.map(e=>`- ${e}`).join(`
44
+ ${Ye.map(e=>`- ${e}`).join(`
45
45
  `)}
46
46
 
47
47
  ### Testing Best Practices
48
- ${Ge.map(e=>`- ${e}`).join(`
48
+ ${Ze.map(e=>`- ${e}`).join(`
49
49
  `)}
50
50
 
51
51
  ## Common Tasks
@@ -70,16 +70,16 @@ try {
70
70
  } catch (e) {
71
71
  console.log(e);
72
72
  }
73
- \`\`\``});var Xe={};l(Xe,{claude:()=>j});import{mkdir as Ye,writeFile as Ze}from"fs/promises";var ne,j,oe=a(()=>{"use strict";h();p();ne="./.claude/CLAUDE.md",j={exists:()=>i(ne),create:async()=>{await Ye(".claude",{recursive:!0}),await Ze(ne,u)},update:async()=>{await Ye(".claude",{recursive:!0}),await Ze(ne,u)}}});var et={};l(et,{codex:()=>S});import{writeFile as Qe}from"fs/promises";var ie,S,re=a(()=>{"use strict";h();p();ie="./AGENTS.md",S={exists:()=>i(ie),create:async()=>{await Qe(ie,u)},update:async()=>{await Qe(ie,u)}}});var nt={};l(nt,{cursor:()=>R});import{mkdir as tt,writeFile as st}from"fs/promises";var ae,ls,R,ce=a(()=>{"use strict";h();p();ae="./.cursor/rules/ultracite.mdc",ls=`---
73
+ \`\`\``});var et={};d(et,{claude:()=>F});import{mkdir as Xe,writeFile as Qe}from"fs/promises";var oe,F,ie=l(()=>{"use strict";y();m();oe="./.claude/CLAUDE.md",F={exists:()=>i(oe),create:async()=>{await Xe(".claude",{recursive:!0}),await Qe(oe,p)},update:async()=>{await Xe(".claude",{recursive:!0}),await Qe(oe,p)}}});var st={};d(st,{codex:()=>A});import{writeFile as tt}from"fs/promises";var re,A,ae=l(()=>{"use strict";y();m();re="./AGENTS.md",A={exists:()=>i(re),create:async()=>{await tt(re,p)},update:async()=>{await tt(re,p)}}});var it={};d(it,{cursor:()=>$});import{mkdir as nt,writeFile as ot}from"fs/promises";var ce,us,$,le=l(()=>{"use strict";y();m();ce="./.cursor/rules/ultracite.mdc",us=`---
74
74
  description: Ultracite Rules - AI-Ready Formatter and Linter
75
75
  globs: "**/*.{ts,tsx,js,jsx}"
76
76
  alwaysApply: true
77
77
  ---
78
78
 
79
- ${u}`,R={exists:()=>i(ae),create:async()=>{await tt(".cursor/rules",{recursive:!0}),await st(ae,ls)},update:async()=>{await tt(".cursor/rules",{recursive:!0}),await st(ae,u)}}});var ct={};l(ct,{eslintCleanup:()=>E});import{execSync as us}from"child_process";import{unlink as ds}from"fs/promises";import{readFile as ot,writeFile as ps}from"fs/promises";import{parse as it}from"jsonc-parser";var rt,at,ms,fs,gs,hs,ys,E,le=a(()=>{"use strict";p();rt=[".eslintrc",".eslintrc.js",".eslintrc.json",".eslintrc.yml",".eslintrc.yaml",".eslintrc.config.js","eslint.config.js","eslint.config.mjs","eslint.config.cjs",".eslintignore"],at=async()=>{try{let e=await ot("package.json","utf-8"),t=it(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(r=>r.startsWith("eslint")||r==="@eslint/js"||r==="@typescript-eslint/parser"||r==="@typescript-eslint/eslint-plugin")}catch{return[]}},ms=(e,t)=>{if(t.length===0)return;let s=t.join(" ");try{us(`${e} ${s}`,{stdio:"pipe"})}catch{}},fs=async()=>{let e=[];for(let t of rt)if(await i(t))try{await ds(t),e.push(t)}catch{}return e},gs=async()=>{let e="./.vscode/settings.json";if(!await i(e))return!1;try{let t=await ot(e,"utf-8"),s=it(t);if(!s||typeof s!="object")return!1;let n=!1,o={...s},r=["eslint.enable","eslint.format.enable","eslint.validate","eslint.workingDirectories","eslint.codeAction.showDocumentation","eslint.run","eslint.autoFixOnSave","eslint.quiet","eslint.packageManager","eslint.options","eslint.trace.server"];for(let m of r)m in o&&(delete o[m],n=!0);if("editor.codeActionsOnSave"in o){let m=o["editor.codeActionsOnSave"];if(m&&typeof m=="object"){let d=["source.fixAll.eslint","source.organizeImports.eslint"];for(let g of d)g in m&&(delete m[g],n=!0);Object.keys(m).length===0&&delete o["editor.codeActionsOnSave"]}}return n?(await ps(e,JSON.stringify(o,null,2)),!0):!1}catch{return!1}},hs=async()=>{if((await at()).length>0)return!0;for(let t of rt)if(await i(t))return!0;return!1},ys=e=>e.startsWith("npm")?"npm uninstall":e.startsWith("yarn")?"yarn remove":e.startsWith("pnpm")?"pnpm remove":e.startsWith("bun")?"bun remove":"npm uninstall",E={hasESLint:hs,remove:async e=>{let t=await at(),s=ys(e);ms(s,t);let n=await fs(),o=await gs();return{packagesRemoved:t,filesRemoved:n,vsCodeCleaned:o}}}});var dt={};l(dt,{husky:()=>b});import{execSync as ws}from"child_process";import{mkdir as bs,readFile as vs,writeFile as lt}from"fs/promises";var ut,T,b,ue=a(()=>{"use strict";p();ut="npx ultracite format",T="./.husky/pre-commit",b={exists:()=>i(T),install:e=>{ws(`${e} -D husky`)},create:async()=>{await bs(".husky",{recursive:!0}),await lt(T,ut)},update:async()=>{let e=await vs(T,"utf-8");await lt(T,`${e}
80
- ${ut}`)}}});var ft={};l(ft,{kiro:()=>A});import{mkdir as pt,writeFile as mt}from"fs/promises";var de,A,pe=a(()=>{"use strict";h();p();de="./.kiro/steering/linting-and-formatting.md",A={exists:()=>i(de),create:async()=>{await pt(".kiro/steering",{recursive:!0}),await mt(de,u)},update:async()=>{await pt(".kiro/steering",{recursive:!0}),await mt(de,u)}}});var yt={};l(yt,{lefthook:()=>x});import{execSync as gt}from"child_process";import{readFile as xs,writeFile as z}from"fs/promises";var L,v,ht,x,me=a(()=>{"use strict";p();L="npx ultracite format",v="./lefthook.yml",ht=`pre-commit:
79
+ ${p}`,$={exists:()=>i(ce),create:async()=>{await nt(".cursor/rules",{recursive:!0}),await ot(ce,us)},update:async()=>{await nt(".cursor/rules",{recursive:!0}),await ot(ce,p)}}});var ut={};d(ut,{eslintCleanup:()=>W});import{execSync as ds}from"child_process";import{unlink as ps}from"fs/promises";import{readFile as rt,writeFile as ms}from"fs/promises";import{parse as at}from"jsonc-parser";var ct,lt,fs,gs,hs,ys,ws,W,ue=l(()=>{"use strict";m();ct=[".eslintrc",".eslintrc.js",".eslintrc.json",".eslintrc.yml",".eslintrc.yaml",".eslintrc.config.js","eslint.config.js","eslint.config.mjs","eslint.config.cjs",".eslintignore"],lt=async()=>{try{let e=await rt("package.json","utf-8"),t=at(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(r=>r.startsWith("eslint")||r==="@eslint/js"||r==="@typescript-eslint/parser"||r==="@typescript-eslint/eslint-plugin")}catch{return[]}},fs=(e,t)=>{if(t.length===0)return;let s=t.join(" ");try{ds(`${e} ${s}`,{stdio:"pipe"})}catch{}},gs=async()=>{let e=[];for(let t of ct)if(await i(t))try{await ps(t),e.push(t)}catch{}return e},hs=async()=>{let e="./.vscode/settings.json";if(!await i(e))return!1;try{let t=await rt(e,"utf-8"),s=at(t);if(!s||typeof s!="object")return!1;let n=!1,o={...s},r=["eslint.enable","eslint.format.enable","eslint.validate","eslint.workingDirectories","eslint.codeAction.showDocumentation","eslint.run","eslint.autoFixOnSave","eslint.quiet","eslint.packageManager","eslint.options","eslint.trace.server"];for(let c of r)c in o&&(delete o[c],n=!0);if("editor.codeActionsOnSave"in o){let c=o["editor.codeActionsOnSave"];if(c&&typeof c=="object"){let a=["source.fixAll.eslint","source.organizeImports.eslint"];for(let f of a)f in c&&(delete c[f],n=!0);Object.keys(c).length===0&&delete o["editor.codeActionsOnSave"]}}return n?(await ms(e,JSON.stringify(o,null,2)),!0):!1}catch{return!1}},ys=async()=>{if((await lt()).length>0)return!0;for(let t of ct)if(await i(t))return!0;return!1},ws=e=>e.startsWith("npm")?"npm uninstall":e.startsWith("yarn")?"yarn remove":e.startsWith("pnpm")?"pnpm remove":e.startsWith("bun")?"bun remove":"npm uninstall",W={hasESLint:ys,remove:async e=>{let t=await lt(),s=ws(e);fs(s,t);let n=await gs(),o=await hs();return{packagesRemoved:t,filesRemoved:n,vsCodeCleaned:o}}}});var mt={};d(mt,{husky:()=>x});import{execSync as bs}from"child_process";import{mkdir as vs,readFile as xs,writeFile as dt}from"fs/promises";var pt,L,x,de=l(()=>{"use strict";m();pt="npx ultracite format",L="./.husky/pre-commit",x={exists:()=>i(L),install:e=>{bs(`${e} -D husky`)},create:async()=>{await vs(".husky",{recursive:!0}),await dt(L,pt)},update:async()=>{let e=await xs(L,"utf-8");await dt(L,`${e}
80
+ ${pt}`)}}});var yt={};d(yt,{kiro:()=>ht});import{mkdir as ft,writeFile as gt}from"fs/promises";var pe,ht,me=l(()=>{"use strict";y();m();pe="./.kiro/steering/linting-and-formatting.md",ht={exists:()=>i(pe),create:async()=>{await ft(".kiro/steering",{recursive:!0}),await gt(pe,p)},update:async()=>{await ft(".kiro/steering",{recursive:!0}),await gt(pe,p)}}});var vt={};d(vt,{lefthook:()=>D});import{execSync as wt}from"child_process";import{readFile as ks,writeFile as _}from"fs/promises";var q,k,bt,D,fe=l(()=>{"use strict";m();q="npx ultracite format",k="./lefthook.yml",bt=`pre-commit:
81
81
  jobs:
82
- - run: ${L}
82
+ - run: ${q}
83
83
  glob:
84
84
  - "*.js"
85
85
  - "*.jsx"
@@ -89,7 +89,7 @@ ${ut}`)}}});var ft={};l(ft,{kiro:()=>A});import{mkdir as pt,writeFile as mt}from
89
89
  - "*.jsonc"
90
90
  - "*.css"
91
91
  stage_fixed: true
92
- `,x={exists:()=>i(v),install:e=>{gt(`${e} -D lefthook`),gt("npx lefthook install")},create:async()=>{await z(v,ht)},update:async()=>{let e=await xs(v,"utf-8");if(!e.includes(L))if(e.includes("pre-commit:"))if(e.includes("jobs:")){let t=` - run: ${L}
92
+ `,D={exists:()=>i(k),install:e=>{wt(`${e} -D lefthook`),wt("npx lefthook install")},create:async()=>{await _(k,bt)},update:async()=>{let e=await ks(k,"utf-8");if(!e.includes(q))if(e.includes("pre-commit:"))if(e.includes("jobs:")){let t=` - run: ${q}
93
93
  glob:
94
94
  - "*.js"
95
95
  - "*.jsx"
@@ -99,8 +99,8 @@ ${ut}`)}}});var ft={};l(ft,{kiro:()=>A});import{mkdir as pt,writeFile as mt}from
99
99
  - "*.jsonc"
100
100
  - "*.css"
101
101
  stage_fixed: true`,s=e.replace(/(pre-commit:\s*\n\s*jobs:\s*\n)/,`$1${t}
102
- `);await z(v,s)}else{let t=` jobs:
103
- - run: ${L}
102
+ `);await _(k,s)}else{let t=` jobs:
103
+ - run: ${q}
104
104
  glob:
105
105
  - "*.js"
106
106
  - "*.jsx"
@@ -110,8 +110,8 @@ ${ut}`)}}});var ft={};l(ft,{kiro:()=>A});import{mkdir as pt,writeFile as mt}from
110
110
  - "*.jsonc"
111
111
  - "*.css"
112
112
  stage_fixed: true`,s=e.replace(/(pre-commit:\s*\n)/,`$1${t}
113
- `);await z(v,s)}else await z(v,`${e}
114
- ${ht}`)}}});var wt={};l(wt,{lint:()=>fe});import{execSync as ks}from"child_process";import Ds from"process";var fe,ge=a(()=>{"use strict";fe=e=>{try{let t=e.length>0?e.map(s=>`"${s}"`).join(" "):"./";ks(`npx @biomejs/biome check ${t}`,{stdio:"inherit"})}catch(t){let s=t instanceof Error?t.message:"Unknown error";console.error("Failed to run Ultracite:",s),Ds.exit(1)}}});var vt={};l(vt,{packageManager:()=>_});import{log as Cs,select as js}from"@clack/prompts";var bt,_,he=a(()=>{"use strict";p();bt=[{hint:"Recommended",label:"pnpm",value:"pnpm add",lockfile:"pnpm-lock.yaml",monorepoSuffix:"-w"},{label:"bun",value:"bun add",lockfile:"bun.lockb",monorepoSuffix:""},{label:"yarn",value:"yarn add",lockfile:"yarn.lock",monorepoSuffix:""},{label:"npm",value:"npm install --legacy-peer-deps",lockfile:"package-lock.json",monorepoSuffix:"--workspace ."}],_={get:async()=>{let e=await N();e&&Cs.info("Monorepo detected, updating install command to include workspace flag");for(let t of bt)if(await i(t.lockfile))return e&&t.monorepoSuffix?`${t.value} ${t.monorepoSuffix}`:t.value;return null},select:async()=>{let e=await N(),t=await js({initialValue:"pnpm",message:"Which package manager do you use?",options:bt.map(s=>({label:s.label,value:e&&s.monorepoSuffix?`${s.value} ${s.monorepoSuffix}`:s.value}))});return typeof t!="string"?null:t}}});var jt={};l(jt,{prettierCleanup:()=>q});import{execSync as Ss}from"child_process";import{unlink as Rs}from"fs/promises";import{readFile as xt,writeFile as As}from"fs/promises";import{parse as kt}from"jsonc-parser";var Dt,Ct,Ps,Fs,Us,$s,Is,q,ye=a(()=>{"use strict";p();Dt=[".prettierrc",".prettierrc.js",".prettierrc.json",".prettierrc.yml",".prettierrc.yaml",".prettierrc.config.js","prettier.config.js","prettier.config.mjs",".prettierignore"],Ct=async()=>{try{let e=await xt("package.json","utf-8"),t=kt(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(r=>r.startsWith("prettier")||r==="eslint-config-prettier"||r==="eslint-plugin-prettier")}catch{return[]}},Ps=(e,t)=>{if(t.length===0)return;let s=t.join(" ");try{Ss(`${e} ${s}`,{stdio:"pipe"})}catch{}},Fs=async()=>{let e=[];for(let t of Dt)if(await i(t))try{await Rs(t),e.push(t)}catch{}return e},Us=async()=>{let e="./.vscode/settings.json";if(!await i(e))return!1;try{let t=await xt(e,"utf-8"),s=kt(t);if(!s||typeof s!="object")return!1;let n=!1,o={...s},r=["editor.defaultFormatter","prettier.enable","prettier.requireConfig","prettier.configPath","prettier.printWidth","prettier.tabWidth","prettier.useTabs","prettier.semi","prettier.singleQuote","prettier.quoteProps","prettier.trailingComma","prettier.bracketSpacing","prettier.arrowParens","prettier.endOfLine"];for(let d of r)d in o&&(d==="editor.defaultFormatter"&&o[d]==="esbenp.prettier-vscode"||d!=="editor.defaultFormatter")&&(delete o[d],n=!0);let m=Object.keys(o).filter(d=>d.startsWith("[")&&d.includes("javascript"));for(let d of m){let g=o[d];g&&typeof g=="object"&&"editor.defaultFormatter"in g&&g["editor.defaultFormatter"]==="esbenp.prettier-vscode"&&(delete g["editor.defaultFormatter"],n=!0,Object.keys(g).length===0&&delete o[d])}return n?(await As(e,JSON.stringify(o,null,2)),!0):!1}catch{return!1}},$s=async()=>{if((await Ct()).length>0)return!0;for(let t of Dt)if(await i(t))return!0;return!1},Is=e=>e.startsWith("npm")?"npm uninstall":e.startsWith("yarn")?"yarn remove":e.startsWith("pnpm")?"pnpm remove":e.startsWith("bun")?"bun remove":"npm uninstall",q={hasPrettier:$s,remove:async e=>{let t=await Ct(),s=Is(e);Ps(s,t);let n=await Fs(),o=await Us();return{packagesRemoved:t,filesRemoved:n,vsCodeCleaned:o}}}});var St={};l(St,{title:()=>we});var we,be=a(()=>{"use strict";we=`
113
+ `);await _(k,s)}else await _(k,`${e}
114
+ ${bt}`)}}});var xt={};d(xt,{lint:()=>ge});import{execSync as Ds}from"child_process";import Cs from"process";var ge,he=l(()=>{"use strict";ge=e=>{try{let t=e.length>0?e.map(s=>`"${s}"`).join(" "):"./";Ds(`npx @biomejs/biome check ${t}`,{stdio:"inherit"})}catch(t){let s=t instanceof Error?t.message:"Unknown error";console.error("Failed to run Ultracite:",s),Cs.exit(1)}}});var kt={};d(kt,{packageManager:()=>C});import{log as js,select as Ss}from"@clack/prompts";var ye,C,we=l(()=>{"use strict";m();ye=[{hint:"Recommended",label:"pnpm",value:"pnpm add",lockfiles:["pnpm-lock.yaml"],monorepoSuffix:"-w"},{label:"bun",value:"bun add",lockfiles:["bun.lockb","bun.lock"],monorepoSuffix:""},{label:"yarn",value:"yarn add",lockfiles:["yarn.lock"],monorepoSuffix:""},{label:"npm",value:"npm install --legacy-peer-deps",lockfiles:["package-lock.json"],monorepoSuffix:"--workspace ."}],C={get:async()=>{let e=await R();e&&js.info("Monorepo detected, updating install command to include workspace flag");for(let t of ye){let s=!1;for(let n of t.lockfiles)if(await i(n)){s=!0;break}if(s)return e&&t.monorepoSuffix?`${t.value} ${t.monorepoSuffix}`:t.value}return null},select:async()=>{let e=await R(),t=await Ss({initialValue:"pnpm",message:"Which package manager do you use?",options:ye.map(s=>({label:s.label,value:e&&s.monorepoSuffix?`${s.value} ${s.monorepoSuffix}`:s.value}))});return typeof t!="string"?null:t},isMonorepo:R,options:ye}});var Rt={};d(Rt,{prettierCleanup:()=>B});import{execSync as Rs}from"child_process";import{unlink as Ps}from"fs/promises";import{readFile as Dt,writeFile as Fs}from"fs/promises";import{parse as Ct}from"jsonc-parser";var jt,St,As,$s,Us,Is,Ms,B,be=l(()=>{"use strict";m();jt=[".prettierrc",".prettierrc.js",".prettierrc.json",".prettierrc.yml",".prettierrc.yaml",".prettierrc.config.js","prettier.config.js","prettier.config.mjs",".prettierignore"],St=async()=>{try{let e=await Dt("package.json","utf-8"),t=Ct(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(r=>r.startsWith("prettier")||r==="eslint-config-prettier"||r==="eslint-plugin-prettier")}catch{return[]}},As=(e,t)=>{if(t.length===0)return;let s=t.join(" ");try{Rs(`${e} ${s}`,{stdio:"pipe"})}catch{}},$s=async()=>{let e=[];for(let t of jt)if(await i(t))try{await Ps(t),e.push(t)}catch{}return e},Us=async()=>{let e="./.vscode/settings.json";if(!await i(e))return!1;try{let t=await Dt(e,"utf-8"),s=Ct(t);if(!s||typeof s!="object")return!1;let n=!1,o={...s},r=["editor.defaultFormatter","prettier.enable","prettier.requireConfig","prettier.configPath","prettier.printWidth","prettier.tabWidth","prettier.useTabs","prettier.semi","prettier.singleQuote","prettier.quoteProps","prettier.trailingComma","prettier.bracketSpacing","prettier.arrowParens","prettier.endOfLine"];for(let a of r)a in o&&(a==="editor.defaultFormatter"&&o[a]==="esbenp.prettier-vscode"||a!=="editor.defaultFormatter")&&(delete o[a],n=!0);let c=Object.keys(o).filter(a=>a.startsWith("[")&&a.includes("javascript"));for(let a of c){let f=o[a];f&&typeof f=="object"&&"editor.defaultFormatter"in f&&f["editor.defaultFormatter"]==="esbenp.prettier-vscode"&&(delete f["editor.defaultFormatter"],n=!0,Object.keys(f).length===0&&delete o[a])}return n?(await Fs(e,JSON.stringify(o,null,2)),!0):!1}catch{return!1}},Is=async()=>{if((await St()).length>0)return!0;for(let t of jt)if(await i(t))return!0;return!1},Ms=e=>e.startsWith("npm")?"npm uninstall":e.startsWith("yarn")?"yarn remove":e.startsWith("pnpm")?"pnpm remove":e.startsWith("bun")?"bun remove":"npm uninstall",B={hasPrettier:Is,remove:async e=>{let t=await St(),s=Ms(e);As(s,t);let n=await $s(),o=await Us();return{packagesRemoved:t,filesRemoved:n,vsCodeCleaned:o}}}});var Pt={};d(Pt,{title:()=>ve});var ve,xe=l(()=>{"use strict";ve=`
115
115
  888 888 888 88888888888 8888888b. d8888 .d8888b. 8888888 88888888888 8888888888
116
116
  888 888 888 888 888 Y88b d88888 d88P Y88b 888 888 888
117
117
  888 888 888 888 888 888 d88P888 888 888 888 888 888
@@ -120,16 +120,16 @@ ${ht}`)}}});var wt={};l(wt,{lint:()=>fe});import{execSync as ks}from"child_proce
120
120
  888 888 888 888 888 T88b d88P 888 888 888 888 888 888
121
121
  Y88b. .d88P 888 888 888 T88b d8888888888 Y88b d88P 888 888 888
122
122
  "Y88888P" 88888888 888 888 T88b d88P 888 "Y8888P" 8888888 888 8888888888
123
- `});var Pt={};l(Pt,{tsconfig:()=>P});import{readFile as Ms,writeFile as Rt}from"fs/promises";import Os from"deepmerge";import{parse as Js}from"jsonc-parser";var At,B,P,ve=a(()=>{"use strict";p();At={compilerOptions:{strictNullChecks:!0}},B="./tsconfig.json",P={exists:()=>i(B),create:()=>Rt(B,JSON.stringify(At,null,2)),update:async()=>{let e=await Ms(B,"utf-8"),s=Js(e)||{},n=Os(s,At);await Rt(B,JSON.stringify(n,null,2))}}});var It={};l(It,{vscodeCopilot:()=>F});import{mkdir as Ft,writeFile as Ut}from"fs/promises";var xe,$t,F,ke=a(()=>{"use strict";h();p();xe="./.github/copilot-instructions.md",$t=`---
123
+ `});var $t={};d($t,{tsconfig:()=>U});import{readFile as Os,writeFile as Ft}from"fs/promises";import Es from"deepmerge";import{parse as zs}from"jsonc-parser";var At,H,U,ke=l(()=>{"use strict";m();At={compilerOptions:{strictNullChecks:!0}},H="./tsconfig.json",U={exists:()=>i(H),create:()=>Ft(H,JSON.stringify(At,null,2)),update:async()=>{let e=await Os(H,"utf-8"),s=zs(e)||{},n=Es(s,At);await Ft(H,JSON.stringify(n,null,2))}}});var Ot={};d(Ot,{vscodeCopilot:()=>I});import{mkdir as Ut,writeFile as It}from"fs/promises";var De,Mt,I,Ce=l(()=>{"use strict";y();m();De="./.github/copilot-instructions.md",Mt=`---
124
124
  applyTo: "**/*.{ts,tsx,js,jsx}"
125
125
  ---
126
126
 
127
- ${u}`,F={exists:()=>i(xe),create:async()=>{await Ft(".github",{recursive:!0}),await Ut(xe,$t)},update:async()=>{await Ft(".github",{recursive:!0}),await Ut(xe,$t)}}});var Jt={};l(Jt,{vscode:()=>U});import{mkdir as Ns,readFile as Ws,writeFile as Mt}from"fs/promises";import Es from"deepmerge";import{parse as Ts}from"jsonc-parser";var Ot,H,U,De=a(()=>{"use strict";p();Ot={"editor.defaultFormatter":"esbenp.prettier-vscode","[javascript][typescript][javascriptreact][typescriptreact][json][jsonc][css][graphql]":{"editor.defaultFormatter":"biomejs.biome"},"typescript.tsdk":"node_modules/typescript/lib","editor.formatOnSave":!0,"editor.formatOnPaste":!0,"emmet.showExpandedAbbreviation":"never","editor.codeActionsOnSave":{"source.fixAll.biome":"explicit","source.organizeImports.biome":"explicit"}},H="./.vscode/settings.json",U={exists:()=>i(H),create:async()=>{await Ns(".vscode",{recursive:!0}),await Mt(H,JSON.stringify(Ot,null,2))},update:async()=>{let e=await Ws(H,"utf-8"),s=Ts(e)||{},n=Es(s,Ot);await Mt(H,JSON.stringify(n,null,2))}}});var Et={};l(Et,{windsurf:()=>$});import{mkdir as Nt,writeFile as Wt}from"fs/promises";var Ce,$,je=a(()=>{"use strict";h();p();Ce="./.windsurf/rules/ultracite.md",$={exists:()=>i(Ce),create:async()=>{await Nt(".windsurf/rules",{recursive:!0}),await Wt(Ce,u)},update:async()=>{await Nt(".windsurf/rules",{recursive:!0}),await Wt(Ce,u)}}});var Lt={};l(Lt,{zed:()=>I});import{mkdir as zs,readFile as Ls,writeFile as Tt}from"fs/promises";import _s from"deepmerge";import{parse as qs}from"jsonc-parser";var zt,K,I,Se=a(()=>{"use strict";p();zt={formatter:"language_server",format_on_save:"on",languages:{JavaScript:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},TypeScript:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},JSX:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},TSX:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}}},lsp:{"typescript-language-server":{settings:{typescript:{preferences:{includePackageJsonAutoImports:"on"}}}}}},K="./.zed/settings.json",I={exists:()=>i(K),create:async()=>{await zs(".zed",{recursive:!0}),await Tt(K,JSON.stringify(zt,null,2))},update:async()=>{let e=await Ls(K,"utf-8"),s=qs(e)||{},n=_s(s,zt);await Tt(K,JSON.stringify(n,null,2))}}});var _t={};l(_t,{zedCopilot:()=>M});import{readFile as Bs,writeFile as Re}from"fs/promises";var k,M,Ae=a(()=>{"use strict";h();p();k="./.rules",M={exists:()=>i(k),create:async()=>{await Re(k,u)},update:async()=>{if(!await i(k)){await Re(k,u);return}let e=await Bs(k,"utf-8");e.includes(u.trim())||await Re(k,`${e}
127
+ ${p}`,I={exists:()=>i(De),create:async()=>{await Ut(".github",{recursive:!0}),await It(De,Mt)},update:async()=>{await Ut(".github",{recursive:!0}),await It(De,Mt)}}});var Jt={};d(Jt,{vscode:()=>M});import{mkdir as Js,readFile as Ts,writeFile as Et}from"fs/promises";import Ns from"deepmerge";import{parse as Ws}from"jsonc-parser";var zt,K,M,je=l(()=>{"use strict";m();zt={"editor.defaultFormatter":"esbenp.prettier-vscode","[javascript]":{"editor.defaultFormatter":"biomejs.biome"},"[typescript]":{"editor.defaultFormatter":"biomejs.biome"},"[javascriptreact]":{"editor.defaultFormatter":"biomejs.biome"},"[typescriptreact]":{"editor.defaultFormatter":"biomejs.biome"},"[json]":{"editor.defaultFormatter":"biomejs.biome"},"[jsonc]":{"editor.defaultFormatter":"biomejs.biome"},"[css]":{"editor.defaultFormatter":"biomejs.biome"},"[graphql]":{"editor.defaultFormatter":"biomejs.biome"},"typescript.tsdk":"node_modules/typescript/lib","editor.formatOnSave":!0,"editor.formatOnPaste":!0,"emmet.showExpandedAbbreviation":"never","editor.codeActionsOnSave":{"source.fixAll.biome":"explicit","source.organizeImports.biome":"explicit"}},K="./.vscode/settings.json",M={exists:()=>i(K),create:async()=>{await Js(".vscode",{recursive:!0}),await Et(K,JSON.stringify(zt,null,2))},update:async()=>{let e=await Ts(K,"utf-8"),s=Ws(e)||{},n=Ns(s,zt);await Et(K,JSON.stringify(n,null,2))}}});var Wt={};d(Wt,{windsurf:()=>O});import{mkdir as Tt,writeFile as Nt}from"fs/promises";var Se,O,Re=l(()=>{"use strict";y();m();Se="./.windsurf/rules/ultracite.md",O={exists:()=>i(Se),create:async()=>{await Tt(".windsurf/rules",{recursive:!0}),await Nt(Se,p)},update:async()=>{await Tt(".windsurf/rules",{recursive:!0}),await Nt(Se,p)}}});var qt={};d(qt,{zed:()=>E});import{mkdir as Ls,readFile as _s,writeFile as Lt}from"fs/promises";import qs from"deepmerge";import{parse as Bs}from"jsonc-parser";var _t,V,E,Pe=l(()=>{"use strict";m();_t={formatter:"language_server",format_on_save:"on",languages:{JavaScript:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},TypeScript:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},JSX:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},TSX:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}}},lsp:{"typescript-language-server":{settings:{typescript:{preferences:{includePackageJsonAutoImports:"on"}}}}}},V="./.zed/settings.json",E={exists:()=>i(V),create:async()=>{await Ls(".zed",{recursive:!0}),await Lt(V,JSON.stringify(_t,null,2))},update:async()=>{let e=await _s(V,"utf-8"),s=Bs(e)||{},n=qs(s,_t);await Lt(V,JSON.stringify(n,null,2))}}});var Bt={};d(Bt,{zedCopilot:()=>z});import{readFile as Hs,writeFile as Fe}from"fs/promises";var j,z,Ae=l(()=>{"use strict";y();m();j="./.rules",z={exists:()=>i(j),create:async()=>{await Fe(j,p)},update:async()=>{if(!await i(j)){await Fe(j,p);return}let e=await Hs(j,"utf-8");e.includes(p.trim())||await Fe(j,`${e}
128
128
 
129
- ${u}`)}}});var Ks,Pe=a(()=>{Ks=Je({"./biome.ts":()=>(se(),c(ze)),"./claude.ts":()=>(oe(),c(Xe)),"./codex.ts":()=>(re(),c(et)),"./cursor.ts":()=>(ce(),c(nt)),"./eslint-cleanup.ts":()=>(le(),c(ct)),"./format.ts":()=>(Q(),c(Ne)),"./husky.ts":()=>(ue(),c(dt)),"./index.ts":()=>(Ht(),c(Hs)),"./initialize.ts":()=>(Ue(),c(Bt)),"./kiro.ts":()=>(pe(),c(ft)),"./lefthook.ts":()=>(me(),c(yt)),"./lint-staged.ts":()=>(Fe(),c(qt)),"./lint.ts":()=>(ge(),c(wt)),"./package-manager.ts":()=>(he(),c(vt)),"./prettier-cleanup.ts":()=>(ye(),c(jt)),"./title.ts":()=>(be(),c(St)),"./tsconfig.ts":()=>(ve(),c(Pt)),"./utils.ts":()=>(p(),c(We)),"./vscode-copilot.ts":()=>(ke(),c(It)),"./vscode-settings.ts":()=>(De(),c(Jt)),"./windsurf.ts":()=>(je(),c(Et)),"./zed-settings.ts":()=>(Se(),c(Lt)),"./zed.ts":()=>(Ae(),c(_t))})});var qt={};l(qt,{lintStaged:()=>D});import{execSync as Vs}from"child_process";import{readFile as V,writeFile as w}from"fs/promises";import{pathToFileURL as Gs}from"url";import O from"deepmerge";import{parse as Ie}from"jsonc-parser";var y,Kt,Ys,Zs,Xs,Qs,en,tn,sn,nn,on,$e,rn,D,Fe=a(()=>{"use strict";p();Pe();y={"*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}":["npx ultracite format"]},Kt=["./package.json","./.lintstagedrc.json","./.lintstagedrc.js","./.lintstagedrc.cjs","./.lintstagedrc.mjs","./lint-staged.config.js","./lint-staged.config.cjs","./lint-staged.config.mjs","./.lintstagedrc.yaml","./.lintstagedrc.yml","./.lintstagedrc"],Ys=(e,t,s,n)=>{let o=e.trim();if(o.includes(":")&&!o.startsWith("-")){s&&n.length>0&&(t[s]=n);let[r,...m]=o.split(":"),d=m.join(":").trim(),g=r.trim().replace(/['"]/g,"");return d&&d!==""?(d.startsWith("[")&&d.endsWith("]")?t[g]=d.slice(1,-1).split(",").map(Vt=>Vt.trim().replace(/['"]/g,"")):t[g]=d.replace(/['"]/g,""),{newCurrentKey:null,newCurrentArray:[]}):{newCurrentKey:g,newCurrentArray:[]}}if(o.startsWith("-")&&s){let r=[...n,o.slice(1).trim().replace(/['"]/g,"")];return{newCurrentKey:s,newCurrentArray:r}}return{newCurrentKey:s,newCurrentArray:n}},Zs=e=>{let t=e.split(`
130
- `).filter(r=>r.trim()&&!r.trim().startsWith("#")),s={},n=null,o=[];for(let r of t){let m=Ys(r,s,n,o);n=m.newCurrentKey,o=m.newCurrentArray}return n&&o.length>0&&(s[n]=o),s},Xs=e=>{let t="";for(let[s,n]of Object.entries(e))if(Array.isArray(n)){t+=`${s}:
129
+ ${p}`)}}});var Vs,$e=l(()=>{Vs=Je({"./biome.ts":()=>(ne(),u(_e)),"./claude.ts":()=>(ie(),u(et)),"./codex.ts":()=>(ae(),u(st)),"./cursor.ts":()=>(le(),u(it)),"./eslint-cleanup.ts":()=>(ue(),u(ut)),"./format.ts":()=>(te(),u(Te)),"./husky.ts":()=>(de(),u(mt)),"./index.ts":()=>(Vt(),u(Ks)),"./initialize.ts":()=>(Ie(),u(Kt)),"./kiro.ts":()=>(me(),u(yt)),"./lefthook.ts":()=>(fe(),u(vt)),"./lint-staged.ts":()=>(Ue(),u(Ht)),"./lint.ts":()=>(he(),u(xt)),"./package-manager.ts":()=>(we(),u(kt)),"./prettier-cleanup.ts":()=>(be(),u(Rt)),"./title.ts":()=>(xe(),u(Pt)),"./tsconfig.ts":()=>(ke(),u($t)),"./utils.ts":()=>(m(),u(Ne)),"./vscode-copilot.ts":()=>(Ce(),u(Ot)),"./vscode-settings.ts":()=>(je(),u(Jt)),"./windsurf.ts":()=>(Re(),u(Wt)),"./zed-settings.ts":()=>(Pe(),u(qt)),"./zed.ts":()=>(Ae(),u(Bt))})});var Ht={};d(Ht,{lintStaged:()=>S});import{execSync as Gs}from"child_process";import{readFile as G,writeFile as b}from"fs/promises";import{pathToFileURL as Ys}from"url";import J from"deepmerge";import{parse as Oe}from"jsonc-parser";var w,Gt,Zs,Xs,Qs,en,tn,sn,nn,on,rn,Me,an,S,Ue=l(()=>{"use strict";m();$e();w={"*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}":["npx ultracite format"]},Gt=["./package.json","./.lintstagedrc.json","./.lintstagedrc.js","./.lintstagedrc.cjs","./.lintstagedrc.mjs","./lint-staged.config.js","./lint-staged.config.cjs","./lint-staged.config.mjs","./.lintstagedrc.yaml","./.lintstagedrc.yml","./.lintstagedrc"],Zs=(e,t,s,n)=>{let o=e.trim();if(o.includes(":")&&!o.startsWith("-")){s&&n.length>0&&(t[s]=n);let[r,...c]=o.split(":"),a=c.join(":").trim(),f=r.trim().replace(/['"]/g,"");return a&&a!==""?(a.startsWith("[")&&a.endsWith("]")?t[f]=a.slice(1,-1).split(",").map(T=>T.trim().replace(/['"]/g,"")):t[f]=a.replace(/['"]/g,""),{newCurrentKey:null,newCurrentArray:[]}):{newCurrentKey:f,newCurrentArray:[]}}if(o.startsWith("-")&&s){let r=[...n,o.slice(1).trim().replace(/['"]/g,"")];return{newCurrentKey:s,newCurrentArray:r}}return{newCurrentKey:s,newCurrentArray:n}},Xs=e=>{let t=e.split(`
130
+ `).filter(r=>r.trim()&&!r.trim().startsWith("#")),s={},n=null,o=[];for(let r of t){let c=Zs(r,s,n,o);n=c.newCurrentKey,o=c.newCurrentArray}return n&&o.length>0&&(s[n]=o),s},Qs=e=>{let t="";for(let[s,n]of Object.entries(e))if(Array.isArray(n)){t+=`${s}:
131
131
  `;for(let o of n)t+=` - '${o}'
132
132
  `}else t+=`${s}: '${n}'
133
- `;return t},Qs=async()=>{try{let e=Ie(await V("./package.json","utf-8"));return e?e.type==="module":!1}catch{return!1}},en=async()=>{let e=Ie(await V("./package.json","utf-8"));e&&(e["lint-staged"]?e["lint-staged"]=O(e["lint-staged"],y):e["lint-staged"]=y,await w("./package.json",JSON.stringify(e,null,2)))},tn=async e=>{let t=await V(e,"utf-8"),s=Ie(t);if(!s)return;let n=O(s,y);await w(e,JSON.stringify(n,null,2))},sn=async e=>{let t=await V(e,"utf-8"),s=Zs(t);if(!s)return;let n=O(s,y);await w(e,Xs(n))},nn=async e=>{let n=(await import(Gs(e).href)).default||{},o=O(n,y),r=`export default ${JSON.stringify(o,null,2)};
134
- `;await w(e,r)},on=async e=>{delete Z.cache[Z.resolve(`./${e}`)];let t=Ks(`./${e}`),s=O(t,y),n=`module.exports = ${JSON.stringify(s,null,2)};
135
- `;await w(e,n)},$e=async()=>{await w(".lintstagedrc.json",JSON.stringify(y,null,2))},rn=async e=>{if(e==="./package.json"){await en();return}if(e.endsWith(".json")||e==="./.lintstagedrc"){await tn(e);return}if(e.endsWith(".yaml")||e.endsWith(".yml")){await sn(e);return}let t=await Qs();if(e.endsWith(".mjs")||e.endsWith(".js")&&t){try{await nn(e)}catch{await $e()}return}if(e.endsWith(".cjs")||e.endsWith(".js")&&!t)try{await on(e)}catch{await $e()}},D={exists:async()=>{for(let e of Kt)if(await i(e))return!0;return!1},install:e=>{Vs(`${e} -D lint-staged`)},create:async()=>{await w(".lintstagedrc.json",JSON.stringify(y,null,2))},update:async()=>{let e=null;for(let t of Kt)if(await i(t)){e=t;break}if(!e){await $e();return}await rn(e)}}});var Bt={};l(Bt,{initialize:()=>Oe});import{execSync as an}from"child_process";import cn from"process";import{intro as ln,log as Me,multiselect as G,spinner as f}from"@clack/prompts";var un,dn,pn,mn,fn,gn,hn,yn,wn,bn,vn,xn,kn,Dn,Cn,jn,Sn,Rn,Oe,Ue=a(()=>{"use strict";se();oe();re();ce();le();ue();pe();me();Fe();he();ye();be();ve();ke();De();je();Ae();Se();ee();un=W.devDependencies["@biomejs/biome"],dn=e=>{let t=f();t.start("Installing dependencies..."),an(`${e} -D -E ultracite @biomejs/biome@${un}`),t.stop("Dependencies installed.")},pn=async()=>{let e=f();if(e.start("Checking for tsconfig.json..."),await P.exists()){e.message("tsconfig.json found, updating..."),await P.update(),e.stop("tsconfig.json updated.");return}e.message("tsconfig.json not found, creating..."),await P.create(),e.stop("tsconfig.json created.")},mn=async()=>{let e=f();if(e.start("Checking for .vscode/settings.json..."),await U.exists()){e.message("settings.json found, updating..."),await U.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await U.create(),e.stop("settings.json created.")},fn=async()=>{let e=f();if(e.start("Checking for .zed/settings.json..."),await I.exists()){e.message("settings.json found, updating..."),await I.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await I.create(),e.stop("settings.json created.")},gn=async()=>{let e=f();if(e.start("Checking for Biome configuration..."),await C.exists()){e.message("Biome configuration found, updating..."),await C.update(),e.stop("Biome configuration updated.");return}e.message("Biome configuration not found, creating..."),await C.create(),e.stop("Biome configuration created.")},hn=async e=>{let t=f();if(t.start("Initializing pre-commit hooks..."),t.message("Installing Husky..."),b.install(e),await b.exists()){t.message("Pre-commit hook found, updating..."),await b.update(),t.stop("Pre-commit hook updated.");return}t.message("Updating pre-commit hook..."),t.message("Pre-commit hook not found, creating..."),await b.create(),t.stop("Pre-commit hook created.")},yn=async e=>{let t=f();if(t.start("Initializing lefthook..."),t.message("Installing lefthook..."),x.install(e),await x.exists()){t.message("lefthook.yml found, updating..."),await x.update(),t.stop("lefthook.yml updated.");return}t.message("lefthook.yml not found, creating..."),await x.create(),t.stop("lefthook.yml created.")},wn=async e=>{let t=f();if(t.start("Initializing lint-staged..."),t.message("Installing lint-staged..."),D.install(e),await D.exists()){t.message("lint-staged found, updating..."),await D.update(),t.stop("lint-staged updated.");return}t.message("lint-staged not found, creating..."),await D.create(),t.stop("lint-staged created.")},bn=async()=>{let e=f();if(e.start("Checking for GitHub Copilot rules..."),await F.exists()){e.message("GitHub Copilot rules found, updating..."),await F.update(),e.stop("GitHub Copilot rules updated.");return}e.message("GitHub Copilot rules not found, creating..."),await F.create(),e.stop("GitHub Copilot rules created.")},vn=async()=>{let e=f();if(e.start("Checking for Cursor rules..."),await R.exists()){e.message("Cursor rules found, updating..."),await R.update(),e.stop("Cursor rules updated.");return}e.message("Cursor rules not found, creating..."),await R.create(),e.stop("Cursor rules created.")},xn=async()=>{let e=f();if(e.start("Checking for Windsurf rules..."),await $.exists()){e.message("Windsurf rules found, updating..."),await $.update(),e.stop("Windsurf rules updated.");return}e.message("Windsurf rules not found, creating..."),await $.create(),e.stop("Windsurf rules created.")},kn=async()=>{let e=f();if(e.start("Checking for Zed rules..."),await M.exists()){e.message("Zed rules found, updating..."),await M.update(),e.stop("Zed rules updated.");return}e.message("Zed rules not found, creating..."),await M.create(),e.stop("Zed rules created.")},Dn=async()=>{let e=f();if(e.start("Checking for Claude Code rules..."),await j.exists()){e.message("Claude Code rules found, updating..."),await j.update(),e.stop("Claude Code rules updated.");return}e.message("Claude Code rules not found, creating..."),await j.create(),e.stop("Claude Code rules created.")},Cn=async()=>{let e=f();if(e.start("Checking for OpenAI Codex rules..."),await S.exists()){e.message("OpenAI Codex rules found, updating..."),await S.update(),e.stop("OpenAI Codex rules updated.");return}e.message("OpenAI Codex rules not found, creating..."),await S.create(),e.stop("OpenAI Codex rules created.")},jn=async()=>{let e=f();if(e.start("Checking for Kiro IDE steering files..."),await A.exists()){e.message("Kiro IDE steering files found, updating..."),await A.update(),e.stop("Kiro IDE steering files updated.");return}e.message("Kiro IDE steering files not found, creating..."),await A.create(),e.stop("Kiro IDE steering files created.")},Sn=async e=>{let t=f();t.start("Removing Prettier dependencies and configuration...");try{let s=await q.remove(e);s.packagesRemoved.length>0&&t.message(`Removed Prettier packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&t.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&t.message("Cleaned VS Code settings"),t.stop("Prettier removed successfully.")}catch{t.stop("Failed to remove Prettier completely, but continuing...")}},Rn=async e=>{let t=f();t.start("Removing ESLint dependencies and configuration...");try{let s=await E.remove(e);s.packagesRemoved.length>0&&t.message(`Removed ESLint packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&t.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&t.message("Cleaned VS Code settings"),t.stop("ESLint removed successfully.")}catch{t.stop("Failed to remove ESLint completely, but continuing...")}},Oe=async()=>{ln(we);try{let e=await _.get();if(e?Me.info(`Detected lockfile, using ${e}`):e=await _.select(),!e||typeof e!="string")throw new Error("No package manager selected");let t=[];await q.hasPrettier()&&t.push({label:"Remove Prettier (dependencies, config files, VS Code settings)",value:"prettier"}),await E.hasESLint()&&t.push({label:"Remove ESLint (dependencies, config files, VS Code settings)",value:"eslint"});let s=[];t.length>0&&(s=await G({message:"Remove existing formatters/linters (recommended for clean migration)?",options:t,required:!1}));let n=await G({message:"Which editors do you want to configure (recommended)?",options:[{label:"VSCode / Cursor / Windsurf",value:"vscode"},{label:"Zed",value:"zed"}],required:!1}),o=await G({message:"Which editor rules do you want to enable (optional)?",options:[{label:"GitHub Copilot (VSCode)",value:"vscode-copilot"},{label:"Cursor",value:"cursor"},{label:"Windsurf",value:"windsurf"},{label:"Zed",value:"zed"},{label:"Claude Code",value:"claude"},{label:"OpenAI Codex",value:"codex"},{label:"Kiro IDE",value:"kiro"}],required:!1}),r=await G({message:"Would you like any of the following (optional)?",options:[{label:"Husky pre-commit hook",value:"precommit-hooks"},{label:"Lefthook pre-commit hook",value:"lefthook"},{label:"Lint-staged",value:"lint-staged"}],required:!1});Array.isArray(s)&&(s.includes("prettier")&&await Sn(e),s.includes("eslint")&&await Rn(e)),dn(e),await pn(),await gn(),Array.isArray(n)&&(n.includes("zed")&&await fn(),n.includes("vscode")&&await mn()),Array.isArray(o)&&(o.includes("vscode-copilot")&&await bn(),o.includes("cursor")&&await vn(),o.includes("windsurf")&&await xn(),o.includes("zed")&&await kn(),o.includes("claude")&&await Dn(),o.includes("codex")&&await Cn(),o.includes("kiro")&&await jn()),Array.isArray(r)&&(r.includes("precommit-hooks")&&await hn(e),r.includes("lefthook")&&await yn(e),r.includes("lint-staged")&&await wn(e)),Me.success("Successfully initialized Ultracite configuration!")}catch(e){let t=e instanceof Error?e.message:"Unknown error";Me.error(`Failed to initialize Ultracite configuration: ${t}`),cn.exit(1)}}});var Hs={};import{Command as An}from"commander";var J,Ht=a(()=>{Q();Ue();ge();J=new An;J.name("Ultracite").description("Ship code faster and with more confidence.");J.command("init").description("Initialize Ultracite in the current directory").action(Oe);J.command("lint").description("Run Biome linter without fixing files").argument("[files...]","specific files to lint (optional)").action(fe);J.command("format").description("Run Biome linter and fixes files").argument("[files...]","specific files to format (optional)").option("--unsafe","apply unsafe fixes").action(X);J.parse()});Ht();
133
+ `;return t},en=async()=>{try{let e=Oe(await G("./package.json","utf-8"));return e?e.type==="module":!1}catch{return!1}},tn=async()=>{let e=Oe(await G("./package.json","utf-8"));e&&(e["lint-staged"]?e["lint-staged"]=J(e["lint-staged"],w):e["lint-staged"]=w,await b("./package.json",JSON.stringify(e,null,2)))},sn=async e=>{let t=await G(e,"utf-8"),s=Oe(t);if(!s)return;let n=J(s,w);await b(e,JSON.stringify(n,null,2))},nn=async e=>{let t=await G(e,"utf-8"),s=Xs(t);if(!s)return;let n=J(s,w);await b(e,Qs(n))},on=async e=>{let n=(await import(Ys(e).href)).default||{},o=J(n,w),r=`export default ${JSON.stringify(o,null,2)};
134
+ `;await b(e,r)},rn=async e=>{delete Q.cache[Q.resolve(`./${e}`)];let t=Vs(`./${e}`),s=J(t,w),n=`module.exports = ${JSON.stringify(s,null,2)};
135
+ `;await b(e,n)},Me=async()=>{await b(".lintstagedrc.json",JSON.stringify(w,null,2))},an=async e=>{if(e==="./package.json"){await tn();return}if(e.endsWith(".json")||e==="./.lintstagedrc"){await sn(e);return}if(e.endsWith(".yaml")||e.endsWith(".yml")){await nn(e);return}let t=await en();if(e.endsWith(".mjs")||e.endsWith(".js")&&t){try{await on(e)}catch{await Me()}return}if(e.endsWith(".cjs")||e.endsWith(".js")&&!t)try{await rn(e)}catch{await Me()}},S={exists:async()=>{for(let e of Gt)if(await i(e))return!0;return!1},install:e=>{Gs(`${e} -D lint-staged`)},create:async()=>{await b(".lintstagedrc.json",JSON.stringify(w,null,2))},update:async()=>{let e=null;for(let t of Gt)if(await i(t)){e=t;break}if(!e){await Me();return}await an(e)}}});var Kt={};d(Kt,{initialize:()=>ze});import{execSync as cn}from"child_process";import ln from"process";import{intro as un,log as Ee,multiselect as Y,spinner as h}from"@clack/prompts";var dn,pn,mn,fn,gn,hn,yn,wn,bn,vn,xn,kn,Dn,Cn,jn,Sn,Rn,Pn,ze,Ie=l(()=>{"use strict";ne();ie();ae();le();ue();de();me();fe();Ue();we();be();xe();ke();Ce();je();Re();Ae();Pe();N();dn=v.devDependencies["@biomejs/biome"],pn=e=>{let t=h();t.start("Installing dependencies..."),cn(`${e} -D -E ultracite @biomejs/biome@${dn}`),t.stop("Dependencies installed.")},mn=async()=>{let e=h();if(e.start("Checking for tsconfig.json..."),await U.exists()){e.message("tsconfig.json found, updating..."),await U.update(),e.stop("tsconfig.json updated.");return}e.message("tsconfig.json not found, creating..."),await U.create(),e.stop("tsconfig.json created.")},fn=async()=>{let e=h();if(e.start("Checking for .vscode/settings.json..."),await M.exists()){e.message("settings.json found, updating..."),await M.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await M.create(),e.stop("settings.json created.")},gn=async()=>{let e=h();if(e.start("Checking for .zed/settings.json..."),await E.exists()){e.message("settings.json found, updating..."),await E.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await E.create(),e.stop("settings.json created.")},hn=async()=>{let e=h();if(e.start("Checking for Biome configuration..."),await P.exists()){e.message("Biome configuration found, updating..."),await P.update(),e.stop("Biome configuration updated.");return}e.message("Biome configuration not found, creating..."),await P.create(),e.stop("Biome configuration created.")},yn=async e=>{let t=h();if(t.start("Initializing pre-commit hooks..."),t.message("Installing Husky..."),x.install(e),await x.exists()){t.message("Pre-commit hook found, updating..."),await x.update(),t.stop("Pre-commit hook updated.");return}t.message("Pre-commit hook not found, creating..."),await x.create(),t.stop("Pre-commit hook created.")},wn=async e=>{let t=h();if(t.start("Initializing lefthook..."),t.message("Installing lefthook..."),D.install(e),await D.exists()){t.message("lefthook.yml found, updating..."),await D.update(),t.stop("lefthook.yml updated.");return}t.message("lefthook.yml not found, creating..."),await D.create(),t.stop("lefthook.yml created.")},bn=async e=>{let t=h();if(t.start("Initializing lint-staged..."),t.message("Installing lint-staged..."),S.install(e),await S.exists()){t.message("lint-staged found, updating..."),await S.update(),t.stop("lint-staged updated.");return}t.message("lint-staged not found, creating..."),await S.create(),t.stop("lint-staged created.")},vn=async()=>{let e=h();if(e.start("Checking for GitHub Copilot rules..."),await I.exists()){e.message("GitHub Copilot rules found, updating..."),await I.update(),e.stop("GitHub Copilot rules updated.");return}e.message("GitHub Copilot rules not found, creating..."),await I.create(),e.stop("GitHub Copilot rules created.")},xn=async()=>{let e=h();if(e.start("Checking for Cursor rules..."),await $.exists()){e.message("Cursor rules found, updating..."),await $.update(),e.stop("Cursor rules updated.");return}e.message("Cursor rules not found, creating..."),await $.create(),e.stop("Cursor rules created.")},kn=async()=>{let e=h();if(e.start("Checking for Windsurf rules..."),await O.exists()){e.message("Windsurf rules found, updating..."),await O.update(),e.stop("Windsurf rules updated.");return}e.message("Windsurf rules not found, creating..."),await O.create(),e.stop("Windsurf rules created.")},Dn=async()=>{let e=h();if(e.start("Checking for Zed rules..."),await z.exists()){e.message("Zed rules found, updating..."),await z.update(),e.stop("Zed rules updated.");return}e.message("Zed rules not found, creating..."),await z.create(),e.stop("Zed rules created.")},Cn=async()=>{let e=h();if(e.start("Checking for Claude Code rules..."),await F.exists()){e.message("Claude Code rules found, updating..."),await F.update(),e.stop("Claude Code rules updated.");return}e.message("Claude Code rules not found, creating..."),await F.create(),e.stop("Claude Code rules created.")},jn=async()=>{let e=h();if(e.start("Checking for OpenAI Codex rules..."),await A.exists()){e.message("OpenAI Codex rules found, updating..."),await A.update(),e.stop("OpenAI Codex rules updated.");return}e.message("OpenAI Codex rules not found, creating..."),await A.create(),e.stop("OpenAI Codex rules created.")},Sn=async e=>{let t=h();t.start("Removing Prettier dependencies and configuration...");try{let s=await B.remove(e);s.packagesRemoved.length>0&&t.message(`Removed Prettier packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&t.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&t.message("Cleaned VS Code settings"),t.stop("Prettier removed successfully.")}catch{t.stop("Failed to remove Prettier completely, but continuing...")}},Rn=async e=>{let t=h();t.start("Removing ESLint dependencies and configuration...");try{let s=await W.remove(e);s.packagesRemoved.length>0&&t.message(`Removed ESLint packages: ${s.packagesRemoved.join(", ")}`),s.filesRemoved.length>0&&t.message(`Removed config files: ${s.filesRemoved.join(", ")}`),s.vsCodeCleaned&&t.message("Cleaned VS Code settings"),t.stop("ESLint removed successfully.")}catch{t.stop("Failed to remove ESLint completely, but continuing...")}},Pn=async e=>{if(e){let n=C.options.find(r=>r.label===e);if(!n)throw new Error(`Unsupported package manager: ${e}`);return await C.isMonorepo()&&n.monorepoSuffix?`${n.value} ${n.monorepoSuffix}`:n.value}let t=await C.get();if(t)return Ee.info(`Detected lockfile, using ${t}`),t;let s=await C.select();if(!s)throw new Error("No package manager selected");return s},ze=async e=>{un(ve);try{let t=e??{},s=await Pn(t.pm),n=t.removePrettier,o=t.removeEslint;if(n===void 0||o===void 0){let f=[];if(n===void 0&&await B.hasPrettier()&&f.push({label:"Remove Prettier (dependencies, config files, VS Code settings)",value:"prettier"}),o===void 0&&await W.hasESLint()&&f.push({label:"Remove ESLint (dependencies, config files, VS Code settings)",value:"eslint"}),f.length>0){let T=await Y({message:"Remove existing formatters/linters (recommended for clean migration)?",options:f,required:!1});n===void 0&&(n=T.includes("prettier")),o===void 0&&(o=T.includes("eslint"))}}let r=t.editors;r||(r=await Y({message:"Which editors do you want to configure (recommended)?",options:[{label:"VSCode / Cursor / Windsurf",value:"vscode"},{label:"Zed",value:"zed"}],required:!1}));let c=t.rules;c||(c=await Y({message:"Which editor rules do you want to enable (optional)?",options:[{label:"GitHub Copilot (VSCode)",value:"vscode-copilot"},{label:"Cursor",value:"cursor"},{label:"Windsurf",value:"windsurf"},{label:"Zed",value:"zed"},{label:"Claude Code",value:"claude"},{label:"OpenAI Codex",value:"codex"}],required:!1}));let a=t.features;a||(a=await Y({message:"Would you like any of the following (optional)?",options:[{label:"Husky pre-commit hook",value:"husky"},{label:"Lefthook pre-commit hook",value:"lefthook"},{label:"Lint-staged",value:"lint-staged"}],required:!1})),n&&await Sn(s),o&&await Rn(s),pn(s),await mn(),await hn(),r?.includes("vscode")&&await fn(),r?.includes("zed")&&await gn(),c?.includes("vscode-copilot")&&await vn(),c?.includes("cursor")&&await xn(),c?.includes("windsurf")&&await kn(),c?.includes("zed")&&await Dn(),c?.includes("claude")&&await Cn(),c?.includes("codex")&&await jn(),a?.includes("husky")&&await yn(s),a?.includes("lefthook")&&await wn(s),a?.includes("lint-staged")&&await bn(s),Ee.success("Successfully initialized Ultracite configuration!")}catch(t){let s=t instanceof Error?t.message:"Unknown error";Ee.error(`Failed to initialize Ultracite configuration: ${s}`),ln.exit(1)}}});var Ks={};import{createCli as Fn,trpcServer as An}from"trpc-cli";import g from"zod";var Z,$n,Un,Vt=l(()=>{N();te();Ie();he();Z=An.initTRPC.meta().create(),$n=Z.router({init:Z.procedure.meta({description:"Initialize Ultracite in the current directory"}).input(g.object({pm:g.enum(["pnpm","bun","yarn","npm"]).optional().describe("Package manager to use"),editors:g.array(g.enum(["vscode","zed"])).optional().describe("Editors to configure"),rules:g.array(g.enum(["vscode-copilot","cursor","windsurf","zed","claude","codex"])).optional().describe("Editor rules to enable"),features:g.array(g.enum(["husky","lefthook","lint-staged"])).optional().describe("Additional features to enable"),removePrettier:g.boolean().optional().describe("Remove Prettier dependencies and configuration"),removeEslint:g.boolean().optional().describe("Remove ESLint dependencies and configuration")})).mutation(async({input:e})=>{await ze(e)}),lint:Z.procedure.meta({description:"Run Biome linter without fixing files"}).input(g.array(g.string()).optional().default([]).describe("specific files to lint")).query(({input:e})=>{ge(e)}),format:Z.procedure.meta({description:"Run Biome linter and fixes files"}).input(g.tuple([g.array(g.string()).optional().default([]).describe("specific files to format"),g.object({unsafe:g.boolean().optional().describe("apply unsafe fixes")})])).mutation(({input:e})=>{let[t,s]=e;ee(t,{unsafe:s.unsafe})})}),Un=Fn({router:$n,name:"ultracite",version:v.version,description:"Ship code faster and with more confidence."});process.env.VITEST||Un.run()});Vt();
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.0.48",
4
+ "version": "5.1.0",
5
5
  "bin": {
6
6
  "ultracite": "dist/index.js"
7
7
  },
@@ -46,10 +46,11 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@clack/prompts": "^0.11.0",
49
- "commander": "^14.0.0",
50
49
  "deepmerge": "^4.3.1",
51
50
  "jsonc-parser": "^3.3.1",
52
- "vitest": "^3.2.4"
51
+ "trpc-cli": "^0.10.0",
52
+ "vitest": "^3.2.4",
53
+ "zod": "^4.0.5"
53
54
  },
54
55
  "packageManager": "pnpm@10.13.1"
55
56
  }