ultracite 5.5.5 → 5.6.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/biome.jsonc CHANGED
@@ -1,4 +1,5 @@
1
1
  {
2
+ "root": false,
2
3
  "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3
4
  "files": {
4
5
  "ignoreUnknown": true,
package/dist/index.js CHANGED
@@ -117,12 +117,18 @@ ${n}`)}}});var os,le=C(()=>{os=me({"./husky.ts":()=>(re(),Q(Be)),"./lefthook.ts"
117
117
  `}else t+=`${s}: '${n}'
118
118
  `;return t},us=async()=>{try{let e=pe(await B("./package.json","utf-8"));return e?e.type==="module":!1}catch{return!1}},ps=async e=>{let t=pe(await B("./package.json","utf-8"));t&&(t["lint-staged"]?t["lint-staged"]=F(t["lint-staged"],h(e)):t["lint-staged"]=h(e),await b("./package.json",JSON.stringify(t,null,2)))},ms=async(e,t)=>{let s=await B(e,"utf-8"),n=pe(s);if(!n)return;let o=F(n,h(t));await b(e,JSON.stringify(o,null,2))},fs=async(e,t)=>{let s=await B(e,"utf-8"),n=ls(s);if(!n)return;let o=F(n,h(t));await b(e,ds(o))},gs=async(e,t)=>{let o=(await import(is(e).href)).default||{},i=F(o,h(t)),r=`export default ${JSON.stringify(i,null,2)};
119
119
  `;await b(e,r)},hs=async(e,t)=>{delete K.cache[K.resolve(`./${e}`)];let s=os(`./${e}`),n=F(s,h(t)),o=`module.exports = ${JSON.stringify(n,null,2)};
120
- `;await b(e,o)},ue=async e=>{await b(".lintstagedrc.json",JSON.stringify(h(e),null,2))},ys=async(e,t)=>{if(e==="./package.json"){await ps(t);return}if(e.endsWith(".json")||e==="./.lintstagedrc"){await ms(e,t);return}if(e.endsWith(".yaml")||e.endsWith(".yml")){await fs(e,t);return}let s=await us();if(e.endsWith(".mjs")||e.endsWith(".js")&&s){try{await gs(e,t)}catch{await ue(t)}return}if(e.endsWith(".cjs")||e.endsWith(".js")&&!s)try{await hs(e,t)}catch{await ue(t)}},D={exists:async()=>{for(let e of Xe)if(await a(e))return!0;return!1},install:async e=>{await as("lint-staged",{packageManager:e,workspace:await g()})},create:async e=>{await b(".lintstagedrc.json",JSON.stringify(h(e),null,2))},update:async e=>{let t=null;for(let s of Xe)if(await a(s)){t=s;break}if(!t){await ue(e);return}await ys(t,e)}}});import{initTRPC as Is}from"@trpc/server";import{createCli as Us}from"trpc-cli";import c from"zod";var y={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"5.5.4",type:"module",bin:{ultracite:"dist/index.js"},files:["biome.jsonc","dist"],scripts:{build:"tsup",test:"vitest run","test:coverage":"vitest run --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.5","@types/node":"^24.5.2","@vitest/coverage-v8":"3.2.4",tsup:"^8.5.0"},dependencies:{"@clack/prompts":"^0.11.0","@trpc/server":"^11.5.1",deepmerge:"^4.3.1","jsonc-parser":"^3.3.1",nypm:"^0.6.2","trpc-cli":"^0.11.0",vitest:"^3.2.4",zod:"^4.1.11"},packageManager:"pnpm@10.17.0"};p();import{spawnSync as pt}from"child_process";import he from"process";var ee=e=>{let t=["npx","@biomejs/biome","check","--no-errors-on-unmatched"];e.length>0?t.push(...N(e)):t.push("./");let s=t.join(" "),n=pt(s,{stdio:"inherit",shell:!0});n.error&&(console.error("Failed to run Ultracite:",n.error.message),he.exit(1)),n.status!==0&&he.exit(n.status??1)};import{spawnSync as Pt}from"child_process";import{existsSync as P}from"fs";import{readFile as De}from"fs/promises";import{join as R}from"path";import{parse as Rt}from"jsonc-parser";p();import{readFile as ye,unlink as mt,writeFile as ft}from"fs/promises";import{parse as we}from"jsonc-parser";import{removeDependency as gt}from"nypm";var I=[".eslintrc",".eslintrc.js",".eslintrc.json",".eslintrc.yml",".eslintrc.yaml",".eslintrc.config.js","eslint.config.js","eslint.config.mjs","eslint.config.cjs",".eslintignore"],be=async()=>{try{let e=await ye("package.json","utf-8"),t=we(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(i=>i.includes("eslint"))}catch{return[]}},ht=async(e,t)=>{if(t.length!==0)try{for(let s of t)await gt(s,{packageManager:e})}catch(s){console.warn(s)}},yt=async()=>{let e=[];for(let t of I)if(await a(t))try{await mt(t),e.push(t)}catch(s){console.warn(s)}return e},wt=async()=>{let e="./.vscode/settings.json";if(!await a(e))return!1;try{let t=await ye(e,"utf-8"),s=we(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&&(o["editor.codeActionsOnSave"]=void 0)}}return n?(await ft(e,JSON.stringify(o,null,2)),!0):!1}catch(t){return console.warn(t),!1}},bt=async()=>{if((await be()).length>0)return!0;for(let t of I)if(await a(t))return!0;return!1},te={hasEsLint:bt,remove:async e=>{let t=await be();await ht(e,t);let s=await yt(),n=await wt();return{packagesRemoved:t,filesRemoved:s,vsCodeCleaned:n}}};p();import{readFile as ke,unlink as kt,writeFile as vt}from"fs/promises";import{parse as ve}from"jsonc-parser";import{removeDependency as xt}from"nypm";var U=[".prettierrc",".prettierrc.js",".prettierrc.json",".prettierrc.yml",".prettierrc.yaml",".prettierrc.config.js","prettier.config.js","prettier.config.mjs",".prettierignore"],xe=async()=>{try{let e=await ke("package.json","utf-8"),t=ve(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(i=>i.includes("prettier"))}catch{return[]}},Dt=async(e,t)=>{if(t.length!==0)try{for(let s of t)await xt(s,{packageManager:e})}catch(s){console.warn(s)}},jt=async()=>{let e=[];for(let t of U)if(await a(t))try{await kt(t),e.push(t)}catch(s){console.warn(s)}return e},Ct=async()=>{let e="./.vscode/settings.json";if(!await a(e))return!1;try{let t=await ke(e,"utf-8"),s=ve(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"&&(u["editor.defaultFormatter"]=void 0,n=!0,Object.keys(u).length===0&&delete o[l])}return n?(await vt(e,JSON.stringify(o,null,2)),!0):!1}catch(t){return console.warn(t),!1}},St=async()=>{if((await xe()).length>0)return!0;for(let t of U)if(await a(t))return!0;return!1},se={hasPrettier:St,remove:async e=>{let t=await xe();await Dt(e,t);let s=await jt(),n=await Ct();return{packagesRemoved:t,filesRemoved:s,vsCodeCleaned:n}}};var At=()=>{let e=Pt("npx @biomejs/biome --version",{shell:!0,encoding:"utf-8"});return e.status===0&&e.stdout?{name:"Biome installation",status:"pass",message:`Biome is installed (${e.stdout.trim()})`}:{name:"Biome installation",status:"fail",message:"Biome is not installed or not accessible"}},Mt=async()=>{let e=R(process.cwd(),"biome.json"),t=R(process.cwd(),"biome.jsonc"),s=null;if(P(e)?s=e:P(t)&&(s=t),!s)return{name:"Biome configuration",status:"fail",message:"No biome.json or biome.jsonc file found"};try{let n=await De(s,"utf-8"),o=Rt(n);return Array.isArray(o?.extends)&&o.extends.includes("ultracite")?{name:"Biome configuration",status:"pass",message:"biome.json(c) extends ultracite"}:{name:"Biome configuration",status:"warn",message:"biome.json(c) exists but doesn't extend ultracite"}}catch{return{name:"Biome configuration",status:"fail",message:"Could not parse biome.json(c) file"}}},Et=async()=>{let e=R(process.cwd(),"package.json");if(!P(e))return{name:"Ultracite dependency",status:"warn",message:"No package.json found"};try{let t=JSON.parse(await De(e,"utf-8")),s=t.dependencies?.ultracite||t.devDependencies?.ultracite||t.peerDependencies?.ultracite;return s?{name:"Ultracite dependency",status:"pass",message:`Ultracite is in package.json (${s})`}:{name:"Ultracite dependency",status:"warn",message:"Ultracite not found in package.json dependencies"}}catch{return{name:"Ultracite dependency",status:"warn",message:"Could not parse package.json"}}},$t=()=>{let e=U.some(s=>P(R(process.cwd(),s))),t=I.some(s=>P(R(process.cwd(),s)));if(e||t){let s=[];return e&&s.push("Prettier"),t&&s.push("ESLint"),{name:"Conflicting tools",status:"warn",message:`Found potentially conflicting tools: ${s.join(", ")}`}}return{name:"Conflicting tools",status:"pass",message:"No conflicting formatting/linting tools found"}},je=async()=>{let e=[];console.log(`\u{1FA7A} Running Ultracite doctor...
120
+ `;await b(e,o)},ue=async e=>{await b(".lintstagedrc.json",JSON.stringify(h(e),null,2))},ys=async(e,t)=>{if(e==="./package.json"){await ps(t);return}if(e.endsWith(".json")||e==="./.lintstagedrc"){await ms(e,t);return}if(e.endsWith(".yaml")||e.endsWith(".yml")){await fs(e,t);return}let s=await us();if(e.endsWith(".mjs")||e.endsWith(".js")&&s){try{await gs(e,t)}catch{await ue(t)}return}if(e.endsWith(".cjs")||e.endsWith(".js")&&!s)try{await hs(e,t)}catch{await ue(t)}},D={exists:async()=>{for(let e of Xe)if(await a(e))return!0;return!1},install:async e=>{await as("lint-staged",{packageManager:e,workspace:await g()})},create:async e=>{await b(".lintstagedrc.json",JSON.stringify(h(e),null,2))},update:async e=>{let t=null;for(let s of Xe)if(await a(s)){t=s;break}if(!t){await ue(e);return}await ys(t,e)}}});import{initTRPC as Is}from"@trpc/server";import{createCli as Us}from"trpc-cli";import c from"zod";var y={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"5.6.0",type:"module",bin:{ultracite:"dist/index.js"},files:["biome.jsonc","dist"],scripts:{build:"tsup",test:"vitest run","test:coverage":"vitest run --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:{"@biomejs/biome":"2.2.5","@types/node":"^24.5.2","@vitest/coverage-v8":"3.2.4",tsup:"^8.5.0",turbo:"^2.5.8"},dependencies:{"@clack/prompts":"^0.11.0","@trpc/server":"^11.5.1",deepmerge:"^4.3.1","jsonc-parser":"^3.3.1",nypm:"^0.6.2","trpc-cli":"^0.11.0",vitest:"^3.2.4",zod:"^4.1.11"},packageManager:"pnpm@10.17.0"};p();import{spawnSync as pt}from"child_process";import he from"process";var ee=e=>{let t=["npx","@biomejs/biome","check","--no-errors-on-unmatched"];e.length>0?t.push(...N(e)):t.push("./");let s=t.join(" "),n=pt(s,{stdio:"inherit",shell:!0});n.error&&(console.error("Failed to run Ultracite:",n.error.message),he.exit(1)),n.status!==0&&he.exit(n.status??1)};import{spawnSync as Pt}from"child_process";import{existsSync as P}from"fs";import{readFile as De}from"fs/promises";import{join as R}from"path";import{parse as Rt}from"jsonc-parser";p();import{readFile as ye,unlink as mt,writeFile as ft}from"fs/promises";import{parse as we}from"jsonc-parser";import{removeDependency as gt}from"nypm";var I=[".eslintrc",".eslintrc.js",".eslintrc.json",".eslintrc.yml",".eslintrc.yaml",".eslintrc.config.js","eslint.config.js","eslint.config.mjs","eslint.config.cjs",".eslintignore"],be=async()=>{try{let e=await ye("package.json","utf-8"),t=we(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(i=>i.includes("eslint"))}catch{return[]}},ht=async(e,t)=>{if(t.length!==0)try{for(let s of t)await gt(s,{packageManager:e})}catch(s){console.warn(s)}},yt=async()=>{let e=[];for(let t of I)if(await a(t))try{await mt(t),e.push(t)}catch(s){console.warn(s)}return e},wt=async()=>{let e="./.vscode/settings.json";if(!await a(e))return!1;try{let t=await ye(e,"utf-8"),s=we(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&&(o["editor.codeActionsOnSave"]=void 0)}}return n?(await ft(e,JSON.stringify(o,null,2)),!0):!1}catch(t){return console.warn(t),!1}},bt=async()=>{if((await be()).length>0)return!0;for(let t of I)if(await a(t))return!0;return!1},te={hasEsLint:bt,remove:async e=>{let t=await be();await ht(e,t);let s=await yt(),n=await wt();return{packagesRemoved:t,filesRemoved:s,vsCodeCleaned:n}}};p();import{readFile as ke,unlink as kt,writeFile as vt}from"fs/promises";import{parse as ve}from"jsonc-parser";import{removeDependency as xt}from"nypm";var U=[".prettierrc",".prettierrc.js",".prettierrc.json",".prettierrc.yml",".prettierrc.yaml",".prettierrc.config.js","prettier.config.js","prettier.config.mjs",".prettierignore"],xe=async()=>{try{let e=await ke("package.json","utf-8"),t=ve(e);if(!t||typeof t!="object")return[];let s=t.dependencies||{},n=t.devDependencies||{},o={...s,...n};return Object.keys(o).filter(i=>i.includes("prettier"))}catch{return[]}},Dt=async(e,t)=>{if(t.length!==0)try{for(let s of t)await xt(s,{packageManager:e})}catch(s){console.warn(s)}},jt=async()=>{let e=[];for(let t of U)if(await a(t))try{await kt(t),e.push(t)}catch(s){console.warn(s)}return e},Ct=async()=>{let e="./.vscode/settings.json";if(!await a(e))return!1;try{let t=await ke(e,"utf-8"),s=ve(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"&&(u["editor.defaultFormatter"]=void 0,n=!0,Object.keys(u).length===0&&delete o[l])}return n?(await vt(e,JSON.stringify(o,null,2)),!0):!1}catch(t){return console.warn(t),!1}},St=async()=>{if((await xe()).length>0)return!0;for(let t of U)if(await a(t))return!0;return!1},se={hasPrettier:St,remove:async e=>{let t=await xe();await Dt(e,t);let s=await jt(),n=await Ct();return{packagesRemoved:t,filesRemoved:s,vsCodeCleaned:n}}};var At=()=>{let e=Pt("npx @biomejs/biome --version",{shell:!0,encoding:"utf-8"});return e.status===0&&e.stdout?{name:"Biome installation",status:"pass",message:`Biome is installed (${e.stdout.trim()})`}:{name:"Biome installation",status:"fail",message:"Biome is not installed or not accessible"}},Mt=async()=>{let e=R(process.cwd(),"biome.json"),t=R(process.cwd(),"biome.jsonc"),s=null;if(P(e)?s=e:P(t)&&(s=t),!s)return{name:"Biome configuration",status:"fail",message:"No biome.json or biome.jsonc file found"};try{let n=await De(s,"utf-8"),o=Rt(n);return Array.isArray(o?.extends)&&o.extends.includes("ultracite")?{name:"Biome configuration",status:"pass",message:"biome.json(c) extends ultracite"}:{name:"Biome configuration",status:"warn",message:"biome.json(c) exists but doesn't extend ultracite"}}catch{return{name:"Biome configuration",status:"fail",message:"Could not parse biome.json(c) file"}}},Et=async()=>{let e=R(process.cwd(),"package.json");if(!P(e))return{name:"Ultracite dependency",status:"warn",message:"No package.json found"};try{let t=JSON.parse(await De(e,"utf-8")),s=t.dependencies?.ultracite||t.devDependencies?.ultracite||t.peerDependencies?.ultracite;return s?{name:"Ultracite dependency",status:"pass",message:`Ultracite is in package.json (${s})`}:{name:"Ultracite dependency",status:"warn",message:"Ultracite not found in package.json dependencies"}}catch{return{name:"Ultracite dependency",status:"warn",message:"Could not parse package.json"}}},$t=()=>{let e=U.some(s=>P(R(process.cwd(),s))),t=I.some(s=>P(R(process.cwd(),s)));if(e||t){let s=[];return e&&s.push("Prettier"),t&&s.push("ESLint"),{name:"Conflicting tools",status:"warn",message:`Found potentially conflicting tools: ${s.join(", ")}`}}return{name:"Conflicting tools",status:"pass",message:"No conflicting formatting/linting tools found"}},je=async()=>{let e=[];console.log(`\u{1FA7A} Running Ultracite doctor...
121
121
  `),e.push(At()),e.push(await Mt()),e.push(await Et()),e.push($t());let t=e.filter(o=>o.status==="pass").length,s=e.filter(o=>o.status==="fail").length,n=e.filter(o=>o.status==="warn").length;for(let o of e){let i;o.status==="pass"?i="\u2705":o.status==="fail"?i="\u274C":i="\u26A0\uFE0F",console.log(`${i} ${o.name}: ${o.message}`)}console.log(`
122
122
  \u{1F4CA} Summary:`),console.log(` ${t} passed, ${n} warnings, ${s} failed`),s>0&&(console.log(`
123
123
  \u{1F4A1} To fix issues, run: npx ultracite init`),process.exit(1)),n>0?console.log(`
124
124
  \u{1F4A1} Some optional improvements available. Run 'npx ultracite init' to configure.`):console.log(`
125
- \u2728 Everything looks good!`)};p();import{spawnSync as Ft}from"child_process";import Ce from"process";var ne=(e,t={})=>{let s=["npx","@biomejs/biome","check","--write","--no-errors-on-unmatched"];t.unsafe&&s.push("--unsafe"),e.length>0?s.push(...N(e)):s.push("./");let n=s.join(" "),o=Ft(n,{stdio:"inherit",shell:!0});o.error&&(console.error("Failed to run Ultracite:",o.error.message),Ce.exit(1)),o.status!==0&&Ce.exit(o.status??1)};import{packageManagers as Nt}from"nypm";var A={packageManagers:Nt.map(e=>e.name),editorConfigs:["vscode","zed"],editorRules:["vscode-copilot","cursor","windsurf","zed","claude","codex","kiro","cline","amp","aider","firebase-studio","open-hands","gemini-cli","junie","augmentcode","kilo-code","goose"],integrations:["husky","lefthook","lint-staged"]};import j from"process";import{cancel as W,intro as vs,isCancel as H,log as V,multiselect as X,spinner as m}from"@clack/prompts";import{addDevDependency as xs,detectPackageManager as Ds}from"nypm";p();import{readFile as It,writeFile as Se}from"fs/promises";import Ut from"deepmerge";import{parse as Tt}from"jsonc-parser";var Pe={$schema:"./node_modules/@biomejs/biome/configuration_schema.json",extends:["ultracite"]},oe=async()=>await a("./biome.json")?"./biome.json":"./biome.jsonc",T={exists:async()=>{let e=await oe();return a(e)},create:async()=>{let e=await oe();return Se(e,JSON.stringify(Pe,null,2))},update:async()=>{let e=await oe(),t=await It(e,"utf-8"),n=Tt(t)||{},o=n.extends&&Array.isArray(n.extends)?n.extends:[];o.includes("ultracite")||(n.extends=[...o,"ultracite"]);let i={$schema:Pe.$schema},r=Ut(n,i);await Se(e,JSON.stringify(r,null,2))}};p();import{spawnSync as Ot}from"child_process";import{mkdir as _t,readFile as Jt,writeFile as Re}from"fs/promises";import Lt from"deepmerge";import{parse as zt}from"jsonc-parser";var ie={"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"}};var O="./.vscode/settings.json",M={exists:()=>a(O),create:async()=>{await _t(".vscode",{recursive:!0}),await Re(O,JSON.stringify(ie,null,2))},update:async()=>{let e=await Jt(O,"utf-8"),s=zt(e)||{},n=Lt(s,ie);await Re(O,JSON.stringify(n,null,2))},extension:()=>Ot("code --install-extension biomejs.biome",{stdio:"inherit",shell:!0})};p();import{mkdir as Bt,readFile as qt,writeFile as Ae}from"fs/promises";import Gt from"deepmerge";import{parse as Wt}from"jsonc-parser";var ae={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"}}}}}};var _="./.zed/settings.json",J={exists:()=>a(_),create:async()=>{await Bt(".zed",{recursive:!0}),await Ae(_,JSON.stringify(ae,null,2))},update:async()=>{let e=await qt(_,"utf-8"),s=Wt(e)||{},n=Gt(s,ae);await Ae(_,JSON.stringify(n,null,2))}};import{mkdir as Ht,readFile as Vt,writeFile as L}from"fs/promises";import{dirname as Xt}from"path";var Me=["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."],Ee=["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."],$e=["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"`.'],Ne=["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."],Ie=["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.'],Ue=["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."],Te=["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."],_n=[...Me,...Ee,...$e,...Fe,...Ne,...Ie,...Ue,...Te],E=`# Project Context
125
+ \u2728 Everything looks good!`)};p();import{spawnSync as Ft}from"child_process";import Ce from"process";var ne=(e,t={})=>{let s=["npx","@biomejs/biome","check","--write","--no-errors-on-unmatched"];t.unsafe&&s.push("--unsafe"),e.length>0?s.push(...N(e)):s.push("./");let n=s.join(" "),o=Ft(n,{stdio:"inherit",shell:!0});o.error&&(console.error("Failed to run Ultracite:",o.error.message),Ce.exit(1)),o.status!==0&&Ce.exit(o.status??1)};import{packageManagers as Nt}from"nypm";var A={packageManagers:Nt.map(e=>e.name),editorConfigs:["vscode","zed"],editorRules:["vscode-copilot","cursor","windsurf","zed","claude","codex","kiro","cline","amp","aider","firebase-studio","open-hands","gemini-cli","junie","augmentcode","kilo-code","goose"],integrations:["husky","lefthook","lint-staged"]};import j from"process";import{cancel as W,intro as vs,isCancel as H,log as V,multiselect as X,spinner as m}from"@clack/prompts";import{addDevDependency as xs,detectPackageManager as Ds}from"nypm";p();import{readFile as It,writeFile as Se}from"fs/promises";import Ut from"deepmerge";import{parse as Tt}from"jsonc-parser";var Pe={$schema:"./node_modules/@biomejs/biome/configuration_schema.json",extends:["ultracite"]},oe=async()=>await a("./biome.json")?"./biome.json":"./biome.jsonc",T={exists:async()=>{let e=await oe();return a(e)},create:async()=>{let e=await oe();return Se(e,JSON.stringify(Pe,null,2))},update:async()=>{let e=await oe(),t=await It(e,"utf-8"),n=Tt(t)||{},o=n.extends&&Array.isArray(n.extends)?n.extends:[];o.includes("ultracite")||(n.extends=[...o,"ultracite"]);let i={$schema:Pe.$schema},r=Ut(n,i);await Se(e,JSON.stringify(r,null,2))}};p();import{spawnSync as Ot}from"child_process";import{mkdir as _t,readFile as Jt,writeFile as Re}from"fs/promises";import Lt from"deepmerge";import{parse as zt}from"jsonc-parser";var ie={"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"}};var O="./.vscode/settings.json",M={exists:()=>a(O),create:async()=>{await _t(".vscode",{recursive:!0}),await Re(O,JSON.stringify(ie,null,2))},update:async()=>{let e=await Jt(O,"utf-8"),s=zt(e)||{},n=Lt(s,ie);await Re(O,JSON.stringify(n,null,2))},extension:()=>Ot("code --install-extension biomejs.biome",{stdio:"inherit",shell:!0})};p();import{mkdir as Bt,readFile as qt,writeFile as Ae}from"fs/promises";import Gt from"deepmerge";import{parse as Wt}from"jsonc-parser";var ae={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"}}}}}};var _="./.zed/settings.json",J={exists:()=>a(_),create:async()=>{await Bt(".zed",{recursive:!0}),await Ae(_,JSON.stringify(ae,null,2))},update:async()=>{let e=await qt(_,"utf-8"),s=Wt(e)||{},n=Gt(s,ae);await Ae(_,JSON.stringify(n,null,2))}};import{mkdir as Ht,readFile as Vt,writeFile as L}from"fs/promises";import{dirname as Xt}from"path";var Me={"vscode-copilot":{path:"./.github/copilot-instructions.md",header:`---
126
+ applyTo: "**/*.{ts,tsx,js,jsx}"
127
+ ---`,appendMode:!0},cursor:{path:"./.cursor/rules/ultracite.mdc",header:`---
128
+ description: Ultracite Rules - AI-Ready Formatter and Linter
129
+ globs: "**/*.{ts,tsx,js,jsx}"
130
+ alwaysApply: true
131
+ ---`},windsurf:{path:"./.windsurf/rules/ultracite.md"},zed:{path:"./.rules",appendMode:!0},claude:{path:"./.claude/CLAUDE.md",appendMode:!0},codex:{path:"./AGENTS.md",appendMode:!0},kiro:{path:"./.kiro/steering/ultracite.md"},cline:{path:"./.clinerules",appendMode:!0},amp:{path:"./AGENT.md",appendMode:!0},aider:{path:"./ultracite.md"},"firebase-studio":{path:"./.idx/airules.md",appendMode:!0},"open-hands":{path:"./.openhands/microagents/repo.md",appendMode:!0},"gemini-cli":{path:"./GEMINI.md",appendMode:!0},junie:{path:"./.junie/guidelines.md",appendMode:!0},augmentcode:{path:"./.augment/rules/ultracite.md"},"kilo-code":{path:"./.kilocode/rules/ultracite.md"},goose:{path:"./.goosehints",appendMode:!0}};p();var Ee=["Don't use `accessKey` attribute on any HTML element.",'Don\'t set `aria-hidden="true"` on focusable elements.',"Don't add ARIA roles, states, and properties to elements that don't support them.","Don't use distracting elements like `<marquee>` or `<blink>`.","Only use the `scope` prop on `<th>` elements.","Don't assign non-interactive ARIA roles to interactive HTML elements.","Make sure label elements have text content and are associated with an input.","Don't assign interactive ARIA roles to non-interactive HTML elements.","Don't assign `tabIndex` to non-interactive HTML elements.","Don't use positive integers for `tabIndex` property.",`Don't include "image", "picture", or "photo" in img alt prop.`,"Don't use explicit role property that's the same as the implicit/default role.","Make static elements with click handlers use a valid role attribute.","Always include a `title` element for SVG elements.","Give all elements requiring alt text meaningful information for screen readers.","Make sure anchors have content that's accessible to screen readers.","Assign `tabIndex` to non-interactive HTML elements with `aria-activedescendant`.","Include all required ARIA attributes for elements with ARIA roles.","Make sure ARIA properties are valid for the element's supported roles.","Always include a `type` attribute for button elements.","Make elements with interactive roles and handlers focusable.","Give heading elements content that's accessible to screen readers (not hidden with `aria-hidden`).","Always include a `lang` attribute on the html element.","Always include a `title` attribute for iframe elements.","Accompany `onClick` with at least one of: `onKeyUp`, `onKeyDown`, or `onKeyPress`.","Accompany `onMouseOver`/`onMouseOut` with `onFocus`/`onBlur`.","Include caption tracks for audio and video elements.","Use semantic elements instead of role attributes in JSX.","Make sure all anchors are valid and navigable.","Ensure all ARIA properties (`aria-*`) are valid.","Use valid, non-abstract ARIA roles for elements with ARIA roles.","Use valid ARIA state and property values.","Use valid values for the `autocomplete` attribute on input elements.","Use correct ISO language/country codes for the `lang` attribute."],$e=["Don't use consecutive spaces in regular expression literals.","Don't use the `arguments` object.","Don't use primitive type aliases or misleading types.","Don't use the comma operator.","Don't use empty type parameters in type aliases and interfaces.","Don't write functions that exceed a given Cognitive Complexity score.","Don't nest describe() blocks too deeply in test files.","Don't use unnecessary boolean casts.","Don't use unnecessary callbacks with flatMap.","Use for...of statements instead of Array.forEach.","Don't create classes that only have static members (like a static namespace).","Don't use this and super in static contexts.","Don't use unnecessary catch clauses.","Don't use unnecessary constructors.","Don't use unnecessary continue statements.","Don't export empty modules that don't change anything.","Don't use unnecessary escape sequences in regular expression literals.","Don't use unnecessary fragments.","Don't use unnecessary labels.","Don't use unnecessary nested block statements.","Don't rename imports, exports, and destructured assignments to the same name.","Don't use unnecessary string or template literal concatenation.","Don't use String.raw in template literals when there are no escape sequences.","Don't use useless case statements in switch statements.","Don't use ternary operators when simpler alternatives exist.","Don't use useless `this` aliasing.","Don't use any or unknown as type constraints.","Don't initialize variables to undefined.","Don't use the void operators (they're not familiar).","Use arrow functions instead of function expressions.","Use Date.now() to get milliseconds since the Unix Epoch.","Use .flatMap() instead of map().flat() when possible.","Use literal property access instead of computed property access.","Don't use parseInt() or Number.parseInt() when binary, octal, or hexadecimal literals work.","Use concise optional chaining instead of chained logical expressions.","Use regular expression literals instead of the RegExp constructor when possible.","Don't use number literal object member names that aren't base 10 or use underscore separators.","Remove redundant terms from logical expressions.","Use while loops instead of for loops when you don't need initializer and update expressions.","Don't pass children as props.","Don't reassign const variables.","Don't use constant expressions in conditions.","Don't use `Math.min` and `Math.max` to clamp values when the result is constant.","Don't return a value from a constructor.","Don't use empty character classes in regular expression literals.","Don't use empty destructuring patterns.","Don't call global object properties as functions.","Don't declare functions and vars that are accessible outside their block.","Make sure builtins are correctly instantiated.","Don't use super() incorrectly inside classes. Also check that super() is called in classes that extend other constructors.","Don't use variables and function parameters before they're declared.","Don't use 8 and 9 escape sequences in string literals.","Don't use literal numbers that lose precision."],Fe=["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.'],Ne=["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"`.'],Ie=["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."],Ue=["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.'],Te=["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."],Jn=[...Ee,...$e,...Fe,...Ne,...Ie,...Ue,...Te,...Oe],E=`# Project Context
126
132
  Ultracite enforces strict type safety, accessibility standards, and consistent code quality for JavaScript/TypeScript projects using Biome's lightning-fast formatter and linter.
127
133
 
128
134
  ## Key Principles
@@ -140,35 +146,35 @@ Ultracite enforces strict type safety, accessibility standards, and consistent c
140
146
  ## Rules
141
147
 
142
148
  ### Accessibility (a11y)
143
- ${Me.map(e=>`- ${e}`).join(`
149
+ ${Ee.map(e=>`- ${e}`).join(`
144
150
  `)}
145
151
 
146
152
  ### Code Complexity and Quality
147
- ${Ee.map(e=>`- ${e}`).join(`
153
+ ${$e.map(e=>`- ${e}`).join(`
148
154
  `)}
149
155
 
150
156
  ### React and JSX Best Practices
151
- ${$e.map(e=>`- ${e}`).join(`
157
+ ${Fe.map(e=>`- ${e}`).join(`
152
158
  `)}
153
159
 
154
160
  ### Correctness and Safety
155
- ${Fe.map(e=>`- ${e}`).join(`
161
+ ${Ne.map(e=>`- ${e}`).join(`
156
162
  `)}
157
163
 
158
164
  ### TypeScript Best Practices
159
- ${Ne.map(e=>`- ${e}`).join(`
165
+ ${Ie.map(e=>`- ${e}`).join(`
160
166
  `)}
161
167
 
162
168
  ### Style and Consistency
163
- ${Ie.map(e=>`- ${e}`).join(`
169
+ ${Ue.map(e=>`- ${e}`).join(`
164
170
  `)}
165
171
 
166
172
  ### Next.js Specific Rules
167
- ${Ue.map(e=>`- ${e}`).join(`
173
+ ${Te.map(e=>`- ${e}`).join(`
168
174
  `)}
169
175
 
170
176
  ### Testing Best Practices
171
- ${Te.map(e=>`- ${e}`).join(`
177
+ ${Oe.map(e=>`- ${e}`).join(`
172
178
  `)}
173
179
 
174
180
  ## Common Tasks
@@ -193,13 +199,7 @@ try {
193
199
  } catch (e) {
194
200
  console.log(e);
195
201
  }
196
- \`\`\``;var Oe={"vscode-copilot":{path:"./.github/copilot-instructions.md",header:`---
197
- applyTo: "**/*.{ts,tsx,js,jsx}"
198
- ---`,appendMode:!0},cursor:{path:"./.cursor/rules/ultracite.mdc",header:`---
199
- description: Ultracite Rules - AI-Ready Formatter and Linter
200
- globs: "**/*.{ts,tsx,js,jsx}"
201
- alwaysApply: true
202
- ---`},windsurf:{path:"./.windsurf/rules/ultracite.md"},zed:{path:"./.rules",appendMode:!0},claude:{path:"./.claude/CLAUDE.md",appendMode:!0},codex:{path:"./AGENTS.md",appendMode:!0},kiro:{path:"./.kiro/steering/ultracite.md"},cline:{path:"./.clinerules",appendMode:!0},amp:{path:"./AGENT.md",appendMode:!0},aider:{path:"./ultracite.md"},"firebase-studio":{path:"./.idx/airules.md",appendMode:!0},"open-hands":{path:"./.openhands/microagents/repo.md",appendMode:!0},"gemini-cli":{path:"./GEMINI.md",appendMode:!0},junie:{path:"./.junie/guidelines.md",appendMode:!0},augmentcode:{path:"./.augment/rules/ultracite.md"},"kilo-code":{path:"./.kilocode/rules/ultracite.md"},goose:{path:"./.goosehints",appendMode:!0}};p();var _e=e=>{let t=Oe[e],s=t.header?`${t.header}
202
+ \`\`\``;var _e=e=>{let t=Me[e],s=t.header?`${t.header}
203
203
 
204
204
  ${E}`:E,n=async()=>{let o=Xt(t.path);if(o!=="."){let i=o.startsWith("./")?o.slice(2):o;await Ht(i,{recursive:!0})}};return{exists:()=>a(t.path),create:async()=>{await n(),await L(t.path,s)},update:async()=>{if(await n(),t.appendMode){if(!await a(t.path)){await L(t.path,s);return}let o=await Vt(t.path,"utf-8");if(o.includes(E.trim()))return;await L(t.path,`${o}
205
205
 
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.5.5",
4
+ "version": "5.6.0",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "ultracite": "dist/index.js"
@@ -10,11 +10,6 @@
10
10
  "biome.jsonc",
11
11
  "dist"
12
12
  ],
13
- "scripts": {
14
- "build": "tsup",
15
- "test": "vitest run",
16
- "test:coverage": "vitest run --coverage"
17
- },
18
13
  "main": "./biome.jsonc",
19
14
  "author": "Hayden Bleasel <hello@haydenbleasel.com>",
20
15
  "bugs": {
@@ -38,12 +33,11 @@
38
33
  "url": "git+https://github.com/haydenbleasel/ultracite.git"
39
34
  },
40
35
  "devDependencies": {
41
- "@auto-it/all-contributors": "^11.3.0",
42
- "@auto-it/first-time-contributor": "^11.3.0",
43
36
  "@biomejs/biome": "2.2.5",
44
37
  "@types/node": "^24.5.2",
45
38
  "@vitest/coverage-v8": "3.2.4",
46
- "tsup": "^8.5.0"
39
+ "tsup": "^8.5.0",
40
+ "turbo": "^2.5.8"
47
41
  },
48
42
  "dependencies": {
49
43
  "@clack/prompts": "^0.11.0",
@@ -55,5 +49,9 @@
55
49
  "vitest": "^3.2.4",
56
50
  "zod": "^4.1.11"
57
51
  },
58
- "packageManager": "pnpm@10.17.0"
59
- }
52
+ "scripts": {
53
+ "build": "tsup",
54
+ "test": "vitest run",
55
+ "test:coverage": "vitest run --coverage"
56
+ }
57
+ }
package/README.md DELETED
@@ -1,89 +0,0 @@
1
- # Ultracite
2
-
3
- **The AI-ready formatter that helps you write and generate code _faster_.**
4
-
5
- Ultracite is a zero-config [Biome](https://biomejs.dev) preset that provides a robust linting and formatting experience for your team and your AI integrations. Built in Rust for lightning-fast performance, it automatically formats your code and fixes lint issues on save without interrupting your workflow.
6
-
7
- <div>
8
- <img src="https://img.shields.io/npm/dy/ultracite" alt="" />
9
- <img src="https://img.shields.io/npm/v/ultracite" alt="" />
10
- <img src="https://img.shields.io/github/license/haydenbleasel/ultracite" alt="" />
11
- </div>
12
-
13
- ![Ultracite](./docs/app/opengraph-image.jpg)
14
-
15
- ## Quick Start
16
-
17
- Install and initialize Ultracite in your project:
18
-
19
- ```sh
20
- npx ultracite init
21
- ```
22
-
23
- That's it! Ultracite will automatically format your code and fix lint issues every time you save. No configuration required.
24
-
25
- ## Key Features
26
-
27
- ### ⚡ **Subsecond Performance**
28
- Built in Rust for instant code analysis and processing. On-save checks feel seamless without interrupting your workflow.
29
-
30
- ### 🎯 **Zero-Config by Design**
31
- Preconfigured rules optimized for Next.js, React, and TypeScript projects with sensible defaults. Customize when needed, but it works perfectly out of the box.
32
-
33
- ### 🛡️ **Maximum Type Safety**
34
- Enforces strict type checking and best practices by default, catching type errors and preventing unsafe code patterns before they become problems.
35
-
36
- ### 🏗️ **Monorepo Ready**
37
- Unified toolchain configuration across all packages and apps, eliminating thousands of lines of duplicate config files while maintaining consistency.
38
-
39
- ### 🤖 **AI-Friendly**
40
- Ensures consistent code style and quality across all team members and AI models, eliminating debates over formatting and reducing code review friction. Supports GitHub Copilot, Cursor, Windsurf, Zed, Claude Code, and OpenAI Codex.
41
-
42
- ### 🔧 **Intuitive and Robust**
43
- Automatically reformats code and fixes lint issues on save, with clear error reporting for issues that need manual attention.
44
-
45
- ## How It Works
46
-
47
- Once set up, Ultracite runs mostly in the background:
48
-
49
- - **Automatic formatting** on every save
50
- - **Lint fixes** applied automatically when possible
51
- - **Type safety** enforced with strict rules
52
- - **Import organization** and cleanup
53
- - **Accessibility improvements** built-in
54
-
55
- Because Biome is extremely fast, even on large projects, running Ultracite's checks is instantaneous and can comfortably run on every save without lag.
56
-
57
- ## Command Line Usage
58
-
59
- ```sh
60
- # Format your code
61
- npx ultracite fix
62
-
63
- # Check for lint issues
64
- npx ultracite check
65
- ```
66
-
67
- ## Why Ultracite?
68
-
69
- Finally — a lightning-fast formatter that ensures you, your team, and your AI agents are writing code in harmony. Stop spending time on code style debates and formatting fixes. Let Ultracite handle the mundane so you can focus on building and shipping.
70
-
71
- Used by over [500 developers](https://github.com/haydenbleasel/ultracite/network/dependents)
72
-
73
- ## Tests
74
-
75
- Tests are written in [Vitest](https://vitest.dev). You can run them with:
76
-
77
- ```bash
78
- pnpm test
79
- ```
80
-
81
- Check the coverage of the CLI with:
82
-
83
- ```bash
84
- pnpm test:coverage
85
- ```
86
-
87
- ---
88
-
89
- Read the [docs](https://www.ultracite.ai/) for detailed setup instructions, configuration options, and examples.
package/license.md DELETED
@@ -1,7 +0,0 @@
1
- Copyright (c) 2022 — Present Hayden Bleasel
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.