ultracite 5.1.9 → 5.2.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,8 +1,17 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var Pt=Object.create;var L=Object.defineProperty;var Ft=Object.getOwnPropertyDescriptor;var At=Object.getOwnPropertyNames;var $t=Object.getPrototypeOf,It=Object.prototype.hasOwnProperty;var Ie=e=>t=>{var s=e[t];if(s)return s();throw new Error("Module not found in bundle: "+t)};var E=(e,t)=>()=>(e&&(t=e(e=0)),t);var de=(e,t)=>{for(var s in t)L(e,s,{get:t[s],enumerable:!0})},Oe=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of At(t))!It.call(e,o)&&o!==s&&L(e,o,{get:()=>t[o],enumerable:!(n=Ft(t,o))||n.enumerable});return e};var h=(e,t,s)=>(s=e!=null?Pt($t(e)):{},Oe(t||!e||!e.__esModule?L(s,"default",{value:e,enumerable:!0}):s,e)),pe=e=>Oe(L({},"__esModule",{value:!0}),e);var _,Te,i,q,m=E(()=>{"use strict";_=require("fs/promises"),Te=require("jsonc-parser"),i=async e=>{try{return await(0,_.access)(e),!0}catch{return!1}},q=async()=>{if(await i("pnpm-workspace.yaml"))return!0;try{let e=(0,Te.parse)(await(0,_.readFile)("package.json","utf-8"));return e?!!e.workspaces:!1}catch{return!1}}});var at={};de(at,{husky:()=>I});var rt,k,it,ne,I,ke=E(()=>{"use strict";rt=require("child_process"),k=require("fs/promises");m();it="npx ultracite format",ne="./.husky/pre-commit",I={exists:()=>i(ne),install:e=>{(0,rt.execSync)(`${e} -D husky`)},create:async()=>{await(0,k.mkdir)(".husky",{recursive:!0}),await(0,k.writeFile)(ne,it)},update:async()=>{let e=await(0,k.readFile)(ne,"utf-8");await(0,k.writeFile)(ne,`${e}
3
- ${it}`)}}});var lt={};de(lt,{lefthook:()=>U});var xe,x,oe,O,ct,U,De=E(()=>{"use strict";xe=require("child_process"),x=require("fs/promises");m();oe="npx ultracite format",O="./lefthook.yml",ct=`pre-commit:
2
+ "use strict";var Rt=Object.create;var B=Object.defineProperty;var Ft=Object.getOwnPropertyDescriptor;var Nt=Object.getOwnPropertyNames;var Mt=Object.getPrototypeOf,At=Object.prototype.hasOwnProperty;var Ie=e=>t=>{var s=e[t];if(s)return s();throw new Error("Module not found in bundle: "+t)};var z=(e,t)=>()=>(e&&(t=e(e=0)),t);var me=(e,t)=>{for(var s in t)B(e,s,{get:t[s],enumerable:!0})},Oe=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Nt(t))!At.call(e,o)&&o!==s&&B(e,o,{get:()=>t[o],enumerable:!(n=Ft(t,o))||n.enumerable});return e};var h=(e,t,s)=>(s=e!=null?Rt(Mt(e)):{},Oe(t||!e||!e.__esModule?B(s,"default",{value:e,enumerable:!0}):s,e)),fe=e=>Oe(B({},"__esModule",{value:!0}),e);var H,_e,Le,a,w,We,T,p=z(()=>{"use strict";H=require("fs/promises"),_e=require("jsonc-parser"),Le=require("nypm"),a=async e=>{try{return await(0,H.access)(e),!0}catch{return!1}},w=async()=>{if(await a("pnpm-workspace.yaml"))return!0;try{let e=(0,_e.parse)(await(0,H.readFile)("package.json","utf-8"));return e?!!e.workspaces||!!e.workspace:!1}catch{return!1}},We=`
3
+ 888 888 888 88888888888 8888888b. d8888 .d8888b. 8888888 88888888888 8888888888
4
+ 888 888 888 888 888 Y88b d88888 d88P Y88b 888 888 888
5
+ 888 888 888 888 888 888 d88P888 888 888 888 888 888
6
+ 888 888 888 888 888 d88P d88P 888 888 888 888 8888888
7
+ 888 888 888 888 8888888P" d88P 888 888 888 888 888
8
+ 888 888 888 888 888 T88b d88P 888 888 888 888 888 888
9
+ Y88b. .d88P 888 888 888 T88b d8888888888 Y88b d88P 888 888 888
10
+ "Y88888P" 88888888 888 888 T88b d88P 888 "Y8888P" 8888888 888 8888888888
11
+ `,T={packageManagers:Le.packageManagers.map(e=>e.name),editorConfigs:["vscode","zed"],editorRules:["vscode-copilot","cursor","windsurf","zed","claude","codex","kiro"],integrations:["husky","lefthook","lint-staged"]}});var ct={};me(ct,{husky:()=>O});var x,L,ie,O,De=z(()=>{"use strict";x=require("fs/promises"),L=require("nypm");p();ie="./.husky/pre-commit",O={exists:()=>a(ie),install:async e=>{await(0,L.addDevDependency)("husky",{packageManager:e,workspace:await w()})},create:async e=>{await(0,x.mkdir)(".husky",{recursive:!0});let t=(0,L.dlxCommand)(e,"ultracite",{args:["format"],short:e==="npm"});await(0,x.writeFile)(ie,t)},update:async e=>{let t=await(0,x.readFile)(ie,"utf-8"),s=(0,L.dlxCommand)(e,"ultracite",{args:["format"],short:e==="npm"});await(0,x.writeFile)(ie,`${t}
12
+ ${s}`)}}});var pt={};me(pt,{lefthook:()=>J});var ut,D,W,dt,U,lt,J,Ce=z(()=>{"use strict";ut=require("child_process"),D=require("fs/promises"),W=require("nypm");p();dt=e=>(0,W.dlxCommand)(e,"ultracite",{args:["format"],short:e==="npm"}),U="./lefthook.yml",lt=e=>`pre-commit:
4
13
  jobs:
5
- - run: ${oe}
14
+ - run: ${dt(e)}
6
15
  glob:
7
16
  - "*.js"
8
17
  - "*.jsx"
@@ -12,7 +21,7 @@ ${it}`)}}});var lt={};de(lt,{lefthook:()=>U});var xe,x,oe,O,ct,U,De=E(()=>{"use
12
21
  - "*.jsonc"
13
22
  - "*.css"
14
23
  stage_fixed: true
15
- `,U={exists:()=>i(O),install:e=>{(0,xe.execSync)(`${e} -D lefthook`),(0,xe.execSync)("npx lefthook install")},create:async()=>{await(0,x.writeFile)(O,ct)},update:async()=>{let e=await(0,x.readFile)(O,"utf-8");if(!e.includes(oe))if(e.includes("pre-commit:"))if(e.includes("jobs:")){let t=` - run: ${oe}
24
+ `,J={exists:()=>a(U),install:async e=>{await(0,W.addDevDependency)("lefthook",{packageManager:e,workspace:await w()});let t=(0,W.dlxCommand)(e,"lefthook",{args:["install"],short:e==="npm"});(0,ut.execSync)(t)},create:async e=>{let t=lt(e);await(0,D.writeFile)(U,t)},update:async e=>{let t=await(0,D.readFile)(U,"utf-8"),s=dt(e),n=lt(e);if(!t.includes(s))if(t.includes("pre-commit:"))if(t.includes("jobs:")){let o=` - run: ${s}
16
25
  glob:
17
26
  - "*.js"
18
27
  - "*.jsx"
@@ -21,9 +30,9 @@ ${it}`)}}});var lt={};de(lt,{lefthook:()=>U});var xe,x,oe,O,ct,U,De=E(()=>{"use
21
30
  - "*.json"
22
31
  - "*.jsonc"
23
32
  - "*.css"
24
- stage_fixed: true`,s=e.replace(/(pre-commit:\s*\n\s*jobs:\s*\n)/,`$1${t}
25
- `);await(0,x.writeFile)(O,s)}else{let t=` jobs:
26
- - run: ${oe}
33
+ stage_fixed: true`,i=t.replace(/(pre-commit:\s*\n\s*jobs:\s*\n)/,`$1${o}
34
+ `);await(0,D.writeFile)(U,i)}else{let o=` jobs:
35
+ - run: ${s}
27
36
  glob:
28
37
  - "*.js"
29
38
  - "*.jsx"
@@ -32,15 +41,15 @@ ${it}`)}}});var lt={};de(lt,{lefthook:()=>U});var xe,x,oe,O,ct,U,De=E(()=>{"use
32
41
  - "*.json"
33
42
  - "*.jsonc"
34
43
  - "*.css"
35
- stage_fixed: true`,s=e.replace(/(pre-commit:\s*\n)/,`$1${t}
36
- `);await(0,x.writeFile)(O,s)}else await(0,x.writeFile)(O,`${e}
37
- ${ct}`)}}});var Mt,je=E(()=>{Mt=Ie({"./husky.ts":()=>(ke(),pe(at)),"./lefthook.ts":()=>(De(),pe(lt)),"./lint-staged.ts":()=>(Ce(),pe(ut))})});var ut={};de(ut,{lintStaged:()=>M});var pt,f,mt,J,ie,y,dt,Et,Nt,zt,Tt,Wt,Lt,_t,qt,Bt,Se,Ht,M,Ce=E(()=>{"use strict";pt=require("child_process"),f=require("fs/promises"),mt=require("url"),J=h(require("deepmerge")),ie=require("jsonc-parser");m();je();y={"*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}":["npx ultracite format"]},dt=["./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"],Et=(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(),d=r.trim().replace(/['"]/g,"");return c&&c!==""?(c.startsWith("[")&&c.endsWith("]")?t[d]=c.slice(1,-1).split(",").map(W=>W.trim().replace(/['"]/g,"")):t[d]=c.replace(/['"]/g,""),{newCurrentKey:null,newCurrentArray:[]}):{newCurrentKey:d,newCurrentArray:[]}}if(o.startsWith("-")&&s){let r=[...n,o.slice(1).trim().replace(/['"]/g,"")];return{newCurrentKey:s,newCurrentArray:r}}return{newCurrentKey:s,newCurrentArray:n}},Nt=e=>{let t=e.split(`
38
- `).filter(r=>r.trim()&&!r.trim().startsWith("#")),s={},n=null,o=[];for(let r of t){let l=Et(r,s,n,o);n=l.newCurrentKey,o=l.newCurrentArray}return n&&o.length>0&&(s[n]=o),s},zt=e=>{let t="";for(let[s,n]of Object.entries(e))if(Array.isArray(n)){t+=`${s}:
44
+ stage_fixed: true`,i=t.replace(/(pre-commit:\s*\n)/,`$1${o}
45
+ `);await(0,D.writeFile)(U,i)}else await(0,D.writeFile)(U,`${t}
46
+ ${n}`)}}});var Jt,je=z(()=>{Jt=Ie({"./husky.ts":()=>(De(),fe(ct)),"./lefthook.ts":()=>(Ce(),fe(pt)),"./lint-staged.ts":()=>(Pe(),fe(mt))})});var mt={};me(mt,{lintStaged:()=>E});var f,gt,$,ae,re,b,ft,$t,Et,zt,Tt,_t,Lt,Wt,qt,Bt,Se,Ht,E,Pe=z(()=>{"use strict";f=require("fs/promises"),gt=require("url"),$=h(require("deepmerge")),ae=require("jsonc-parser"),re=require("nypm");p();je();b=e=>({"*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}":[(0,re.dlxCommand)(e,"ultracite",{args:["format"],short:e==="npm"})]}),ft=["./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"],$t=(e,t,s,n)=>{let o=e.trim();if(o.includes(":")&&!o.startsWith("-")){s&&n.length>0&&(t[s]=n);let[i,...r]=o.split(":"),l=r.join(":").trim(),u=i.trim().replace(/['"]/g,"");return l&&l!==""?(l.startsWith("[")&&l.endsWith("]")?t[u]=l.slice(1,-1).split(",").map(P=>P.trim().replace(/['"]/g,"")):t[u]=l.replace(/['"]/g,""),{newCurrentKey:null,newCurrentArray:[]}):{newCurrentKey:u,newCurrentArray:[]}}if(o.startsWith("-")&&s){let i=[...n,o.slice(1).trim().replace(/['"]/g,"")];return{newCurrentKey:s,newCurrentArray:i}}return{newCurrentKey:s,newCurrentArray:n}},Et=e=>{let t=e.split(`
47
+ `).filter(i=>i.trim()&&!i.trim().startsWith("#")),s={},n=null,o=[];for(let i of t){let r=$t(i,s,n,o);n=r.newCurrentKey,o=r.newCurrentArray}return n&&o.length>0&&(s[n]=o),s},zt=e=>{let t="";for(let[s,n]of Object.entries(e))if(Array.isArray(n)){t+=`${s}:
39
48
  `;for(let o of n)t+=` - '${o}'
40
49
  `}else t+=`${s}: '${n}'
41
- `;return t},Tt=async()=>{try{let e=(0,ie.parse)(await(0,f.readFile)("./package.json","utf-8"));return e?e.type==="module":!1}catch{return!1}},Wt=async()=>{let e=(0,ie.parse)(await(0,f.readFile)("./package.json","utf-8"));e&&(e["lint-staged"]?e["lint-staged"]=(0,J.default)(e["lint-staged"],y):e["lint-staged"]=y,await(0,f.writeFile)("./package.json",JSON.stringify(e,null,2)))},Lt=async e=>{let t=await(0,f.readFile)(e,"utf-8"),s=(0,ie.parse)(t);if(!s)return;let n=(0,J.default)(s,y);await(0,f.writeFile)(e,JSON.stringify(n,null,2))},_t=async e=>{let t=await(0,f.readFile)(e,"utf-8"),s=Nt(t);if(!s)return;let n=(0,J.default)(s,y);await(0,f.writeFile)(e,zt(n))},qt=async e=>{let n=(await import((0,mt.pathToFileURL)(e).href)).default||{},o=(0,J.default)(n,y),r=`export default ${JSON.stringify(o,null,2)};
42
- `;await(0,f.writeFile)(e,r)},Bt=async e=>{delete require.cache[require.resolve(`./${e}`)];let t=Mt(`./${e}`),s=(0,J.default)(t,y),n=`module.exports = ${JSON.stringify(s,null,2)};
43
- `;await(0,f.writeFile)(e,n)},Se=async()=>{await(0,f.writeFile)(".lintstagedrc.json",JSON.stringify(y,null,2))},Ht=async e=>{if(e==="./package.json"){await Wt();return}if(e.endsWith(".json")||e==="./.lintstagedrc"){await Lt(e);return}if(e.endsWith(".yaml")||e.endsWith(".yml")){await _t(e);return}let t=await Tt();if(e.endsWith(".mjs")||e.endsWith(".js")&&t){try{await qt(e)}catch{await Se()}return}if(e.endsWith(".cjs")||e.endsWith(".js")&&!t)try{await Bt(e)}catch{await Se()}},M={exists:async()=>{for(let e of dt)if(await i(e))return!0;return!1},install:e=>{(0,pt.execSync)(`${e} -D lint-staged`)},create:async()=>{await(0,f.writeFile)(".lintstagedrc.json",JSON.stringify(y,null,2))},update:async()=>{let e=null;for(let t of dt)if(await i(t)){e=t;break}if(!e){await Se();return}await Ht(e)}}});var ue=require("trpc-cli"),p=h(require("zod"));var w={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"5.1.8",bin:{ultracite:"dist/index.js"},files:["biome.jsonc","dist"],scripts:{build:"tsup",test:"vitest run","test:coverage":"vitest --coverage"},main:"./biome.jsonc",author:"Hayden Bleasel <hello@haydenbleasel.com>",bugs:{url:"https://github.com/haydenbleasel/ultracite/issues"},homepage:"https://github.com/haydenbleasel/ultracite#readme",keywords:["ultracite","biome","linter","formatter","fixer"],license:"MIT",publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},repository:{type:"git",url:"git+https://github.com/haydenbleasel/ultracite.git"},devDependencies:{"@auto-it/all-contributors":"^11.3.0","@auto-it/first-time-contributor":"^11.3.0","@biomejs/biome":"2.2.0","@types/node":"^24.0.14","@vitest/coverage-v8":"3.2.4",tsup:"^8.5.0"},dependencies:{"@clack/prompts":"^0.11.0",deepmerge:"^4.3.1","jsonc-parser":"^3.3.1","trpc-cli":"^0.10.0",vitest:"^3.2.4",zod:"^4.0.5"},packageManager:"pnpm@10.13.1"};var Ue=require("child_process"),Je=h(require("process")),Me=(e,t={})=>{try{let s=e.length>0?e.map(o=>`"${o}"`).join(" "):"./",n=t.unsafe?" --unsafe":"";(0,Ue.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),Je.default.exit(1)}};var Ee=require("child_process"),Ne=h(require("process")),ze=e=>{try{let t=e.length>0?e.map(s=>`"${s}"`).join(" "):"./";(0,Ee.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),Ne.default.exit(1)}};var Ct=require("child_process"),g=require("fs/promises"),St=h(require("process")),a=require("@clack/prompts");var N=require("fs/promises"),Le=h(require("deepmerge")),_e=require("jsonc-parser");m();var Ut=w.devDependencies["@biomejs/biome"],We={$schema:`https://biomejs.dev/schemas/${Ut}/schema.json`,extends:["ultracite"]},me=async()=>await i("./biome.json")?"./biome.json":"./biome.jsonc",B={exists:async()=>{let e=await me();return i(e)},create:async()=>{let e=await me();return(0,N.writeFile)(e,JSON.stringify(We,null,2))},update:async()=>{let e=await me(),t=await(0,N.readFile)(e,"utf-8"),n=(0,_e.parse)(t)||{},o=n.extends&&Array.isArray(n.extends)?n.extends:[];o.includes("ultracite")||(n.extends=[...o,"ultracite"]);let r={$schema:We.$schema},l=(0,Le.default)(n,r);await(0,N.writeFile)(e,JSON.stringify(l,null,2))}};var b=require("fs/promises"),Be=h(require("deepmerge")),He=require("jsonc-parser");m();var qe={"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"}},H="./.vscode/settings.json",K={exists:()=>i(H),create:async()=>{await(0,b.mkdir)(".vscode",{recursive:!0}),await(0,b.writeFile)(H,JSON.stringify(qe,null,2))},update:async()=>{let e=await(0,b.readFile)(H,"utf-8"),s=(0,He.parse)(e)||{},n=(0,Be.default)(s,qe);await(0,b.writeFile)(H,JSON.stringify(n,null,2))}};var v=require("fs/promises"),Ve=h(require("deepmerge")),Ge=require("jsonc-parser");m();var Ke={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",G={exists:()=>i(V),create:async()=>{await(0,v.mkdir)(".zed",{recursive:!0}),await(0,v.writeFile)(V,JSON.stringify(Ke,null,2))},update:async()=>{let e=await(0,v.readFile)(V,"utf-8"),s=(0,Ge.parse)(e)||{},n=(0,Ve.default)(s,Ke);await(0,v.writeFile)(V,JSON.stringify(n,null,2))}};var C=require("fs/promises");var Ye=["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."],Ze=["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."],Xe=["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.'],Qe=["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"`.'],et=["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."],tt=["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.'],st=["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."],nt=["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."],Ms=[...Ye,...Ze,...Xe,...Qe,...et,...tt,...st,...nt],u=`# Project Context
50
+ `;return t},Tt=async()=>{try{let e=(0,ae.parse)(await(0,f.readFile)("./package.json","utf-8"));return e?e.type==="module":!1}catch{return!1}},_t=async e=>{let t=(0,ae.parse)(await(0,f.readFile)("./package.json","utf-8"));t&&(t["lint-staged"]?t["lint-staged"]=(0,$.default)(t["lint-staged"],b(e)):t["lint-staged"]=b(e),await(0,f.writeFile)("./package.json",JSON.stringify(t,null,2)))},Lt=async(e,t)=>{let s=await(0,f.readFile)(e,"utf-8"),n=(0,ae.parse)(s);if(!n)return;let o=(0,$.default)(n,b(t));await(0,f.writeFile)(e,JSON.stringify(o,null,2))},Wt=async(e,t)=>{let s=await(0,f.readFile)(e,"utf-8"),n=Et(s);if(!n)return;let o=(0,$.default)(n,b(t));await(0,f.writeFile)(e,zt(o))},qt=async(e,t)=>{let o=(await import((0,gt.pathToFileURL)(e).href)).default||{},i=(0,$.default)(o,b(t)),r=`export default ${JSON.stringify(i,null,2)};
51
+ `;await(0,f.writeFile)(e,r)},Bt=async(e,t)=>{delete require.cache[require.resolve(`./${e}`)];let s=Jt(`./${e}`),n=(0,$.default)(s,b(t)),o=`module.exports = ${JSON.stringify(n,null,2)};
52
+ `;await(0,f.writeFile)(e,o)},Se=async e=>{await(0,f.writeFile)(".lintstagedrc.json",JSON.stringify(b(e),null,2))},Ht=async(e,t)=>{if(e==="./package.json"){await _t(t);return}if(e.endsWith(".json")||e==="./.lintstagedrc"){await Lt(e,t);return}if(e.endsWith(".yaml")||e.endsWith(".yml")){await Wt(e,t);return}let s=await Tt();if(e.endsWith(".mjs")||e.endsWith(".js")&&s){try{await qt(e,t)}catch{await Se(t)}return}if(e.endsWith(".cjs")||e.endsWith(".js")&&!s)try{await Bt(e,t)}catch{await Se(t)}},E={exists:async()=>{for(let e of ft)if(await a(e))return!0;return!1},install:async e=>{await(0,re.addDevDependency)("lint-staged",{packageManager:e,workspace:await w()})},create:async e=>{await(0,f.writeFile)(".lintstagedrc.json",JSON.stringify(b(e),null,2))},update:async e=>{let t=null;for(let s of ft)if(await a(s)){t=s;break}if(!t){await Se(e);return}await Ht(t,e)}}});var pe=require("trpc-cli"),m=h(require("zod"));var y={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"5.1.9",bin:{ultracite:"dist/index.js"},files:["biome.jsonc","dist"],scripts:{build:"tsup",test:"vitest run","test:coverage":"vitest --coverage"},main:"./biome.jsonc",author:"Hayden Bleasel <hello@haydenbleasel.com>",bugs:{url:"https://github.com/haydenbleasel/ultracite/issues"},homepage:"https://github.com/haydenbleasel/ultracite#readme",keywords:["ultracite","biome","linter","formatter","fixer"],license:"MIT",publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},repository:{type:"git",url:"git+https://github.com/haydenbleasel/ultracite.git"},devDependencies:{"@auto-it/all-contributors":"^11.3.0","@auto-it/first-time-contributor":"^11.3.0","@biomejs/biome":"2.2.0","@types/node":"^24.0.14","@vitest/coverage-v8":"3.2.4",tsup:"^8.5.0"},dependencies:{"@clack/prompts":"^0.11.0",deepmerge:"^4.3.1","jsonc-parser":"^3.3.1",nypm:"^0.6.1","trpc-cli":"^0.10.0",vitest:"^3.2.4",zod:"^4.0.5"},packageManager:"pnpm@10.13.1"};var Ue=require("child_process"),Je=h(require("process")),$e=(e,t={})=>{try{let s=e.length>0?e.map(o=>`"${o}"`).join(" "):"./",n=t.unsafe?" --unsafe":"";(0,Ue.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),Je.default.exit(1)}};var Ee=require("child_process"),ze=h(require("process")),Te=e=>{try{let t=e.length>0?e.map(s=>`"${s}"`).join(" "):"./";(0,Ee.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),ze.default.exit(1)}};var g=require("fs/promises"),Ae=h(require("process")),c=require("@clack/prompts"),ue=require("nypm");var _=require("fs/promises"),Be=h(require("deepmerge")),He=require("jsonc-parser");p();var Ot=y.devDependencies["@biomejs/biome"],qe={$schema:`https://biomejs.dev/schemas/${Ot}/schema.json`,extends:["ultracite"]},ge=async()=>await a("./biome.json")?"./biome.json":"./biome.jsonc",K={exists:async()=>{let e=await ge();return a(e)},create:async()=>{let e=await ge();return(0,_.writeFile)(e,JSON.stringify(qe,null,2))},update:async()=>{let e=await ge(),t=await(0,_.readFile)(e,"utf-8"),n=(0,He.parse)(t)||{},o=n.extends&&Array.isArray(n.extends)?n.extends:[];o.includes("ultracite")||(n.extends=[...o,"ultracite"]);let i={$schema:qe.$schema},r=(0,Be.default)(n,i);await(0,_.writeFile)(e,JSON.stringify(r,null,2))}};var k=require("fs/promises"),Ve=h(require("deepmerge")),Ge=require("jsonc-parser");p();var Ke={"editor.defaultFormatter":"esbenp.prettier-vscode","[javascript]":{"editor.defaultFormatter":"biomejs.biome"},"[typescript]":{"editor.defaultFormatter":"biomejs.biome"},"[javascriptreact]":{"editor.defaultFormatter":"biomejs.biome"},"[typescriptreact]":{"editor.defaultFormatter":"biomejs.biome"},"[json]":{"editor.defaultFormatter":"biomejs.biome"},"[jsonc]":{"editor.defaultFormatter":"biomejs.biome"},"[css]":{"editor.defaultFormatter":"biomejs.biome"},"[graphql]":{"editor.defaultFormatter":"biomejs.biome"},"typescript.tsdk":"node_modules/typescript/lib","editor.formatOnSave":!0,"editor.formatOnPaste":!0,"emmet.showExpandedAbbreviation":"never","editor.codeActionsOnSave":{"source.fixAll.biome":"explicit","source.organizeImports.biome":"explicit"}},V="./.vscode/settings.json",G={exists:()=>a(V),create:async()=>{await(0,k.mkdir)(".vscode",{recursive:!0}),await(0,k.writeFile)(V,JSON.stringify(Ke,null,2))},update:async()=>{let e=await(0,k.readFile)(V,"utf-8"),s=(0,Ge.parse)(e)||{},n=(0,Ve.default)(s,Ke);await(0,k.writeFile)(V,JSON.stringify(n,null,2))}};var v=require("fs/promises"),Ze=h(require("deepmerge")),Xe=require("jsonc-parser");p();var Ye={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"}}}}}},Y="./.zed/settings.json",Z={exists:()=>a(Y),create:async()=>{await(0,v.mkdir)(".zed",{recursive:!0}),await(0,v.writeFile)(Y,JSON.stringify(Ye,null,2))},update:async()=>{let e=await(0,v.readFile)(Y,"utf-8"),s=(0,Xe.parse)(e)||{},n=(0,Ze.default)(s,Ye);await(0,v.writeFile)(Y,JSON.stringify(n,null,2))}};var S=require("fs/promises");var 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."],et=["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."],tt=["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.'],st=["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"`.'],nt=["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."],ot=["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.'],it=["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."],at=["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."],As=[...Qe,...et,...tt,...st,...nt,...ot,...it,...at],d=`# Project Context
44
53
  Ultracite enforces strict type safety, accessibility standards, and consistent code quality for JavaScript/TypeScript projects using Biome's lightning-fast formatter and linter.
45
54
 
46
55
  ## Key Principles
@@ -58,35 +67,35 @@ Ultracite enforces strict type safety, accessibility standards, and consistent c
58
67
  ## Rules
59
68
 
60
69
  ### Accessibility (a11y)
61
- ${Ye.map(e=>`- ${e}`).join(`
70
+ ${Qe.map(e=>`- ${e}`).join(`
62
71
  `)}
63
72
 
64
73
  ### Code Complexity and Quality
65
- ${Ze.map(e=>`- ${e}`).join(`
74
+ ${et.map(e=>`- ${e}`).join(`
66
75
  `)}
67
76
 
68
77
  ### React and JSX Best Practices
69
- ${Xe.map(e=>`- ${e}`).join(`
78
+ ${tt.map(e=>`- ${e}`).join(`
70
79
  `)}
71
80
 
72
81
  ### Correctness and Safety
73
- ${Qe.map(e=>`- ${e}`).join(`
82
+ ${st.map(e=>`- ${e}`).join(`
74
83
  `)}
75
84
 
76
85
  ### TypeScript Best Practices
77
- ${et.map(e=>`- ${e}`).join(`
86
+ ${nt.map(e=>`- ${e}`).join(`
78
87
  `)}
79
88
 
80
89
  ### Style and Consistency
81
- ${tt.map(e=>`- ${e}`).join(`
90
+ ${ot.map(e=>`- ${e}`).join(`
82
91
  `)}
83
92
 
84
93
  ### Next.js Specific Rules
85
- ${st.map(e=>`- ${e}`).join(`
94
+ ${it.map(e=>`- ${e}`).join(`
86
95
  `)}
87
96
 
88
97
  ### Testing Best Practices
89
- ${nt.map(e=>`- ${e}`).join(`
98
+ ${at.map(e=>`- ${e}`).join(`
90
99
  `)}
91
100
 
92
101
  ## Common Tasks
@@ -111,25 +120,16 @@ try {
111
120
  } catch (e) {
112
121
  console.log(e);
113
122
  }
114
- \`\`\``;m();var fe="./.claude/CLAUDE.md",Y={exists:()=>i(fe),create:async()=>{await(0,C.mkdir)(".claude",{recursive:!0}),await(0,C.writeFile)(fe,u)},update:async()=>{await(0,C.mkdir)(".claude",{recursive:!0}),await(0,C.writeFile)(fe,u)}};var he=require("fs/promises");m();var ge="./AGENTS.md",Z={exists:()=>i(ge),create:async()=>{await(0,he.writeFile)(ge,u)},update:async()=>{await(0,he.writeFile)(ge,u)}};var S=require("fs/promises");m();var ye="./.cursor/rules/ultracite.mdc",Jt=`---
123
+ \`\`\``;p();var he="./.claude/CLAUDE.md",X={exists:()=>a(he),create:async()=>{await(0,S.mkdir)(".claude",{recursive:!0}),await(0,S.writeFile)(he,d)},update:async()=>{await(0,S.mkdir)(".claude",{recursive:!0}),await(0,S.writeFile)(he,d)}};var we=require("fs/promises");p();var ye="./AGENTS.md",Q={exists:()=>a(ye),create:async()=>{await(0,we.writeFile)(ye,d)},update:async()=>{await(0,we.writeFile)(ye,d)}};var R=require("fs/promises");p();var be="./.cursor/rules/ultracite.mdc",Ut=`---
115
124
  description: Ultracite Rules - AI-Ready Formatter and Linter
116
125
  globs: "**/*.{ts,tsx,js,jsx}"
117
126
  alwaysApply: true
118
127
  ---
119
128
 
120
- ${u}`,X={exists:()=>i(ye),create:async()=>{await(0,S.mkdir)(".cursor/rules",{recursive:!0}),await(0,S.writeFile)(ye,Jt)},update:async()=>{await(0,S.mkdir)(".cursor/rules",{recursive:!0}),await(0,S.writeFile)(ye,u)}};var R=require("fs/promises");m();var we="./.kiro/steering/linting-and-formatting.md",Q={exists:()=>i(we),create:async()=>{await(0,R.mkdir)(".kiro/steering",{recursive:!0}),await(0,R.writeFile)(we,u)},update:async()=>{await(0,R.mkdir)(".kiro/steering",{recursive:!0}),await(0,R.writeFile)(we,u)}};var P=require("fs/promises");m();var be="./.github/copilot-instructions.md",ot=`---
129
+ ${d}`,ee={exists:()=>a(be),create:async()=>{await(0,R.mkdir)(".cursor/rules",{recursive:!0}),await(0,R.writeFile)(be,Ut)},update:async()=>{await(0,R.mkdir)(".cursor/rules",{recursive:!0}),await(0,R.writeFile)(be,d)}};var F=require("fs/promises");p();var ke="./.kiro/steering/linting-and-formatting.md",te={exists:()=>a(ke),create:async()=>{await(0,F.mkdir)(".kiro/steering",{recursive:!0}),await(0,F.writeFile)(ke,d)},update:async()=>{await(0,F.mkdir)(".kiro/steering",{recursive:!0}),await(0,F.writeFile)(ke,d)}};var N=require("fs/promises");p();var ve="./.github/copilot-instructions.md",rt=`---
121
130
  applyTo: "**/*.{ts,tsx,js,jsx}"
122
131
  ---
123
132
 
124
- ${u}`,ee={exists:()=>i(be),create:async()=>{await(0,P.mkdir)(".github",{recursive:!0}),await(0,P.writeFile)(be,ot)},update:async()=>{await(0,P.mkdir)(".github",{recursive:!0}),await(0,P.writeFile)(be,ot)}};var F=require("fs/promises");m();var ve="./.windsurf/rules/ultracite.md",te={exists:()=>i(ve),create:async()=>{await(0,F.mkdir)(".windsurf/rules",{recursive:!0}),await(0,F.writeFile)(ve,u)},update:async()=>{await(0,F.mkdir)(".windsurf/rules",{recursive:!0}),await(0,F.writeFile)(ve,u)}};var $=require("fs/promises");m();var A="./.rules",se={exists:()=>i(A),create:async()=>{await(0,$.writeFile)(A,u)},update:async()=>{if(!await i(A)){await(0,$.writeFile)(A,u);return}let e=await(0,$.readFile)(A,"utf-8");e.includes(u.trim())||await(0,$.writeFile)(A,`${e}
133
+ ${d}`,se={exists:()=>a(ve),create:async()=>{await(0,N.mkdir)(".github",{recursive:!0}),await(0,N.writeFile)(ve,rt)},update:async()=>{await(0,N.mkdir)(".github",{recursive:!0}),await(0,N.writeFile)(ve,rt)}};var M=require("fs/promises");p();var xe="./.windsurf/rules/ultracite.md",ne={exists:()=>a(xe),create:async()=>{await(0,M.mkdir)(".windsurf/rules",{recursive:!0}),await(0,M.writeFile)(xe,d)},update:async()=>{await(0,M.mkdir)(".windsurf/rules",{recursive:!0}),await(0,M.writeFile)(xe,d)}};var I=require("fs/promises");p();var A="./.rules",oe={exists:()=>a(A),create:async()=>{await(0,I.writeFile)(A,d)},update:async()=>{if(!await a(A)){await(0,I.writeFile)(A,d);return}let e=await(0,I.readFile)(A,"utf-8");e.includes(d.trim())||await(0,I.writeFile)(A,`${e}
125
134
 
126
- ${u}`)}};ke();De();Ce();var ft=require("child_process"),D=require("fs/promises"),Re=require("jsonc-parser");m();var gt=[".eslintrc",".eslintrc.js",".eslintrc.json",".eslintrc.yml",".eslintrc.yaml",".eslintrc.config.js","eslint.config.js","eslint.config.mjs","eslint.config.cjs",".eslintignore"],ht=async()=>{try{let e=await(0,D.readFile)("package.json","utf-8"),t=(0,Re.parse)(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(r=>r.startsWith("eslint")||r.startsWith("@eslint/")||r==="@typescript-eslint/parser"||r==="@typescript-eslint/eslint-plugin")}catch{return[]}},Kt=(e,t)=>{if(t.length===0)return;let s=t.join(" ");try{(0,ft.execSync)(`${e} ${s}`,{stdio:"pipe"})}catch{}},Vt=async()=>{let e=[];for(let t of gt)if(await i(t))try{await(0,D.unlink)(t),e.push(t)}catch{}return e},Gt=async()=>{let e="./.vscode/settings.json";if(!await i(e))return!1;try{let t=await(0,D.readFile)(e,"utf-8"),s=(0,Re.parse)(t);if(!s||typeof s!="object")return!1;let n=!1,o={...s},r=["eslint.enable","eslint.format.enable","eslint.validate","eslint.workingDirectories","eslint.codeAction.showDocumentation","eslint.run","eslint.autoFixOnSave","eslint.quiet","eslint.packageManager","eslint.options","eslint.trace.server"];for(let l of r)l in o&&(delete o[l],n=!0);if("editor.codeActionsOnSave"in o){let l=o["editor.codeActionsOnSave"];if(l&&typeof l=="object"){let c=["source.fixAll.eslint","source.organizeImports.eslint"];for(let d of c)d in l&&(delete l[d],n=!0);Object.keys(l).length===0&&delete o["editor.codeActionsOnSave"]}}return n?(await(0,D.writeFile)(e,JSON.stringify(o,null,2)),!0):!1}catch{return!1}},Yt=async()=>{if((await ht()).length>0)return!0;for(let t of gt)if(await i(t))return!0;return!1},Zt=e=>e.startsWith("npm")?"npm uninstall":e.startsWith("yarn")?"yarn remove":e.startsWith("pnpm")?"pnpm remove":e.startsWith("bun")?"bun remove":"npm uninstall",Pe={hasESLint:Yt,remove:async e=>{let t=await ht(),s=Zt(e);Kt(s,t);let n=await Vt(),o=await Gt();return{packagesRemoved:t,filesRemoved:n,vsCodeCleaned:o}}};var yt=require("child_process"),j=require("fs/promises"),Fe=require("jsonc-parser");m();var wt=[".prettierrc",".prettierrc.js",".prettierrc.json",".prettierrc.yml",".prettierrc.yaml",".prettierrc.config.js","prettier.config.js","prettier.config.mjs",".prettierignore"],bt=async()=>{try{let e=await(0,j.readFile)("package.json","utf-8"),t=(0,Fe.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[]}},Xt=(e,t)=>{if(t.length===0)return;let s=t.join(" ");try{(0,yt.execSync)(`${e} ${s}`,{stdio:"pipe"})}catch{}},Qt=async()=>{let e=[];for(let t of wt)if(await i(t))try{await(0,j.unlink)(t),e.push(t)}catch{}return e},es=async()=>{let e="./.vscode/settings.json";if(!await i(e))return!1;try{let t=await(0,j.readFile)(e,"utf-8"),s=(0,Fe.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 d=o[c];d&&typeof d=="object"&&"editor.defaultFormatter"in d&&d["editor.defaultFormatter"]==="esbenp.prettier-vscode"&&(delete d["editor.defaultFormatter"],n=!0,Object.keys(d).length===0&&delete o[c])}return n?(await(0,j.writeFile)(e,JSON.stringify(o,null,2)),!0):!1}catch{return!1}},ts=async()=>{if((await bt()).length>0)return!0;for(let t of wt)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",Ae={hasPrettier:ts,remove:async e=>{let t=await bt(),s=ss(e);Xt(s,t);let n=await Qt(),o=await es();return{packagesRemoved:t,filesRemoved:n,vsCodeCleaned:o}}};var re=require("@clack/prompts");m();var $e=[{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 ."}],z={get:async()=>{let e=await q();e&&re.log.info("Monorepo detected, updating install command to include workspace flag");for(let t of $e){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 q(),t=await(0,re.select)({initialValue:"pnpm",message:"Which package manager do you use?",options:$e.map(s=>({label:s.label,value:e&&s.monorepoSuffix?`${s.value} ${s.monorepoSuffix}`:s.value}))});return typeof t!="string"?null:t},isMonorepo:q,options:$e};var vt=`
127
- 888 888 888 88888888888 8888888b. d8888 .d8888b. 8888888 88888888888 8888888888
128
- 888 888 888 888 888 Y88b d88888 d88P Y88b 888 888 888
129
- 888 888 888 888 888 888 d88P888 888 888 888 888 888
130
- 888 888 888 888 888 d88P d88P 888 888 888 888 8888888
131
- 888 888 888 888 8888888P" d88P 888 888 888 888 888
132
- 888 888 888 888 888 T88b d88P 888 888 888 888 888 888
133
- Y88b. .d88P 888 888 888 T88b d8888888888 Y88b d88P 888 888 888
134
- "Y88888P" 88888888 888 888 T88b d88P 888 "Y8888P" 8888888 888 8888888888
135
- `;var T=require("fs/promises"),xt=h(require("deepmerge")),Dt=require("jsonc-parser");m();var kt={compilerOptions:{strictNullChecks:!0}},ae="./tsconfig.json",ce={exists:()=>i(ae),create:()=>(0,T.writeFile)(ae,JSON.stringify(kt,null,2)),update:async()=>{let e=await(0,T.readFile)(ae,"utf-8"),s=(0,Dt.parse)(e)||{},n=(0,xt.default)(s,kt);await(0,T.writeFile)(ae,JSON.stringify(n,null,2))}};var jt=w.devDependencies["@biomejs/biome"],ns=w.version,os=async(e,t=!0)=>{let s=(0,a.spinner)();if(s.start("Installing dependencies..."),t)(0,Ct.execSync)(`${e} -D -E ultracite @biomejs/biome@${jt}`);else{let n=await(0,g.readFile)("package.json","utf8"),o=JSON.parse(n),r={...o,devDependencies:{...o.devDependencies,"@biomejs/biome":jt,ultracite:`^${ns}`}};await(0,g.writeFile)("package.json",JSON.stringify(r,null,2))}s.stop("Dependencies installed.")},is=async()=>{let e=(0,a.spinner)();if(e.start("Checking for tsconfig.json..."),await ce.exists()){e.message("tsconfig.json found, updating..."),await ce.update(),e.stop("tsconfig.json updated.");return}e.message("tsconfig.json not found, creating..."),await ce.create(),e.stop("tsconfig.json created.")},rs=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.")},as=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.")},cs=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Biome configuration..."),await B.exists()){e.message("Biome configuration found, updating..."),await B.update(),e.stop("Biome configuration updated.");return}e.message("Biome configuration not found, creating..."),await B.create(),e.stop("Biome configuration created.")},ls=async(e,t=!0)=>{let s=(0,a.spinner)();if(s.start("Initializing pre-commit hooks..."),s.message("Installing Husky..."),t)I.install(e);else{let n=await(0,g.readFile)("package.json","utf8"),o=JSON.parse(n),r={...o,devDependencies:{...o.devDependencies,husky:"latest"}};await(0,g.writeFile)("package.json",JSON.stringify(r,null,2))}if(await I.exists()){s.message("Pre-commit hook found, updating..."),await I.update(),s.stop("Pre-commit hook updated.");return}s.message("Pre-commit hook not found, creating..."),await I.create(),s.stop("Pre-commit hook created.")},us=async(e,t=!0)=>{let s=(0,a.spinner)();if(s.start("Initializing lefthook..."),s.message("Installing lefthook..."),t)U.install(e);else{let n=await(0,g.readFile)("package.json","utf8"),o=JSON.parse(n),r={...o,devDependencies:{...o.devDependencies,lefthook:"latest"}};await(0,g.writeFile)("package.json",JSON.stringify(r,null,2))}if(await U.exists()){s.message("lefthook.yml found, updating..."),await U.update(),s.stop("lefthook.yml updated.");return}s.message("lefthook.yml not found, creating..."),await U.create(),s.stop("lefthook.yml created.")},ds=async(e,t=!0)=>{let s=(0,a.spinner)();if(s.start("Initializing lint-staged..."),s.message("Installing lint-staged..."),t)M.install(e);else{let n=await(0,g.readFile)("package.json","utf8"),o=JSON.parse(n),r={...o,devDependencies:{...o.devDependencies,"lint-staged":"latest"}};await(0,g.writeFile)("package.json",JSON.stringify(r,null,2))}if(await M.exists()){s.message("lint-staged found, updating..."),await M.update(),s.stop("lint-staged updated.");return}s.message("lint-staged not found, creating..."),await M.create(),s.stop("lint-staged created.")},ps=async()=>{let e=(0,a.spinner)();if(e.start("Checking for GitHub Copilot rules..."),await ee.exists()){e.message("GitHub Copilot rules found, updating..."),await ee.update(),e.stop("GitHub Copilot rules updated.");return}e.message("GitHub Copilot rules not found, creating..."),await ee.create(),e.stop("GitHub Copilot rules created.")},ms=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Cursor rules..."),await X.exists()){e.message("Cursor rules found, updating..."),await X.update(),e.stop("Cursor rules updated.");return}e.message("Cursor rules not found, creating..."),await X.create(),e.stop("Cursor rules created.")},fs=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Windsurf rules..."),await te.exists()){e.message("Windsurf rules found, updating..."),await te.update(),e.stop("Windsurf rules updated.");return}e.message("Windsurf rules not found, creating..."),await te.create(),e.stop("Windsurf rules created.")},gs=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Zed rules..."),await se.exists()){e.message("Zed rules found, updating..."),await se.update(),e.stop("Zed rules updated.");return}e.message("Zed rules not found, creating..."),await se.create(),e.stop("Zed rules created.")},hs=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Claude Code rules..."),await Y.exists()){e.message("Claude Code rules found, updating..."),await Y.update(),e.stop("Claude Code rules updated.");return}e.message("Claude Code rules not found, creating..."),await Y.create(),e.stop("Claude Code rules created.")},ys=async()=>{let e=(0,a.spinner)();if(e.start("Checking for OpenAI Codex rules..."),await Z.exists()){e.message("OpenAI Codex rules found, updating..."),await Z.update(),e.stop("OpenAI Codex rules updated.");return}e.message("OpenAI Codex rules not found, creating..."),await Z.create(),e.stop("OpenAI Codex rules created.")},ws=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Kiro IDE steering files..."),await Q.exists()){e.message("Kiro IDE steering files found, updating..."),await Q.update(),e.stop("Kiro IDE steering files updated.");return}e.message("Kiro IDE steering files not found, creating..."),await Q.create(),e.stop("Kiro IDE steering files created.")},bs=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...")}},vs=async e=>{let t=(0,a.spinner)();t.start("Removing ESLint dependencies and configuration...");try{let s=await Pe.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...")}},ks=async e=>{if(e){let n=z.options.find(r=>r.label===e);if(!n)throw new Error(`Unsupported package manager: ${e}`);return await z.isMonorepo()&&n.monorepoSuffix?`${n.value} ${n.monorepoSuffix}`:n.value}let t=await z.get();if(t)return a.log.info(`Detected lockfile, using ${t}`),t;let s=await z.select();if(!s)throw new Error("No package manager selected");return s},Rt=async e=>{(0,a.intro)(vt);try{let t=e??{},s=await ks(t.pm),n=t.removePrettier,o=t.removeEslint;if(n===void 0||o===void 0){let d=[];if(n===void 0&&await Ae.hasPrettier()&&d.push({label:"Remove Prettier (dependencies, config files, VS Code settings)",value:"prettier"}),o===void 0&&await Pe.hasESLint()&&d.push({label:"Remove ESLint (dependencies, config files, VS Code settings)",value:"eslint"}),d.length>0){let W=await(0,a.multiselect)({message:"Remove existing formatters/linters (recommended for clean migration)?",options:d,required:!1});n===void 0&&(n=W.includes("prettier")),o===void 0&&(o=W.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"},{label:"Kiro IDE",value:"kiro"}],required:!1}));let c=t.features;c===void 0&&(t.pm||t.editors||t.rules||t.removePrettier!==void 0||t.removeEslint!==void 0?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 bs(s),o&&await vs(s),await os(s,!t.skipInstall),await is(),await cs(),r?.includes("vscode")&&await rs(),r?.includes("zed")&&await as(),l?.includes("vscode-copilot")&&await ps(),l?.includes("cursor")&&await ms(),l?.includes("windsurf")&&await fs(),l?.includes("zed")&&await gs(),l?.includes("claude")&&await hs(),l?.includes("codex")&&await ys(),l?.includes("kiro")&&await ws(),c?.includes("husky")&&await ls(s,!t.skipInstall),c?.includes("lefthook")&&await us(s,!t.skipInstall),c?.includes("lint-staged")&&await ds(s,!t.skipInstall),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}`),St.default.exit(1)}};var le=ue.trpcServer.initTRPC.meta().create(),xs=le.router({init:le.procedure.meta({description:"Initialize Ultracite in the current directory"}).input(p.default.object({pm:p.default.enum(["pnpm","bun","yarn","npm"]).optional().describe("Package manager to use"),editors:p.default.array(p.default.enum(["vscode","zed"])).optional().describe("Editors to configure"),rules:p.default.array(p.default.enum(["vscode-copilot","cursor","windsurf","zed","claude","codex","kiro"])).optional().describe("Editor rules to enable"),features:p.default.array(p.default.enum(["husky","lefthook","lint-staged"])).optional().describe("Additional features to enable"),removePrettier:p.default.boolean().optional().describe("Remove Prettier dependencies and configuration"),removeEslint:p.default.boolean().optional().describe("Remove ESLint dependencies and configuration"),skipInstall:p.default.boolean().default(!1).describe("Skip installing dependencies")})).mutation(async({input:e})=>{await Rt(e)}),lint:le.procedure.meta({description:"Run Biome linter without fixing files"}).input(p.default.array(p.default.string()).optional().default([]).describe("specific files to lint")).query(({input:e})=>{ze(e)}),format:le.procedure.meta({description:"Run Biome linter and fixes files"}).input(p.default.tuple([p.default.array(p.default.string()).optional().default([]).describe("specific files to format"),p.default.object({unsafe:p.default.boolean().optional().describe("apply unsafe fixes")})])).mutation(({input:e})=>{let[t,s]=e;Me(t,{unsafe:s.unsafe})})}),Ds=(0,ue.createCli)({router:xs,name:"ultracite",version:w.version,description:"Ship code faster and with more confidence."});process.env.VITEST||Ds.run();
135
+ ${d}`)}};De();Ce();Pe();var C=require("fs/promises"),Re=require("jsonc-parser"),ht=require("nypm");p();var yt=[".eslintrc",".eslintrc.js",".eslintrc.json",".eslintrc.yml",".eslintrc.yaml",".eslintrc.config.js","eslint.config.js","eslint.config.mjs","eslint.config.cjs",".eslintignore"],wt=async()=>{try{let e=await(0,C.readFile)("package.json","utf-8"),t=(0,Re.parse)(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(i=>i.startsWith("eslint")||i.startsWith("@eslint/")||i==="@typescript-eslint/parser"||i==="@typescript-eslint/eslint-plugin")}catch{return[]}},Kt=async(e,t)=>{if(t.length!==0)try{for(let s of t)await(0,ht.removeDependency)(s,{packageManager:e})}catch{}},Vt=async()=>{let e=[];for(let t of yt)if(await a(t))try{await(0,C.unlink)(t),e.push(t)}catch{}return e},Gt=async()=>{let e="./.vscode/settings.json";if(!await a(e))return!1;try{let t=await(0,C.readFile)(e,"utf-8"),s=(0,Re.parse)(t);if(!s||typeof s!="object")return!1;let n=!1,o={...s},i=["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 r of i)r in o&&(delete o[r],n=!0);if("editor.codeActionsOnSave"in o){let r=o["editor.codeActionsOnSave"];if(r&&typeof r=="object"){let l=["source.fixAll.eslint","source.organizeImports.eslint"];for(let u of l)u in r&&(delete r[u],n=!0);Object.keys(r).length===0&&delete o["editor.codeActionsOnSave"]}}return n?(await(0,C.writeFile)(e,JSON.stringify(o,null,2)),!0):!1}catch{return!1}},Yt=async()=>{if((await wt()).length>0)return!0;for(let t of yt)if(await a(t))return!0;return!1},Fe={hasESLint:Yt,remove:async e=>{let t=await wt();Kt(e,t);let s=await Vt(),n=await Gt();return{packagesRemoved:t,filesRemoved:s,vsCodeCleaned:n}}};var j=require("fs/promises"),Ne=require("jsonc-parser"),bt=require("nypm");p();var kt=[".prettierrc",".prettierrc.js",".prettierrc.json",".prettierrc.yml",".prettierrc.yaml",".prettierrc.config.js","prettier.config.js","prettier.config.mjs",".prettierignore"],vt=async()=>{try{let e=await(0,j.readFile)("package.json","utf-8"),t=(0,Ne.parse)(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(i=>i.startsWith("prettier")||i==="eslint-config-prettier"||i==="eslint-plugin-prettier")}catch{return[]}},Zt=async(e,t)=>{if(t.length!==0)try{for(let s of t)await(0,bt.removeDependency)(s,{packageManager:e})}catch{}},Xt=async()=>{let e=[];for(let t of kt)if(await a(t))try{await(0,j.unlink)(t),e.push(t)}catch{}return e},Qt=async()=>{let e="./.vscode/settings.json";if(!await a(e))return!1;try{let t=await(0,j.readFile)(e,"utf-8"),s=(0,Ne.parse)(t);if(!s||typeof s!="object")return!1;let n=!1,o={...s},i=["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 l of i)l in o&&(l==="editor.defaultFormatter"&&o[l]==="esbenp.prettier-vscode"||l!=="editor.defaultFormatter")&&(delete o[l],n=!0);let r=Object.keys(o).filter(l=>l.startsWith("[")&&l.includes("javascript"));for(let l of r){let u=o[l];u&&typeof u=="object"&&"editor.defaultFormatter"in u&&u["editor.defaultFormatter"]==="esbenp.prettier-vscode"&&(delete u["editor.defaultFormatter"],n=!0,Object.keys(u).length===0&&delete o[l])}return n?(await(0,j.writeFile)(e,JSON.stringify(o,null,2)),!0):!1}catch{return!1}},es=async()=>{if((await vt()).length>0)return!0;for(let t of kt)if(await a(t))return!0;return!1},Me={hasPrettier:es,remove:async e=>{let t=await vt();Zt(e,t);let s=await Xt(),n=await Qt();return{packagesRemoved:t,filesRemoved:s,vsCodeCleaned:n}}};var q=require("fs/promises"),Dt=h(require("deepmerge")),Ct=require("jsonc-parser");p();var xt={compilerOptions:{strictNullChecks:!0}},ce="./tsconfig.json",le={exists:()=>a(ce),create:()=>(0,q.writeFile)(ce,JSON.stringify(xt,null,2)),update:async()=>{let e=await(0,q.readFile)(ce,"utf-8"),s=(0,Ct.parse)(e)||{},n=(0,Dt.default)(s,xt);await(0,q.writeFile)(ce,JSON.stringify(n,null,2))}};p();var jt=y.devDependencies["@biomejs/biome"],Pt=y.version,ts=async(e,t=!0)=>{let s=(0,c.spinner)();s.start("Installing dependencies...");let n=[`ultracite@${Pt}`,`@biomejs/biome@${jt}`];if(t)for(let o of n)await(0,ue.addDevDependency)(o,{packageManager:e,workspace:await w()});else{let o=await(0,g.readFile)("package.json","utf8"),i=JSON.parse(o),r={...i,devDependencies:{...i.devDependencies,"@biomejs/biome":jt,ultracite:`^${Pt}`}};await(0,g.writeFile)("package.json",JSON.stringify(r,null,2))}s.stop("Dependencies installed.")},ss=async()=>{let e=(0,c.spinner)();if(e.start("Checking for tsconfig.json..."),await le.exists()){e.message("tsconfig.json found, updating..."),await le.update(),e.stop("tsconfig.json updated.");return}e.message("tsconfig.json not found, creating..."),await le.create(),e.stop("tsconfig.json created.")},ns=async()=>{let e=(0,c.spinner)();if(e.start("Checking for .vscode/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.")},os=async()=>{let e=(0,c.spinner)();if(e.start("Checking for .zed/settings.json..."),await Z.exists()){e.message("settings.json found, updating..."),await Z.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await Z.create(),e.stop("settings.json created.")},is=async()=>{let e=(0,c.spinner)();if(e.start("Checking for Biome configuration..."),await K.exists()){e.message("Biome configuration found, updating..."),await K.update(),e.stop("Biome configuration updated.");return}e.message("Biome configuration not found, creating..."),await K.create(),e.stop("Biome configuration created.")},as=async(e,t=!0)=>{let s=(0,c.spinner)();if(s.start("Initializing pre-commit hooks..."),s.message("Installing Husky..."),t)await O.install(e);else{let n=await(0,g.readFile)("package.json","utf8"),o=JSON.parse(n),i={...o,devDependencies:{...o.devDependencies,husky:"latest"}};await(0,g.writeFile)("package.json",JSON.stringify(i,null,2))}if(await O.exists()){s.message("Pre-commit hook found, updating..."),await O.update(e),s.stop("Pre-commit hook updated.");return}s.message("Pre-commit hook not found, creating..."),await O.create(e),s.stop("Pre-commit hook created.")},rs=async(e,t=!0)=>{let s=(0,c.spinner)();if(s.start("Initializing lefthook..."),s.message("Installing lefthook..."),t)await J.install(e);else{let n=await(0,g.readFile)("package.json","utf8"),o=JSON.parse(n),i={...o,devDependencies:{...o.devDependencies,lefthook:"latest"}};await(0,g.writeFile)("package.json",JSON.stringify(i,null,2))}if(await J.exists()){s.message("lefthook.yml found, updating..."),await J.update(e),s.stop("lefthook.yml updated.");return}s.message("lefthook.yml not found, creating..."),await J.create(e),s.stop("lefthook.yml created.")},cs=async(e,t=!0)=>{let s=(0,c.spinner)();if(s.start("Initializing lint-staged..."),s.message("Installing lint-staged..."),t)await E.install(e);else{let n=await(0,g.readFile)("package.json","utf8"),o=JSON.parse(n),i={...o,devDependencies:{...o.devDependencies,"lint-staged":"latest"}};await(0,g.writeFile)("package.json",JSON.stringify(i,null,2))}if(await E.exists()){s.message("lint-staged found, updating..."),await E.update(e),s.stop("lint-staged updated.");return}s.message("lint-staged not found, creating..."),await E.create(e),s.stop("lint-staged created.")},ls=async()=>{let e=(0,c.spinner)();if(e.start("Checking for GitHub Copilot rules..."),await se.exists()){e.message("GitHub Copilot rules found, updating..."),await se.update(),e.stop("GitHub Copilot rules updated.");return}e.message("GitHub Copilot rules not found, creating..."),await se.create(),e.stop("GitHub Copilot rules created.")},us=async()=>{let e=(0,c.spinner)();if(e.start("Checking for Cursor rules..."),await ee.exists()){e.message("Cursor rules found, updating..."),await ee.update(),e.stop("Cursor rules updated.");return}e.message("Cursor rules not found, creating..."),await ee.create(),e.stop("Cursor rules created.")},ds=async()=>{let e=(0,c.spinner)();if(e.start("Checking for Windsurf rules..."),await ne.exists()){e.message("Windsurf rules found, updating..."),await ne.update(),e.stop("Windsurf rules updated.");return}e.message("Windsurf rules not found, creating..."),await ne.create(),e.stop("Windsurf rules created.")},ps=async()=>{let e=(0,c.spinner)();if(e.start("Checking for Zed rules..."),await oe.exists()){e.message("Zed rules found, updating..."),await oe.update(),e.stop("Zed rules updated.");return}e.message("Zed rules not found, creating..."),await oe.create(),e.stop("Zed rules created.")},ms=async()=>{let e=(0,c.spinner)();if(e.start("Checking for Claude Code rules..."),await X.exists()){e.message("Claude Code rules found, updating..."),await X.update(),e.stop("Claude Code rules updated.");return}e.message("Claude Code rules not found, creating..."),await X.create(),e.stop("Claude Code rules created.")},fs=async()=>{let e=(0,c.spinner)();if(e.start("Checking for OpenAI Codex rules..."),await Q.exists()){e.message("OpenAI Codex rules found, updating..."),await Q.update(),e.stop("OpenAI Codex rules updated.");return}e.message("OpenAI Codex rules not found, creating..."),await Q.create(),e.stop("OpenAI Codex rules created.")},gs=async()=>{let e=(0,c.spinner)();if(e.start("Checking for Kiro IDE steering files..."),await te.exists()){e.message("Kiro IDE steering files found, updating..."),await te.update(),e.stop("Kiro IDE steering files updated.");return}e.message("Kiro IDE steering files not found, creating..."),await te.create(),e.stop("Kiro IDE steering files created.")},hs=async e=>{let t=(0,c.spinner)();t.start("Removing Prettier dependencies and configuration...");try{let s=await Me.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...")}},ys=async e=>{let t=(0,c.spinner)();t.start("Removing ESLint dependencies and configuration...");try{let s=await Fe.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...")}},St=async e=>{(0,c.intro)(We);try{let t=e??{},{pm:s}=t;if(!s){let u=await(0,ue.detectPackageManager)(Ae.default.cwd());if(!u)throw new Error("No package manager specified or detected");if(u.warnings)for(let P of u.warnings)c.log.warn(P);c.log.info(`Detected lockfile, using ${u.name}`),s=u.name}let n=t.removePrettier,o=t.removeEslint;if(n===void 0||o===void 0){let u=[];if(n===void 0&&await Me.hasPrettier()&&u.push({label:"Remove Prettier (dependencies, config files, VS Code settings)",value:"prettier"}),o===void 0&&await Fe.hasESLint()&&u.push({label:"Remove ESLint (dependencies, config files, VS Code settings)",value:"eslint"}),u.length>0){let P=await(0,c.multiselect)({message:"Remove existing formatters/linters (recommended for clean migration)?",options:u,required:!1});n===void 0&&(n=P.includes("prettier")),o===void 0&&(o=P.includes("eslint"))}}let i=t.editors;i||(i=await(0,c.multiselect)({message:"Which editors do you want to configure (recommended)?",options:[{label:"VSCode / Cursor / Windsurf",value:"vscode"},{label:"Zed",value:"zed"}],required:!1}));let r=t.rules;r||(r=await(0,c.multiselect)({message:"Which editor rules do you want to enable (optional)?",options:[{label:"GitHub Copilot (VSCode)",value:"vscode-copilot"},{label:"Cursor",value:"cursor"},{label:"Windsurf",value:"windsurf"},{label:"Zed",value:"zed"},{label:"Claude Code",value:"claude"},{label:"OpenAI Codex",value:"codex"},{label:"Kiro IDE",value:"kiro"}],required:!1}));let l=t.features;l===void 0&&(t.pm||t.editors||t.rules||t.removePrettier!==void 0||t.removeEslint!==void 0?l=[]:l=await(0,c.multiselect)({message:"Would you like any of the following (optional)?",options:[{label:"Husky pre-commit hook",value:"husky"},{label:"Lefthook pre-commit hook",value:"lefthook"},{label:"Lint-staged",value:"lint-staged"}],required:!1})),n&&await hs(s),o&&await ys(s),await ts(s,!t.skipInstall),await ss(),await is(),i?.includes("vscode")&&await ns(),i?.includes("zed")&&await os(),r?.includes("vscode-copilot")&&await ls(),r?.includes("cursor")&&await us(),r?.includes("windsurf")&&await ds(),r?.includes("zed")&&await ps(),r?.includes("claude")&&await ms(),r?.includes("codex")&&await fs(),r?.includes("kiro")&&await gs(),l?.includes("husky")&&await as(s,!t.skipInstall),l?.includes("lefthook")&&await rs(s,!t.skipInstall),l?.includes("lint-staged")&&await cs(s,!t.skipInstall),c.log.success("Successfully initialized Ultracite configuration!")}catch(t){let s=t instanceof Error?t.message:"Unknown error";c.log.error(`Failed to initialize Ultracite configuration: ${s}`),Ae.default.exit(1)}};p();var de=pe.trpcServer.initTRPC.meta().create(),ws=de.router({init:de.procedure.meta({description:"Initialize Ultracite in the current directory"}).input(m.default.object({pm:m.default.enum(T.packageManagers).optional().describe("Package manager to use"),editors:m.default.array(m.default.enum(T.editorConfigs)).optional().describe("Editors to configure"),rules:m.default.array(m.default.enum(T.editorRules)).optional().describe("Editor rules to enable"),features:m.default.array(m.default.enum(T.integrations)).optional().describe("Additional features to enable"),removePrettier:m.default.boolean().optional().describe("Remove Prettier dependencies and configuration"),removeEslint:m.default.boolean().optional().describe("Remove ESLint dependencies and configuration"),skipInstall:m.default.boolean().default(!1).describe("Skip installing dependencies")})).mutation(async({input:e})=>{await St(e)}),lint:de.procedure.meta({description:"Run Biome linter without fixing files"}).input(m.default.array(m.default.string()).optional().default([]).describe("specific files to lint")).query(({input:e})=>{Te(e)}),format:de.procedure.meta({description:"Run Biome linter and fixes files"}).input(m.default.tuple([m.default.array(m.default.string()).optional().default([]).describe("specific files to format"),m.default.object({unsafe:m.default.boolean().optional().describe("apply unsafe fixes")})])).mutation(({input:e})=>{let[t,s]=e;$e(t,{unsafe:s.unsafe})})}),bs=(0,pe.createCli)({router:ws,name:y.name,version:y.version,description:y.description});process.env.VITEST||bs.run();
package/dist/index.mjs CHANGED
@@ -1,8 +1,17 @@
1
1
  #!/usr/bin/env node
2
- var G=Object.defineProperty;var mt=Object.getOwnPropertyDescriptor;var ft=Object.getOwnPropertyNames;var gt=Object.prototype.hasOwnProperty;var Y=(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')}),ye=e=>t=>{var s=e[t];if(s)return s();throw new Error("Module not found in bundle: "+t)};var x=(e,t)=>()=>(e&&(t=e(e=0)),t);var Z=(e,t)=>{for(var s in t)G(e,s,{get:t[s],enumerable:!0})},ht=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ft(t))!gt.call(e,o)&&o!==s&&G(e,o,{get:()=>t[o],enumerable:!(n=mt(t,o))||n.enumerable});return e};var X=e=>ht(G({},"__esModule",{value:!0}),e);import{access as xt,readFile as Dt}from"fs/promises";import{parse as jt}from"jsonc-parser";var i,S,d=x(()=>{"use strict";i=async e=>{try{return await xt(e),!0}catch{return!1}},S=async()=>{if(await i("pnpm-workspace.yaml"))return!0;try{let e=jt(await Dt("package.json","utf-8"));return e?!!e.workspaces:!1}catch{return!1}}});var Ve={};Z(Ve,{husky:()=>w});import{execSync as zt}from"child_process";import{mkdir as Tt,readFile as Wt,writeFile as He}from"fs/promises";var Ke,z,w,ae=x(()=>{"use strict";d();Ke="npx ultracite format",z="./.husky/pre-commit",w={exists:()=>i(z),install:e=>{zt(`${e} -D husky`)},create:async()=>{await Tt(".husky",{recursive:!0}),await He(z,Ke)},update:async()=>{let e=await Wt(z,"utf-8");await He(z,`${e}
3
- ${Ke}`)}}});var Ze={};Z(Ze,{lefthook:()=>v});import{execSync as Ge}from"child_process";import{readFile as Lt,writeFile as T}from"fs/promises";var W,b,Ye,v,ce=x(()=>{"use strict";d();W="npx ultracite format",b="./lefthook.yml",Ye=`pre-commit:
2
+ var G=Object.defineProperty;var ft=Object.getOwnPropertyDescriptor;var gt=Object.getOwnPropertyNames;var ht=Object.prototype.hasOwnProperty;var Y=(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')}),ge=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 Z=(e,t)=>{for(var s in t)G(e,s,{get:t[s],enumerable:!0})},yt=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of gt(t))!ht.call(e,o)&&o!==s&&G(e,o,{get:()=>t[o],enumerable:!(n=ft(t,o))||n.enumerable});return e};var X=e=>yt(G({},"__esModule",{value:!0}),e);import{access as Dt,readFile as Ct}from"fs/promises";import{parse as jt}from"jsonc-parser";import{packageManagers as Pt}from"nypm";var a,g,we,j,d=C(()=>{"use strict";a=async e=>{try{return await Dt(e),!0}catch{return!1}},g=async()=>{if(await a("pnpm-workspace.yaml"))return!0;try{let e=jt(await Ct("package.json","utf-8"));return e?!!e.workspaces||!!e.workspace:!1}catch{return!1}},we=`
3
+ 888 888 888 88888888888 8888888b. d8888 .d8888b. 8888888 88888888888 8888888888
4
+ 888 888 888 888 888 Y88b d88888 d88P Y88b 888 888 888
5
+ 888 888 888 888 888 888 d88P888 888 888 888 888 888
6
+ 888 888 888 888 888 d88P d88P 888 888 888 888 8888888
7
+ 888 888 888 888 8888888P" d88P 888 888 888 888 888
8
+ 888 888 888 888 888 T88b d88P 888 888 888 888 888 888
9
+ Y88b. .d88P 888 888 888 T88b d8888888888 Y88b d88P 888 888 888
10
+ "Y88888P" 88888888 888 888 T88b d88P 888 "Y8888P" 8888888 888 8888888888
11
+ `,j={packageManagers:Pt.map(e=>e.name),editorConfigs:["vscode","zed"],editorRules:["vscode-copilot","cursor","windsurf","zed","claude","codex","kiro"],integrations:["husky","lefthook","lint-staged"]}});var Ke={};Z(Ke,{husky:()=>k});import{mkdir as _t,readFile as Lt,writeFile as Be}from"fs/promises";import{addDevDependency as Wt,dlxCommand as He}from"nypm";var z,k,re=C(()=>{"use strict";d();z="./.husky/pre-commit",k={exists:()=>a(z),install:async e=>{await Wt("husky",{packageManager:e,workspace:await g()})},create:async e=>{await _t(".husky",{recursive:!0});let t=He(e,"ultracite",{args:["format"],short:e==="npm"});await Be(z,t)},update:async e=>{let t=await Lt(z,"utf-8"),s=He(e,"ultracite",{args:["format"],short:e==="npm"});await Be(z,`${t}
12
+ ${s}`)}}});var Ze={};Z(Ze,{lefthook:()=>x});import{execSync as qt}from"child_process";import{readFile as Bt,writeFile as T}from"fs/promises";import{addDevDependency as Ht,dlxCommand as Ge}from"nypm";var Ye,v,Ve,x,ce=C(()=>{"use strict";d();Ye=e=>Ge(e,"ultracite",{args:["format"],short:e==="npm"}),v="./lefthook.yml",Ve=e=>`pre-commit:
4
13
  jobs:
5
- - run: ${W}
14
+ - run: ${Ye(e)}
6
15
  glob:
7
16
  - "*.js"
8
17
  - "*.jsx"
@@ -12,7 +21,7 @@ ${Ke}`)}}});var Ze={};Z(Ze,{lefthook:()=>v});import{execSync as Ge}from"child_pr
12
21
  - "*.jsonc"
13
22
  - "*.css"
14
23
  stage_fixed: true
15
- `,v={exists:()=>i(b),install:e=>{Ge(`${e} -D lefthook`),Ge("npx lefthook install")},create:async()=>{await T(b,Ye)},update:async()=>{let e=await Lt(b,"utf-8");if(!e.includes(W))if(e.includes("pre-commit:"))if(e.includes("jobs:")){let t=` - run: ${W}
24
+ `,x={exists:()=>a(v),install:async e=>{await Ht("lefthook",{packageManager:e,workspace:await g()});let t=Ge(e,"lefthook",{args:["install"],short:e==="npm"});qt(t)},create:async e=>{let t=Ve(e);await T(v,t)},update:async e=>{let t=await Bt(v,"utf-8"),s=Ye(e),n=Ve(e);if(!t.includes(s))if(t.includes("pre-commit:"))if(t.includes("jobs:")){let o=` - run: ${s}
16
25
  glob:
17
26
  - "*.js"
18
27
  - "*.jsx"
@@ -21,9 +30,9 @@ ${Ke}`)}}});var Ze={};Z(Ze,{lefthook:()=>v});import{execSync as Ge}from"child_pr
21
30
  - "*.json"
22
31
  - "*.jsonc"
23
32
  - "*.css"
24
- stage_fixed: true`,s=e.replace(/(pre-commit:\s*\n\s*jobs:\s*\n)/,`$1${t}
25
- `);await T(b,s)}else{let t=` jobs:
26
- - run: ${W}
33
+ stage_fixed: true`,i=t.replace(/(pre-commit:\s*\n\s*jobs:\s*\n)/,`$1${o}
34
+ `);await T(v,i)}else{let o=` jobs:
35
+ - run: ${s}
27
36
  glob:
28
37
  - "*.js"
29
38
  - "*.jsx"
@@ -32,15 +41,15 @@ ${Ke}`)}}});var Ze={};Z(Ze,{lefthook:()=>v});import{execSync as Ge}from"child_pr
32
41
  - "*.json"
33
42
  - "*.jsonc"
34
43
  - "*.css"
35
- stage_fixed: true`,s=e.replace(/(pre-commit:\s*\n)/,`$1${t}
36
- `);await T(b,s)}else await T(b,`${e}
37
- ${Ye}`)}}});var _t,le=x(()=>{_t=ye({"./husky.ts":()=>(ae(),X(Ve)),"./lefthook.ts":()=>(ce(),X(Ze)),"./lint-staged.ts":()=>(ue(),X(Xe))})});var Xe={};Z(Xe,{lintStaged:()=>k});import{execSync as qt}from"child_process";import{readFile as L,writeFile as h}from"fs/promises";import{pathToFileURL as Bt}from"url";import D from"deepmerge";import{parse as pe}from"jsonc-parser";var f,Qe,Ht,Kt,Vt,Gt,Yt,Zt,Xt,Qt,es,de,ts,k,ue=x(()=>{"use strict";d();le();f={"*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}":["npx ultracite format"]},Qe=["./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"],Ht=(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(),u=r.trim().replace(/['"]/g,"");return a&&a!==""?(a.startsWith("[")&&a.endsWith("]")?t[u]=a.slice(1,-1).split(",").map(C=>C.trim().replace(/['"]/g,"")):t[u]=a.replace(/['"]/g,""),{newCurrentKey:null,newCurrentArray:[]}):{newCurrentKey:u,newCurrentArray:[]}}if(o.startsWith("-")&&s){let r=[...n,o.slice(1).trim().replace(/['"]/g,"")];return{newCurrentKey:s,newCurrentArray:r}}return{newCurrentKey:s,newCurrentArray:n}},Kt=e=>{let t=e.split(`
38
- `).filter(r=>r.trim()&&!r.trim().startsWith("#")),s={},n=null,o=[];for(let r of t){let c=Ht(r,s,n,o);n=c.newCurrentKey,o=c.newCurrentArray}return n&&o.length>0&&(s[n]=o),s},Vt=e=>{let t="";for(let[s,n]of Object.entries(e))if(Array.isArray(n)){t+=`${s}:
44
+ stage_fixed: true`,i=t.replace(/(pre-commit:\s*\n)/,`$1${o}
45
+ `);await T(v,i)}else await T(v,`${t}
46
+ ${n}`)}}});var Kt,le=C(()=>{Kt=ge({"./husky.ts":()=>(re(),X(Ke)),"./lefthook.ts":()=>(ce(),X(Ze)),"./lint-staged.ts":()=>(ue(),X(Xe))})});var Xe={};Z(Xe,{lintStaged:()=>D});import{readFile as _,writeFile as y}from"fs/promises";import{pathToFileURL as Vt}from"url";import P from"deepmerge";import{parse as pe}from"jsonc-parser";import{addDevDependency as Gt,dlxCommand as Yt}from"nypm";var h,Qe,Zt,Xt,Qt,es,ts,ss,ns,os,is,de,as,D,ue=C(()=>{"use strict";d();le();h=e=>({"*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}":[Yt(e,"ultracite",{args:["format"],short:e==="npm"})]}),Qe=["./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"],Zt=(e,t,s,n)=>{let o=e.trim();if(o.includes(":")&&!o.startsWith("-")){s&&n.length>0&&(t[s]=n);let[i,...r]=o.split(":"),c=r.join(":").trim(),l=i.trim().replace(/['"]/g,"");return c&&c!==""?(c.startsWith("[")&&c.endsWith("]")?t[l]=c.slice(1,-1).split(",").map(w=>w.trim().replace(/['"]/g,"")):t[l]=c.replace(/['"]/g,""),{newCurrentKey:null,newCurrentArray:[]}):{newCurrentKey:l,newCurrentArray:[]}}if(o.startsWith("-")&&s){let i=[...n,o.slice(1).trim().replace(/['"]/g,"")];return{newCurrentKey:s,newCurrentArray:i}}return{newCurrentKey:s,newCurrentArray:n}},Xt=e=>{let t=e.split(`
47
+ `).filter(i=>i.trim()&&!i.trim().startsWith("#")),s={},n=null,o=[];for(let i of t){let r=Zt(i,s,n,o);n=r.newCurrentKey,o=r.newCurrentArray}return n&&o.length>0&&(s[n]=o),s},Qt=e=>{let t="";for(let[s,n]of Object.entries(e))if(Array.isArray(n)){t+=`${s}:
39
48
  `;for(let o of n)t+=` - '${o}'
40
49
  `}else t+=`${s}: '${n}'
41
- `;return t},Gt=async()=>{try{let e=pe(await L("./package.json","utf-8"));return e?e.type==="module":!1}catch{return!1}},Yt=async()=>{let e=pe(await L("./package.json","utf-8"));e&&(e["lint-staged"]?e["lint-staged"]=D(e["lint-staged"],f):e["lint-staged"]=f,await h("./package.json",JSON.stringify(e,null,2)))},Zt=async e=>{let t=await L(e,"utf-8"),s=pe(t);if(!s)return;let n=D(s,f);await h(e,JSON.stringify(n,null,2))},Xt=async e=>{let t=await L(e,"utf-8"),s=Kt(t);if(!s)return;let n=D(s,f);await h(e,Vt(n))},Qt=async e=>{let n=(await import(Bt(e).href)).default||{},o=D(n,f),r=`export default ${JSON.stringify(o,null,2)};
42
- `;await h(e,r)},es=async e=>{delete Y.cache[Y.resolve(`./${e}`)];let t=_t(`./${e}`),s=D(t,f),n=`module.exports = ${JSON.stringify(s,null,2)};
43
- `;await h(e,n)},de=async()=>{await h(".lintstagedrc.json",JSON.stringify(f,null,2))},ts=async e=>{if(e==="./package.json"){await Yt();return}if(e.endsWith(".json")||e==="./.lintstagedrc"){await Zt(e);return}if(e.endsWith(".yaml")||e.endsWith(".yml")){await Xt(e);return}let t=await Gt();if(e.endsWith(".mjs")||e.endsWith(".js")&&t){try{await Qt(e)}catch{await de()}return}if(e.endsWith(".cjs")||e.endsWith(".js")&&!t)try{await es(e)}catch{await de()}},k={exists:async()=>{for(let e of Qe)if(await i(e))return!0;return!1},install:e=>{qt(`${e} -D lint-staged`)},create:async()=>{await h(".lintstagedrc.json",JSON.stringify(f,null,2))},update:async()=>{let e=null;for(let t of Qe)if(await i(t)){e=t;break}if(!e){await de();return}await ts(e)}}});import{createCli as Bs,trpcServer as Hs}from"trpc-cli";import p from"zod";var g={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"5.1.8",bin:{ultracite:"dist/index.js"},files:["biome.jsonc","dist"],scripts:{build:"tsup",test:"vitest run","test:coverage":"vitest --coverage"},main:"./biome.jsonc",author:"Hayden Bleasel <hello@haydenbleasel.com>",bugs:{url:"https://github.com/haydenbleasel/ultracite/issues"},homepage:"https://github.com/haydenbleasel/ultracite#readme",keywords:["ultracite","biome","linter","formatter","fixer"],license:"MIT",publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},repository:{type:"git",url:"git+https://github.com/haydenbleasel/ultracite.git"},devDependencies:{"@auto-it/all-contributors":"^11.3.0","@auto-it/first-time-contributor":"^11.3.0","@biomejs/biome":"2.2.0","@types/node":"^24.0.14","@vitest/coverage-v8":"3.2.4",tsup:"^8.5.0"},dependencies:{"@clack/prompts":"^0.11.0",deepmerge:"^4.3.1","jsonc-parser":"^3.3.1","trpc-cli":"^0.10.0",vitest:"^3.2.4",zod:"^4.0.5"},packageManager:"pnpm@10.13.1"};import{execSync as wt}from"child_process";import bt from"process";var we=(e,t={})=>{try{let s=e.length>0?e.map(o=>`"${o}"`).join(" "):"./",n=t.unsafe?" --unsafe":"";wt(`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),bt.exit(1)}};import{execSync as vt}from"child_process";import kt from"process";var be=e=>{try{let t=e.length>0?e.map(s=>`"${s}"`).join(" "):"./";vt(`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),kt.exit(1)}};import{execSync as Ds}from"child_process";import{readFile as H,writeFile as K}from"fs/promises";import js from"process";import{intro as Cs,log as he,multiselect as B,spinner as m}from"@clack/prompts";import{readFile as Ct,writeFile as ve}from"fs/promises";import St from"deepmerge";import{parse as Rt}from"jsonc-parser";d();var Pt=g.devDependencies["@biomejs/biome"],ke={$schema:`https://biomejs.dev/schemas/${Pt}/schema.json`,extends:["ultracite"]},Q=async()=>await i("./biome.json")?"./biome.json":"./biome.jsonc",R={exists:async()=>{let e=await Q();return i(e)},create:async()=>{let e=await Q();return ve(e,JSON.stringify(ke,null,2))},update:async()=>{let e=await Q(),t=await Ct(e,"utf-8"),n=Rt(t)||{},o=n.extends&&Array.isArray(n.extends)?n.extends:[];o.includes("ultracite")||(n.extends=[...o,"ultracite"]);let r={$schema:ke.$schema},c=St(n,r);await ve(e,JSON.stringify(c,null,2))}};d();import{mkdir as Ft,readFile as At,writeFile as xe}from"fs/promises";import $t from"deepmerge";import{parse as It}from"jsonc-parser";var De={"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"}},P="./.vscode/settings.json",F={exists:()=>i(P),create:async()=>{await Ft(".vscode",{recursive:!0}),await xe(P,JSON.stringify(De,null,2))},update:async()=>{let e=await At(P,"utf-8"),s=It(e)||{},n=$t(s,De);await xe(P,JSON.stringify(n,null,2))}};d();import{mkdir as Ot,readFile as Ut,writeFile as je}from"fs/promises";import Jt from"deepmerge";import{parse as Mt}from"jsonc-parser";var Ce={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"}}}}}},A="./.zed/settings.json",$={exists:()=>i(A),create:async()=>{await Ot(".zed",{recursive:!0}),await je(A,JSON.stringify(Ce,null,2))},update:async()=>{let e=await Ut(A,"utf-8"),s=Mt(e)||{},n=Jt(s,Ce);await je(A,JSON.stringify(n,null,2))}};import{mkdir as Ue,writeFile as Je}from"fs/promises";var Se=["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."],Re=["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."],Pe=["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.'],Fe=["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"`.'],Ae=["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."],$e=["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.'],Ie=["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."],Oe=["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."],Dn=[...Se,...Re,...Pe,...Fe,...Ae,...$e,...Ie,...Oe],l=`# Project Context
50
+ `;return t},es=async()=>{try{let e=pe(await _("./package.json","utf-8"));return e?e.type==="module":!1}catch{return!1}},ts=async e=>{let t=pe(await _("./package.json","utf-8"));t&&(t["lint-staged"]?t["lint-staged"]=P(t["lint-staged"],h(e)):t["lint-staged"]=h(e),await y("./package.json",JSON.stringify(t,null,2)))},ss=async(e,t)=>{let s=await _(e,"utf-8"),n=pe(s);if(!n)return;let o=P(n,h(t));await y(e,JSON.stringify(o,null,2))},ns=async(e,t)=>{let s=await _(e,"utf-8"),n=Xt(s);if(!n)return;let o=P(n,h(t));await y(e,Qt(o))},os=async(e,t)=>{let o=(await import(Vt(e).href)).default||{},i=P(o,h(t)),r=`export default ${JSON.stringify(i,null,2)};
51
+ `;await y(e,r)},is=async(e,t)=>{delete Y.cache[Y.resolve(`./${e}`)];let s=Kt(`./${e}`),n=P(s,h(t)),o=`module.exports = ${JSON.stringify(n,null,2)};
52
+ `;await y(e,o)},de=async e=>{await y(".lintstagedrc.json",JSON.stringify(h(e),null,2))},as=async(e,t)=>{if(e==="./package.json"){await ts(t);return}if(e.endsWith(".json")||e==="./.lintstagedrc"){await ss(e,t);return}if(e.endsWith(".yaml")||e.endsWith(".yml")){await ns(e,t);return}let s=await es();if(e.endsWith(".mjs")||e.endsWith(".js")&&s){try{await os(e,t)}catch{await de(t)}return}if(e.endsWith(".cjs")||e.endsWith(".js")&&!s)try{await is(e,t)}catch{await de(t)}},D={exists:async()=>{for(let e of Qe)if(await a(e))return!0;return!1},install:async e=>{await Gt("lint-staged",{packageManager:e,workspace:await g()})},create:async e=>{await y(".lintstagedrc.json",JSON.stringify(h(e),null,2))},update:async e=>{let t=null;for(let s of Qe)if(await a(s)){t=s;break}if(!t){await de(e);return}await as(t,e)}}});import{createCli as qs,trpcServer as Bs}from"trpc-cli";import p from"zod";var f={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"5.1.9",bin:{ultracite:"dist/index.js"},files:["biome.jsonc","dist"],scripts:{build:"tsup",test:"vitest run","test:coverage":"vitest --coverage"},main:"./biome.jsonc",author:"Hayden Bleasel <hello@haydenbleasel.com>",bugs:{url:"https://github.com/haydenbleasel/ultracite/issues"},homepage:"https://github.com/haydenbleasel/ultracite#readme",keywords:["ultracite","biome","linter","formatter","fixer"],license:"MIT",publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},repository:{type:"git",url:"git+https://github.com/haydenbleasel/ultracite.git"},devDependencies:{"@auto-it/all-contributors":"^11.3.0","@auto-it/first-time-contributor":"^11.3.0","@biomejs/biome":"2.2.0","@types/node":"^24.0.14","@vitest/coverage-v8":"3.2.4",tsup:"^8.5.0"},dependencies:{"@clack/prompts":"^0.11.0",deepmerge:"^4.3.1","jsonc-parser":"^3.3.1",nypm:"^0.6.1","trpc-cli":"^0.10.0",vitest:"^3.2.4",zod:"^4.0.5"},packageManager:"pnpm@10.13.1"};import{execSync as bt}from"child_process";import kt from"process";var he=(e,t={})=>{try{let s=e.length>0?e.map(o=>`"${o}"`).join(" "):"./",n=t.unsafe?" --unsafe":"";bt(`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),kt.exit(1)}};import{execSync as vt}from"child_process";import xt from"process";var ye=e=>{try{let t=e.length>0?e.map(s=>`"${s}"`).join(" "):"./";vt(`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),xt.exit(1)}};import{readFile as H,writeFile as K}from"fs/promises";import ut from"process";import{intro as Cs,log as q,multiselect as B,spinner as m}from"@clack/prompts";import{addDevDependency as js,detectPackageManager as Ps}from"nypm";import{readFile as St,writeFile as be}from"fs/promises";import Rt from"deepmerge";import{parse as Ft}from"jsonc-parser";d();var Nt=f.devDependencies["@biomejs/biome"],ke={$schema:`https://biomejs.dev/schemas/${Nt}/schema.json`,extends:["ultracite"]},Q=async()=>await a("./biome.json")?"./biome.json":"./biome.jsonc",S={exists:async()=>{let e=await Q();return a(e)},create:async()=>{let e=await Q();return be(e,JSON.stringify(ke,null,2))},update:async()=>{let e=await Q(),t=await St(e,"utf-8"),n=Ft(t)||{},o=n.extends&&Array.isArray(n.extends)?n.extends:[];o.includes("ultracite")||(n.extends=[...o,"ultracite"]);let i={$schema:ke.$schema},r=Rt(n,i);await be(e,JSON.stringify(r,null,2))}};d();import{mkdir as Mt,readFile as At,writeFile as ve}from"fs/promises";import It from"deepmerge";import{parse as Ot}from"jsonc-parser";var xe={"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"}},R="./.vscode/settings.json",F={exists:()=>a(R),create:async()=>{await Mt(".vscode",{recursive:!0}),await ve(R,JSON.stringify(xe,null,2))},update:async()=>{let e=await At(R,"utf-8"),s=Ot(e)||{},n=It(s,xe);await ve(R,JSON.stringify(n,null,2))}};d();import{mkdir as Ut,readFile as Jt,writeFile as De}from"fs/promises";import $t from"deepmerge";import{parse as Et}from"jsonc-parser";var Ce={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"}}}}}},N="./.zed/settings.json",M={exists:()=>a(N),create:async()=>{await Ut(".zed",{recursive:!0}),await De(N,JSON.stringify(Ce,null,2))},update:async()=>{let e=await Jt(N,"utf-8"),s=Et(e)||{},n=$t(s,Ce);await De(N,JSON.stringify(n,null,2))}};import{mkdir as Ie,writeFile as Oe}from"fs/promises";var je=["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."],Pe=["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."],Se=["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.'],Re=["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"`.'],Fe=["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."],Ne=["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.'],Me=["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."],Ae=["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."],Dn=[...je,...Pe,...Se,...Re,...Fe,...Ne,...Me,...Ae],u=`# Project Context
44
53
  Ultracite enforces strict type safety, accessibility standards, and consistent code quality for JavaScript/TypeScript projects using Biome's lightning-fast formatter and linter.
45
54
 
46
55
  ## Key Principles
@@ -58,35 +67,35 @@ Ultracite enforces strict type safety, accessibility standards, and consistent c
58
67
  ## Rules
59
68
 
60
69
  ### Accessibility (a11y)
61
- ${Se.map(e=>`- ${e}`).join(`
70
+ ${je.map(e=>`- ${e}`).join(`
62
71
  `)}
63
72
 
64
73
  ### Code Complexity and Quality
65
- ${Re.map(e=>`- ${e}`).join(`
74
+ ${Pe.map(e=>`- ${e}`).join(`
66
75
  `)}
67
76
 
68
77
  ### React and JSX Best Practices
69
- ${Pe.map(e=>`- ${e}`).join(`
78
+ ${Se.map(e=>`- ${e}`).join(`
70
79
  `)}
71
80
 
72
81
  ### Correctness and Safety
73
- ${Fe.map(e=>`- ${e}`).join(`
82
+ ${Re.map(e=>`- ${e}`).join(`
74
83
  `)}
75
84
 
76
85
  ### TypeScript Best Practices
77
- ${Ae.map(e=>`- ${e}`).join(`
86
+ ${Fe.map(e=>`- ${e}`).join(`
78
87
  `)}
79
88
 
80
89
  ### Style and Consistency
81
- ${$e.map(e=>`- ${e}`).join(`
90
+ ${Ne.map(e=>`- ${e}`).join(`
82
91
  `)}
83
92
 
84
93
  ### Next.js Specific Rules
85
- ${Ie.map(e=>`- ${e}`).join(`
94
+ ${Me.map(e=>`- ${e}`).join(`
86
95
  `)}
87
96
 
88
97
  ### Testing Best Practices
89
- ${Oe.map(e=>`- ${e}`).join(`
98
+ ${Ae.map(e=>`- ${e}`).join(`
90
99
  `)}
91
100
 
92
101
  ## Common Tasks
@@ -111,25 +120,16 @@ try {
111
120
  } catch (e) {
112
121
  console.log(e);
113
122
  }
114
- \`\`\``;d();var ee="./.claude/CLAUDE.md",I={exists:()=>i(ee),create:async()=>{await Ue(".claude",{recursive:!0}),await Je(ee,l)},update:async()=>{await Ue(".claude",{recursive:!0}),await Je(ee,l)}};import{writeFile as Me}from"fs/promises";d();var te="./AGENTS.md",O={exists:()=>i(te),create:async()=>{await Me(te,l)},update:async()=>{await Me(te,l)}};import{mkdir as Ee,writeFile as Ne}from"fs/promises";d();var se="./.cursor/rules/ultracite.mdc",Et=`---
123
+ \`\`\``;d();var ee="./.claude/CLAUDE.md",A={exists:()=>a(ee),create:async()=>{await Ie(".claude",{recursive:!0}),await Oe(ee,u)},update:async()=>{await Ie(".claude",{recursive:!0}),await Oe(ee,u)}};import{writeFile as Ue}from"fs/promises";d();var te="./AGENTS.md",I={exists:()=>a(te),create:async()=>{await Ue(te,u)},update:async()=>{await Ue(te,u)}};import{mkdir as Je,writeFile as $e}from"fs/promises";d();var se="./.cursor/rules/ultracite.mdc",zt=`---
115
124
  description: Ultracite Rules - AI-Ready Formatter and Linter
116
125
  globs: "**/*.{ts,tsx,js,jsx}"
117
126
  alwaysApply: true
118
127
  ---
119
128
 
120
- ${l}`,U={exists:()=>i(se),create:async()=>{await Ee(".cursor/rules",{recursive:!0}),await Ne(se,Et)},update:async()=>{await Ee(".cursor/rules",{recursive:!0}),await Ne(se,l)}};import{mkdir as ze,writeFile as Te}from"fs/promises";d();var ne="./.kiro/steering/linting-and-formatting.md",J={exists:()=>i(ne),create:async()=>{await ze(".kiro/steering",{recursive:!0}),await Te(ne,l)},update:async()=>{await ze(".kiro/steering",{recursive:!0}),await Te(ne,l)}};import{mkdir as We,writeFile as Le}from"fs/promises";d();var oe="./.github/copilot-instructions.md",_e=`---
129
+ ${u}`,O={exists:()=>a(se),create:async()=>{await Je(".cursor/rules",{recursive:!0}),await $e(se,zt)},update:async()=>{await Je(".cursor/rules",{recursive:!0}),await $e(se,u)}};import{mkdir as Ee,writeFile as ze}from"fs/promises";d();var ne="./.kiro/steering/linting-and-formatting.md",U={exists:()=>a(ne),create:async()=>{await Ee(".kiro/steering",{recursive:!0}),await ze(ne,u)},update:async()=>{await Ee(".kiro/steering",{recursive:!0}),await ze(ne,u)}};import{mkdir as Te,writeFile as _e}from"fs/promises";d();var oe="./.github/copilot-instructions.md",Le=`---
121
130
  applyTo: "**/*.{ts,tsx,js,jsx}"
122
131
  ---
123
132
 
124
- ${l}`,M={exists:()=>i(oe),create:async()=>{await We(".github",{recursive:!0}),await Le(oe,_e)},update:async()=>{await We(".github",{recursive:!0}),await Le(oe,_e)}};import{mkdir as qe,writeFile as Be}from"fs/promises";d();var ie="./.windsurf/rules/ultracite.md",E={exists:()=>i(ie),create:async()=>{await qe(".windsurf/rules",{recursive:!0}),await Be(ie,l)},update:async()=>{await qe(".windsurf/rules",{recursive:!0}),await Be(ie,l)}};import{readFile as Nt,writeFile as re}from"fs/promises";d();var y="./.rules",N={exists:()=>i(y),create:async()=>{await re(y,l)},update:async()=>{if(!await i(y)){await re(y,l);return}let e=await Nt(y,"utf-8");e.includes(l.trim())||await re(y,`${e}
133
+ ${u}`,J={exists:()=>a(oe),create:async()=>{await Te(".github",{recursive:!0}),await _e(oe,Le)},update:async()=>{await Te(".github",{recursive:!0}),await _e(oe,Le)}};import{mkdir as We,writeFile as qe}from"fs/promises";d();var ie="./.windsurf/rules/ultracite.md",$={exists:()=>a(ie),create:async()=>{await We(".windsurf/rules",{recursive:!0}),await qe(ie,u)},update:async()=>{await We(".windsurf/rules",{recursive:!0}),await qe(ie,u)}};import{readFile as Tt,writeFile as ae}from"fs/promises";d();var b="./.rules",E={exists:()=>a(b),create:async()=>{await ae(b,u)},update:async()=>{if(!await a(b)){await ae(b,u);return}let e=await Tt(b,"utf-8");e.includes(u.trim())||await ae(b,`${e}
125
134
 
126
- ${l}`)}};ae();ce();ue();d();import{execSync as ss}from"child_process";import{readFile as et,unlink as ns,writeFile as os}from"fs/promises";import{parse as tt}from"jsonc-parser";var st=[".eslintrc",".eslintrc.js",".eslintrc.json",".eslintrc.yml",".eslintrc.yaml",".eslintrc.config.js","eslint.config.js","eslint.config.mjs","eslint.config.cjs",".eslintignore"],nt=async()=>{try{let e=await et("package.json","utf-8"),t=tt(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.startsWith("@eslint/")||r==="@typescript-eslint/parser"||r==="@typescript-eslint/eslint-plugin")}catch{return[]}},is=(e,t)=>{if(t.length===0)return;let s=t.join(" ");try{ss(`${e} ${s}`,{stdio:"pipe"})}catch{}},rs=async()=>{let e=[];for(let t of st)if(await i(t))try{await ns(t),e.push(t)}catch{}return e},as=async()=>{let e="./.vscode/settings.json";if(!await i(e))return!1;try{let t=await et(e,"utf-8"),s=tt(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 u of a)u in c&&(delete c[u],n=!0);Object.keys(c).length===0&&delete o["editor.codeActionsOnSave"]}}return n?(await os(e,JSON.stringify(o,null,2)),!0):!1}catch{return!1}},cs=async()=>{if((await nt()).length>0)return!0;for(let t of st)if(await i(t))return!0;return!1},ls=e=>e.startsWith("npm")?"npm uninstall":e.startsWith("yarn")?"yarn remove":e.startsWith("pnpm")?"pnpm remove":e.startsWith("bun")?"bun remove":"npm uninstall",me={hasESLint:cs,remove:async e=>{let t=await nt(),s=ls(e);is(s,t);let n=await rs(),o=await as();return{packagesRemoved:t,filesRemoved:n,vsCodeCleaned:o}}};d();import{execSync as us}from"child_process";import{readFile as ot,unlink as ds,writeFile as ps}from"fs/promises";import{parse as it}from"jsonc-parser";var rt=[".prettierrc",".prettierrc.js",".prettierrc.json",".prettierrc.yml",".prettierrc.yaml",".prettierrc.config.js","prettier.config.js","prettier.config.mjs",".prettierignore"],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("prettier")||r==="eslint-config-prettier"||r==="eslint-plugin-prettier")}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=["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 u=o[a];u&&typeof u=="object"&&"editor.defaultFormatter"in u&&u["editor.defaultFormatter"]==="esbenp.prettier-vscode"&&(delete u["editor.defaultFormatter"],n=!0,Object.keys(u).length===0&&delete o[a])}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",fe={hasPrettier: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}}};d();import{log as ws,select as bs}from"@clack/prompts";var ge=[{hint:"Recommended",label:"pnpm",value:"pnpm add",lockfiles:["pnpm-lock.yaml"],monorepoSuffix:"-w"},{label:"bun",value:"bun add",lockfiles:["bun.lockb","bun.lock"],monorepoSuffix:""},{label:"yarn",value:"yarn add",lockfiles:["yarn.lock"],monorepoSuffix:""},{label:"npm",value:"npm install --legacy-peer-deps",lockfiles:["package-lock.json"],monorepoSuffix:"--workspace ."}],j={get:async()=>{let e=await S();e&&ws.info("Monorepo detected, updating install command to include workspace flag");for(let t of ge){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 S(),t=await bs({initialValue:"pnpm",message:"Which package manager do you use?",options:ge.map(s=>({label:s.label,value:e&&s.monorepoSuffix?`${s.value} ${s.monorepoSuffix}`:s.value}))});return typeof t!="string"?null:t},isMonorepo:S,options:ge};var ct=`
127
- 888 888 888 88888888888 8888888b. d8888 .d8888b. 8888888 88888888888 8888888888
128
- 888 888 888 888 888 Y88b d88888 d88P Y88b 888 888 888
129
- 888 888 888 888 888 888 d88P888 888 888 888 888 888
130
- 888 888 888 888 888 d88P d88P 888 888 888 888 8888888
131
- 888 888 888 888 8888888P" d88P 888 888 888 888 888
132
- 888 888 888 888 888 T88b d88P 888 888 888 888 888 888
133
- Y88b. .d88P 888 888 888 T88b d8888888888 Y88b d88P 888 888 888
134
- "Y88888P" 88888888 888 888 T88b d88P 888 "Y8888P" 8888888 888 8888888888
135
- `;d();import{readFile as vs,writeFile as lt}from"fs/promises";import ks from"deepmerge";import{parse as xs}from"jsonc-parser";var ut={compilerOptions:{strictNullChecks:!0}},_="./tsconfig.json",q={exists:()=>i(_),create:()=>lt(_,JSON.stringify(ut,null,2)),update:async()=>{let e=await vs(_,"utf-8"),s=xs(e)||{},n=ks(s,ut);await lt(_,JSON.stringify(n,null,2))}};var dt=g.devDependencies["@biomejs/biome"],Ss=g.version,Rs=async(e,t=!0)=>{let s=m();if(s.start("Installing dependencies..."),t)Ds(`${e} -D -E ultracite @biomejs/biome@${dt}`);else{let n=await H("package.json","utf8"),o=JSON.parse(n),r={...o,devDependencies:{...o.devDependencies,"@biomejs/biome":dt,ultracite:`^${Ss}`}};await K("package.json",JSON.stringify(r,null,2))}s.stop("Dependencies installed.")},Ps=async()=>{let e=m();if(e.start("Checking for tsconfig.json..."),await q.exists()){e.message("tsconfig.json found, updating..."),await q.update(),e.stop("tsconfig.json updated.");return}e.message("tsconfig.json not found, creating..."),await q.create(),e.stop("tsconfig.json created.")},Fs=async()=>{let e=m();if(e.start("Checking for .vscode/settings.json..."),await F.exists()){e.message("settings.json found, updating..."),await F.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await F.create(),e.stop("settings.json created.")},As=async()=>{let e=m();if(e.start("Checking for .zed/settings.json..."),await $.exists()){e.message("settings.json found, updating..."),await $.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await $.create(),e.stop("settings.json created.")},$s=async()=>{let e=m();if(e.start("Checking for Biome configuration..."),await R.exists()){e.message("Biome configuration found, updating..."),await R.update(),e.stop("Biome configuration updated.");return}e.message("Biome configuration not found, creating..."),await R.create(),e.stop("Biome configuration created.")},Is=async(e,t=!0)=>{let s=m();if(s.start("Initializing pre-commit hooks..."),s.message("Installing Husky..."),t)w.install(e);else{let n=await H("package.json","utf8"),o=JSON.parse(n),r={...o,devDependencies:{...o.devDependencies,husky:"latest"}};await K("package.json",JSON.stringify(r,null,2))}if(await w.exists()){s.message("Pre-commit hook found, updating..."),await w.update(),s.stop("Pre-commit hook updated.");return}s.message("Pre-commit hook not found, creating..."),await w.create(),s.stop("Pre-commit hook created.")},Os=async(e,t=!0)=>{let s=m();if(s.start("Initializing lefthook..."),s.message("Installing lefthook..."),t)v.install(e);else{let n=await H("package.json","utf8"),o=JSON.parse(n),r={...o,devDependencies:{...o.devDependencies,lefthook:"latest"}};await K("package.json",JSON.stringify(r,null,2))}if(await v.exists()){s.message("lefthook.yml found, updating..."),await v.update(),s.stop("lefthook.yml updated.");return}s.message("lefthook.yml not found, creating..."),await v.create(),s.stop("lefthook.yml created.")},Us=async(e,t=!0)=>{let s=m();if(s.start("Initializing lint-staged..."),s.message("Installing lint-staged..."),t)k.install(e);else{let n=await H("package.json","utf8"),o=JSON.parse(n),r={...o,devDependencies:{...o.devDependencies,"lint-staged":"latest"}};await K("package.json",JSON.stringify(r,null,2))}if(await k.exists()){s.message("lint-staged found, updating..."),await k.update(),s.stop("lint-staged updated.");return}s.message("lint-staged not found, creating..."),await k.create(),s.stop("lint-staged created.")},Js=async()=>{let e=m();if(e.start("Checking for GitHub Copilot rules..."),await M.exists()){e.message("GitHub Copilot rules found, updating..."),await M.update(),e.stop("GitHub Copilot rules updated.");return}e.message("GitHub Copilot rules not found, creating..."),await M.create(),e.stop("GitHub Copilot rules created.")},Ms=async()=>{let e=m();if(e.start("Checking for Cursor rules..."),await U.exists()){e.message("Cursor rules found, updating..."),await U.update(),e.stop("Cursor rules updated.");return}e.message("Cursor rules not found, creating..."),await U.create(),e.stop("Cursor rules created.")},Es=async()=>{let e=m();if(e.start("Checking for Windsurf rules..."),await E.exists()){e.message("Windsurf rules found, updating..."),await E.update(),e.stop("Windsurf rules updated.");return}e.message("Windsurf rules not found, creating..."),await E.create(),e.stop("Windsurf rules created.")},Ns=async()=>{let e=m();if(e.start("Checking for Zed rules..."),await N.exists()){e.message("Zed rules found, updating..."),await N.update(),e.stop("Zed rules updated.");return}e.message("Zed rules not found, creating..."),await N.create(),e.stop("Zed rules created.")},zs=async()=>{let e=m();if(e.start("Checking for Claude Code rules..."),await I.exists()){e.message("Claude Code rules found, updating..."),await I.update(),e.stop("Claude Code rules updated.");return}e.message("Claude Code rules not found, creating..."),await I.create(),e.stop("Claude Code rules created.")},Ts=async()=>{let e=m();if(e.start("Checking for OpenAI Codex rules..."),await O.exists()){e.message("OpenAI Codex rules found, updating..."),await O.update(),e.stop("OpenAI Codex rules updated.");return}e.message("OpenAI Codex rules not found, creating..."),await O.create(),e.stop("OpenAI Codex rules created.")},Ws=async()=>{let e=m();if(e.start("Checking for Kiro IDE steering files..."),await J.exists()){e.message("Kiro IDE steering files found, updating..."),await J.update(),e.stop("Kiro IDE steering files updated.");return}e.message("Kiro IDE steering files not found, creating..."),await J.create(),e.stop("Kiro IDE steering files created.")},Ls=async e=>{let t=m();t.start("Removing Prettier dependencies and configuration...");try{let s=await fe.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...")}},_s=async e=>{let t=m();t.start("Removing ESLint dependencies and configuration...");try{let s=await me.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...")}},qs=async e=>{if(e){let n=j.options.find(r=>r.label===e);if(!n)throw new Error(`Unsupported package manager: ${e}`);return await j.isMonorepo()&&n.monorepoSuffix?`${n.value} ${n.monorepoSuffix}`:n.value}let t=await j.get();if(t)return he.info(`Detected lockfile, using ${t}`),t;let s=await j.select();if(!s)throw new Error("No package manager selected");return s},pt=async e=>{Cs(ct);try{let t=e??{},s=await qs(t.pm),n=t.removePrettier,o=t.removeEslint;if(n===void 0||o===void 0){let u=[];if(n===void 0&&await fe.hasPrettier()&&u.push({label:"Remove Prettier (dependencies, config files, VS Code settings)",value:"prettier"}),o===void 0&&await me.hasESLint()&&u.push({label:"Remove ESLint (dependencies, config files, VS Code settings)",value:"eslint"}),u.length>0){let C=await B({message:"Remove existing formatters/linters (recommended for clean migration)?",options:u,required:!1});n===void 0&&(n=C.includes("prettier")),o===void 0&&(o=C.includes("eslint"))}}let r=t.editors;r||(r=await B({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 B({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}));let a=t.features;a===void 0&&(t.pm||t.editors||t.rules||t.removePrettier!==void 0||t.removeEslint!==void 0?a=[]:a=await B({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 Ls(s),o&&await _s(s),await Rs(s,!t.skipInstall),await Ps(),await $s(),r?.includes("vscode")&&await Fs(),r?.includes("zed")&&await As(),c?.includes("vscode-copilot")&&await Js(),c?.includes("cursor")&&await Ms(),c?.includes("windsurf")&&await Es(),c?.includes("zed")&&await Ns(),c?.includes("claude")&&await zs(),c?.includes("codex")&&await Ts(),c?.includes("kiro")&&await Ws(),a?.includes("husky")&&await Is(s,!t.skipInstall),a?.includes("lefthook")&&await Os(s,!t.skipInstall),a?.includes("lint-staged")&&await Us(s,!t.skipInstall),he.success("Successfully initialized Ultracite configuration!")}catch(t){let s=t instanceof Error?t.message:"Unknown error";he.error(`Failed to initialize Ultracite configuration: ${s}`),js.exit(1)}};var V=Hs.initTRPC.meta().create(),Ks=V.router({init:V.procedure.meta({description:"Initialize Ultracite in the current directory"}).input(p.object({pm:p.enum(["pnpm","bun","yarn","npm"]).optional().describe("Package manager to use"),editors:p.array(p.enum(["vscode","zed"])).optional().describe("Editors to configure"),rules:p.array(p.enum(["vscode-copilot","cursor","windsurf","zed","claude","codex","kiro"])).optional().describe("Editor rules to enable"),features:p.array(p.enum(["husky","lefthook","lint-staged"])).optional().describe("Additional features to enable"),removePrettier:p.boolean().optional().describe("Remove Prettier dependencies and configuration"),removeEslint:p.boolean().optional().describe("Remove ESLint dependencies and configuration"),skipInstall:p.boolean().default(!1).describe("Skip installing dependencies")})).mutation(async({input:e})=>{await pt(e)}),lint:V.procedure.meta({description:"Run Biome linter without fixing files"}).input(p.array(p.string()).optional().default([]).describe("specific files to lint")).query(({input:e})=>{be(e)}),format:V.procedure.meta({description:"Run Biome linter and fixes files"}).input(p.tuple([p.array(p.string()).optional().default([]).describe("specific files to format"),p.object({unsafe:p.boolean().optional().describe("apply unsafe fixes")})])).mutation(({input:e})=>{let[t,s]=e;we(t,{unsafe:s.unsafe})})}),Vs=Bs({router:Ks,name:"ultracite",version:g.version,description:"Ship code faster and with more confidence."});process.env.VITEST||Vs.run();
135
+ ${u}`)}};re();ce();ue();d();import{readFile as et,unlink as rs,writeFile as cs}from"fs/promises";import{parse as tt}from"jsonc-parser";import{removeDependency as ls}from"nypm";var st=[".eslintrc",".eslintrc.js",".eslintrc.json",".eslintrc.yml",".eslintrc.yaml",".eslintrc.config.js","eslint.config.js","eslint.config.mjs","eslint.config.cjs",".eslintignore"],nt=async()=>{try{let e=await et("package.json","utf-8"),t=tt(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(i=>i.startsWith("eslint")||i.startsWith("@eslint/")||i==="@typescript-eslint/parser"||i==="@typescript-eslint/eslint-plugin")}catch{return[]}},us=async(e,t)=>{if(t.length!==0)try{for(let s of t)await ls(s,{packageManager:e})}catch{}},ds=async()=>{let e=[];for(let t of st)if(await a(t))try{await rs(t),e.push(t)}catch{}return e},ps=async()=>{let e="./.vscode/settings.json";if(!await a(e))return!1;try{let t=await et(e,"utf-8"),s=tt(t);if(!s||typeof s!="object")return!1;let n=!1,o={...s},i=["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 r of i)r in o&&(delete o[r],n=!0);if("editor.codeActionsOnSave"in o){let r=o["editor.codeActionsOnSave"];if(r&&typeof r=="object"){let c=["source.fixAll.eslint","source.organizeImports.eslint"];for(let l of c)l in r&&(delete r[l],n=!0);Object.keys(r).length===0&&delete o["editor.codeActionsOnSave"]}}return n?(await cs(e,JSON.stringify(o,null,2)),!0):!1}catch{return!1}},ms=async()=>{if((await nt()).length>0)return!0;for(let t of st)if(await a(t))return!0;return!1},me={hasESLint:ms,remove:async e=>{let t=await nt();us(e,t);let s=await ds(),n=await ps();return{packagesRemoved:t,filesRemoved:s,vsCodeCleaned:n}}};d();import{readFile as ot,unlink as fs,writeFile as gs}from"fs/promises";import{parse as it}from"jsonc-parser";import{removeDependency as hs}from"nypm";var at=[".prettierrc",".prettierrc.js",".prettierrc.json",".prettierrc.yml",".prettierrc.yaml",".prettierrc.config.js","prettier.config.js","prettier.config.mjs",".prettierignore"],rt=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(i=>i.startsWith("prettier")||i==="eslint-config-prettier"||i==="eslint-plugin-prettier")}catch{return[]}},ys=async(e,t)=>{if(t.length!==0)try{for(let s of t)await hs(s,{packageManager:e})}catch{}},ws=async()=>{let e=[];for(let t of at)if(await a(t))try{await fs(t),e.push(t)}catch{}return e},bs=async()=>{let e="./.vscode/settings.json";if(!await a(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},i=["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 i)c in o&&(c==="editor.defaultFormatter"&&o[c]==="esbenp.prettier-vscode"||c!=="editor.defaultFormatter")&&(delete o[c],n=!0);let r=Object.keys(o).filter(c=>c.startsWith("[")&&c.includes("javascript"));for(let c of r){let l=o[c];l&&typeof l=="object"&&"editor.defaultFormatter"in l&&l["editor.defaultFormatter"]==="esbenp.prettier-vscode"&&(delete l["editor.defaultFormatter"],n=!0,Object.keys(l).length===0&&delete o[c])}return n?(await gs(e,JSON.stringify(o,null,2)),!0):!1}catch{return!1}},ks=async()=>{if((await rt()).length>0)return!0;for(let t of at)if(await a(t))return!0;return!1},fe={hasPrettier:ks,remove:async e=>{let t=await rt();ys(e,t);let s=await ws(),n=await bs();return{packagesRemoved:t,filesRemoved:s,vsCodeCleaned:n}}};d();import{readFile as vs,writeFile as ct}from"fs/promises";import xs from"deepmerge";import{parse as Ds}from"jsonc-parser";var lt={compilerOptions:{strictNullChecks:!0}},L="./tsconfig.json",W={exists:()=>a(L),create:()=>ct(L,JSON.stringify(lt,null,2)),update:async()=>{let e=await vs(L,"utf-8"),s=Ds(e)||{},n=xs(s,lt);await ct(L,JSON.stringify(n,null,2))}};d();var dt=f.devDependencies["@biomejs/biome"],pt=f.version,Ss=async(e,t=!0)=>{let s=m();s.start("Installing dependencies...");let n=[`ultracite@${pt}`,`@biomejs/biome@${dt}`];if(t)for(let o of n)await js(o,{packageManager:e,workspace:await g()});else{let o=await H("package.json","utf8"),i=JSON.parse(o),r={...i,devDependencies:{...i.devDependencies,"@biomejs/biome":dt,ultracite:`^${pt}`}};await K("package.json",JSON.stringify(r,null,2))}s.stop("Dependencies installed.")},Rs=async()=>{let e=m();if(e.start("Checking for tsconfig.json..."),await W.exists()){e.message("tsconfig.json found, updating..."),await W.update(),e.stop("tsconfig.json updated.");return}e.message("tsconfig.json not found, creating..."),await W.create(),e.stop("tsconfig.json created.")},Fs=async()=>{let e=m();if(e.start("Checking for .vscode/settings.json..."),await F.exists()){e.message("settings.json found, updating..."),await F.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await F.create(),e.stop("settings.json created.")},Ns=async()=>{let e=m();if(e.start("Checking for .zed/settings.json..."),await M.exists()){e.message("settings.json found, updating..."),await M.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await M.create(),e.stop("settings.json created.")},Ms=async()=>{let e=m();if(e.start("Checking for Biome configuration..."),await S.exists()){e.message("Biome configuration found, updating..."),await S.update(),e.stop("Biome configuration updated.");return}e.message("Biome configuration not found, creating..."),await S.create(),e.stop("Biome configuration created.")},As=async(e,t=!0)=>{let s=m();if(s.start("Initializing pre-commit hooks..."),s.message("Installing Husky..."),t)await k.install(e);else{let n=await H("package.json","utf8"),o=JSON.parse(n),i={...o,devDependencies:{...o.devDependencies,husky:"latest"}};await K("package.json",JSON.stringify(i,null,2))}if(await k.exists()){s.message("Pre-commit hook found, updating..."),await k.update(e),s.stop("Pre-commit hook updated.");return}s.message("Pre-commit hook not found, creating..."),await k.create(e),s.stop("Pre-commit hook created.")},Is=async(e,t=!0)=>{let s=m();if(s.start("Initializing lefthook..."),s.message("Installing lefthook..."),t)await x.install(e);else{let n=await H("package.json","utf8"),o=JSON.parse(n),i={...o,devDependencies:{...o.devDependencies,lefthook:"latest"}};await K("package.json",JSON.stringify(i,null,2))}if(await x.exists()){s.message("lefthook.yml found, updating..."),await x.update(e),s.stop("lefthook.yml updated.");return}s.message("lefthook.yml not found, creating..."),await x.create(e),s.stop("lefthook.yml created.")},Os=async(e,t=!0)=>{let s=m();if(s.start("Initializing lint-staged..."),s.message("Installing lint-staged..."),t)await D.install(e);else{let n=await H("package.json","utf8"),o=JSON.parse(n),i={...o,devDependencies:{...o.devDependencies,"lint-staged":"latest"}};await K("package.json",JSON.stringify(i,null,2))}if(await D.exists()){s.message("lint-staged found, updating..."),await D.update(e),s.stop("lint-staged updated.");return}s.message("lint-staged not found, creating..."),await D.create(e),s.stop("lint-staged created.")},Us=async()=>{let e=m();if(e.start("Checking for GitHub Copilot rules..."),await J.exists()){e.message("GitHub Copilot rules found, updating..."),await J.update(),e.stop("GitHub Copilot rules updated.");return}e.message("GitHub Copilot rules not found, creating..."),await J.create(),e.stop("GitHub Copilot rules created.")},Js=async()=>{let e=m();if(e.start("Checking for Cursor rules..."),await O.exists()){e.message("Cursor rules found, updating..."),await O.update(),e.stop("Cursor rules updated.");return}e.message("Cursor rules not found, creating..."),await O.create(),e.stop("Cursor rules created.")},$s=async()=>{let e=m();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.")},Es=async()=>{let e=m();if(e.start("Checking for Zed rules..."),await E.exists()){e.message("Zed rules found, updating..."),await E.update(),e.stop("Zed rules updated.");return}e.message("Zed rules not found, creating..."),await E.create(),e.stop("Zed rules created.")},zs=async()=>{let e=m();if(e.start("Checking for Claude Code rules..."),await A.exists()){e.message("Claude Code rules found, updating..."),await A.update(),e.stop("Claude Code rules updated.");return}e.message("Claude Code rules not found, creating..."),await A.create(),e.stop("Claude Code rules created.")},Ts=async()=>{let e=m();if(e.start("Checking for OpenAI Codex rules..."),await I.exists()){e.message("OpenAI Codex rules found, updating..."),await I.update(),e.stop("OpenAI Codex rules updated.");return}e.message("OpenAI Codex rules not found, creating..."),await I.create(),e.stop("OpenAI Codex rules created.")},_s=async()=>{let e=m();if(e.start("Checking for Kiro IDE steering files..."),await U.exists()){e.message("Kiro IDE steering files found, updating..."),await U.update(),e.stop("Kiro IDE steering files updated.");return}e.message("Kiro IDE steering files not found, creating..."),await U.create(),e.stop("Kiro IDE steering files created.")},Ls=async e=>{let t=m();t.start("Removing Prettier dependencies and configuration...");try{let s=await fe.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...")}},Ws=async e=>{let t=m();t.start("Removing ESLint dependencies and configuration...");try{let s=await me.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...")}},mt=async e=>{Cs(we);try{let t=e??{},{pm:s}=t;if(!s){let l=await Ps(ut.cwd());if(!l)throw new Error("No package manager specified or detected");if(l.warnings)for(let w of l.warnings)q.warn(w);q.info(`Detected lockfile, using ${l.name}`),s=l.name}let n=t.removePrettier,o=t.removeEslint;if(n===void 0||o===void 0){let l=[];if(n===void 0&&await fe.hasPrettier()&&l.push({label:"Remove Prettier (dependencies, config files, VS Code settings)",value:"prettier"}),o===void 0&&await me.hasESLint()&&l.push({label:"Remove ESLint (dependencies, config files, VS Code settings)",value:"eslint"}),l.length>0){let w=await B({message:"Remove existing formatters/linters (recommended for clean migration)?",options:l,required:!1});n===void 0&&(n=w.includes("prettier")),o===void 0&&(o=w.includes("eslint"))}}let i=t.editors;i||(i=await B({message:"Which editors do you want to configure (recommended)?",options:[{label:"VSCode / Cursor / Windsurf",value:"vscode"},{label:"Zed",value:"zed"}],required:!1}));let r=t.rules;r||(r=await B({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}));let c=t.features;c===void 0&&(t.pm||t.editors||t.rules||t.removePrettier!==void 0||t.removeEslint!==void 0?c=[]:c=await B({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 Ls(s),o&&await Ws(s),await Ss(s,!t.skipInstall),await Rs(),await Ms(),i?.includes("vscode")&&await Fs(),i?.includes("zed")&&await Ns(),r?.includes("vscode-copilot")&&await Us(),r?.includes("cursor")&&await Js(),r?.includes("windsurf")&&await $s(),r?.includes("zed")&&await Es(),r?.includes("claude")&&await zs(),r?.includes("codex")&&await Ts(),r?.includes("kiro")&&await _s(),c?.includes("husky")&&await As(s,!t.skipInstall),c?.includes("lefthook")&&await Is(s,!t.skipInstall),c?.includes("lint-staged")&&await Os(s,!t.skipInstall),q.success("Successfully initialized Ultracite configuration!")}catch(t){let s=t instanceof Error?t.message:"Unknown error";q.error(`Failed to initialize Ultracite configuration: ${s}`),ut.exit(1)}};d();var V=Bs.initTRPC.meta().create(),Hs=V.router({init:V.procedure.meta({description:"Initialize Ultracite in the current directory"}).input(p.object({pm:p.enum(j.packageManagers).optional().describe("Package manager to use"),editors:p.array(p.enum(j.editorConfigs)).optional().describe("Editors to configure"),rules:p.array(p.enum(j.editorRules)).optional().describe("Editor rules to enable"),features:p.array(p.enum(j.integrations)).optional().describe("Additional features to enable"),removePrettier:p.boolean().optional().describe("Remove Prettier dependencies and configuration"),removeEslint:p.boolean().optional().describe("Remove ESLint dependencies and configuration"),skipInstall:p.boolean().default(!1).describe("Skip installing dependencies")})).mutation(async({input:e})=>{await mt(e)}),lint:V.procedure.meta({description:"Run Biome linter without fixing files"}).input(p.array(p.string()).optional().default([]).describe("specific files to lint")).query(({input:e})=>{ye(e)}),format:V.procedure.meta({description:"Run Biome linter and fixes files"}).input(p.tuple([p.array(p.string()).optional().default([]).describe("specific files to format"),p.object({unsafe:p.boolean().optional().describe("apply unsafe fixes")})])).mutation(({input:e})=>{let[t,s]=e;he(t,{unsafe:s.unsafe})})}),Ks=qs({router:Hs,name:f.name,version:f.version,description:f.description});process.env.VITEST||Ks.run();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ultracite",
3
3
  "description": "The AI-ready formatter that helps you write and generate code faster.",
4
- "version": "5.1.9",
4
+ "version": "5.2.0",
5
5
  "bin": {
6
6
  "ultracite": "dist/index.js"
7
7
  },
@@ -48,6 +48,7 @@
48
48
  "@clack/prompts": "^0.11.0",
49
49
  "deepmerge": "^4.3.1",
50
50
  "jsonc-parser": "^3.3.1",
51
+ "nypm": "^0.6.1",
51
52
  "trpc-cli": "^0.10.0",
52
53
  "vitest": "^3.2.4",
53
54
  "zod": "^4.0.5"