ultracite 7.5.2 → 7.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{Command as Zi}from"commander";var d={name:"ultracite",version:"7.5.2",description:"The AI-ready formatter that helps you write and generate code faster.",keywords:["biome","fixer","formatter","linter","ultracite"],homepage:"https://www.ultracite.ai/",bugs:{url:"https://github.com/haydenbleasel/ultracite/issues"},license:"MIT",author:"Hayden Bleasel <hello@haydenbleasel.com>",repository:{type:"git",url:"git+https://github.com/haydenbleasel/ultracite.git"},bin:{ultracite:"dist/index.js"},files:["config","dist","README.md"],type:"module",exports:{"./oxlint":{types:"./dist/oxlint.d.ts",default:"./dist/oxlint.js"},"./biome/*":"./config/biome/*/biome.jsonc","./eslint/*":"./config/eslint/*/eslint.config.mjs","./oxlint/*":"./config/oxlint/*/index.js","./oxfmt":"./config/oxfmt/index.js","./prettier":"./config/prettier/prettier.config.mjs","./stylelint":"./config/stylelint/stylelint.config.mjs","./*":"./config/biome/*/biome.jsonc"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},scripts:{build:"tsup",test:"bun test","test:coverage":"bun test --coverage","check-types":"tsc --noEmit"},dependencies:{"@clack/prompts":"^1.2.0",commander:"^14.0.3","cross-spawn":"^7.0.6",deepmerge:"^4.3.1",glob:"^13.0.6","jsonc-parser":"^3.3.1",nypm:"^0.6.5"},devDependencies:{"@biomejs/biome":"2.4.11","@eslint/js":"^10.0.1","@next/eslint-plugin-next":"^16.2.3","@repo/data":"workspace:*","@tanstack/eslint-plugin-query":"^5.97.0","@types/cross-spawn":"^6.0.6","@types/node":"^25.6.0","@typescript-eslint/eslint-plugin":"^8.58.1","@typescript-eslint/parser":"^8.58.1","@vitest/eslint-plugin":"^1.6.15","eslint-config-prettier":"^10.1.8","eslint-import-resolver-typescript":"^4.4.4","eslint-plugin-angular":"^5.0.0","eslint-plugin-astro":"^1.7.0","eslint-plugin-compat":"^7.0.1","eslint-plugin-cypress":"^6.3.0","eslint-plugin-github":"6.0.0","eslint-plugin-html":"^8.1.4","eslint-plugin-import-x":"^4.16.2","eslint-plugin-jest":"^29.15.2","eslint-plugin-jsx-a11y":"^6.10.2","eslint-plugin-n":"^17.24.0","eslint-plugin-prettier":"^5.5.5","eslint-plugin-promise":"^7.2.1","eslint-plugin-qwik":"^1.19.2","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-remix":"^1.1.1","eslint-plugin-solid":"^0.14.5","eslint-plugin-sonarjs":"^4.0.2","eslint-plugin-storybook":"^10.3.5","eslint-plugin-svelte":"^3.17.0","eslint-plugin-unicorn":"^64.0.0","eslint-plugin-unused-imports":"^4.4.1","eslint-plugin-vue":"^10.8.0",globals:"^17.4.0",oxlint:"^1.59.0","prettier-plugin-svelte":"^3.5.1","prettier-plugin-tailwindcss":"^0.7.2","stylelint-config-idiomatic-order":"^10.0.0","stylelint-config-standard":"^40.0.0","stylelint-prettier":"^5.0.3",tsup:"^8.5.1"},peerDependencies:{oxlint:"^1.0.0"},peerDependenciesMeta:{oxlint:{optional:!0}},packageManager:"bun@1.3.12"};import At from"process";import{sync as Te}from"cross-spawn";var h=(e,t,o)=>Te(e,t,{...o,shell:!1}),Ge=(e,t)=>Te(e,[],{...t,shell:!0}),v=(e,t)=>{if(t.error)throw new Error(`Failed to run ${e}: ${t.error.message}`);t.status!==0&&At.exit(t.status??1)};import{access as zt,mkdir as Ut,readFile as Be,writeFile as It}from"fs/promises";import{dirname as De,join as ve}from"path";import Et from"process";import{parse as jt}from"jsonc-parser";var m=async e=>{try{return await zt(e),!0}catch{return!1}},S=async()=>{if(await m("pnpm-workspace.yaml"))return!0;try{let e=jt(await Be("package.json","utf-8"));return e?!!e.workspaces||!!e.workspace:!1}catch{return!1}},k=async({dependencies:e,devDependencies:t,scripts:o,type:i})=>{let a=await Be("package.json","utf-8"),r=JSON.parse(a),l={...r};i&&(l.type=i),(r.devDependencies||t)&&(l.devDependencies={...r.devDependencies,...t}),(r.dependencies||e)&&(l.dependencies={...r.dependencies,...e}),(r.scripts||o)&&(l.scripts={...r.scripts,...o}),await It("package.json",JSON.stringify(l,null,2))},b=async e=>{let t=De(e);if(t!=="."){let o=t.startsWith("./")?t.slice(2):t;await Ut(o,{recursive:!0})}},Tt=["biome.json","biome.jsonc"],Gt=["eslint.config.mjs","eslint.config.js","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts"],Bt=[".oxlintrc.json","oxlint.config.ts"],X=async()=>{let e=Et.cwd();for(;;){for(let o of Tt)if(await m(ve(e,o)))return"biome";for(let o of Gt)if(await m(ve(e,o)))return"eslint";for(let o of Bt)if(await m(ve(e,o)))return"oxlint";let t=De(e);if(t===e)break;e=t}return null};var Dt=(e,t)=>{let o=["check","--no-errors-on-unmatched",...t];e.length>0?o.push(...e):o.push("./");let i=h("biome",o,{stdio:"inherit"});v("Biome",i)},Pt=(e,t)=>{let o=[...t,...e.length>0?e:["."]],i=h("eslint",o,{stdio:"inherit"});v("ESLint",i)},Ft=(e,t)=>{let o=["--check",...t,...e.length>0?e:["."]],i=h("prettier",o,{stdio:"inherit"});v("Prettier",i)},Nt=(e,t)=>{let o=[...t,...e.length>0?e:["."]],i=h("stylelint",o,{stdio:"inherit"});v("Stylelint",i)},Ot=(e,t)=>{let o=[...t,...e.length>0?e:["."]],i=h("oxlint",o,{stdio:"inherit"});v("Oxlint",i)},Lt=(e,t)=>{let o=["--check",...t,...e.length>0?e:["."]],i=h("oxfmt",o,{stdio:"inherit"});v("oxfmt",i)},Pe=async(e=[],t=[])=>{let o=await X();if(!o)throw new Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(o){case"eslint":{await Ft(e,[]),await Pt(e,t),await Nt(e,[]);break}case"oxlint":{await Lt(e,[]),await Ot(e,t);break}default:await Dt(e,t)}};import{existsSync as U}from"fs";import{readFile as te}from"fs/promises";import{join as I}from"path";import E from"process";import{intro as Rt,log as ee,outro as ye,spinner as Mt}from"@clack/prompts";import{parse as $t}from"jsonc-parser";var _t=[".prettierrc",".prettierrc.js",".prettierrc.cjs",".prettierrc.mjs",".prettierrc.json",".prettierrc.yaml",".prettierrc.yml","prettier.config.js","prettier.config.mjs","prettier.config.cjs"],Vt=[".eslintrc",".eslintrc.js",".eslintrc.cjs",".eslintrc.mjs",".eslintrc.json",".eslintrc.yaml",".eslintrc.yml","eslint.config.js","eslint.config.mjs","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts"],Wt=()=>{let e=h("biome",["--version"],{encoding:"utf-8"});return e.status===0&&e.stdout?{message:`Biome is installed (${String(e.stdout).trim()})`,name:"Biome installation",status:"pass"}:{message:"Biome is not installed or not accessible",name:"Biome installation",status:"fail"}},Jt=()=>{let e=h("eslint",["--version"],{encoding:"utf-8"});return e.status===0&&e.stdout?{message:`ESLint is installed (${String(e.stdout).trim()})`,name:"ESLint installation",status:"pass"}:{message:"ESLint is not installed (optional)",name:"ESLint installation",status:"warn"}},qt=()=>{let e=h("oxlint",["--version"],{encoding:"utf-8"});return e.status===0&&e.stdout?{message:`Oxlint is installed (${String(e.stdout).trim()})`,name:"Oxlint installation",status:"pass"}:{message:"Oxlint is not installed (optional)",name:"Oxlint installation",status:"warn"}},Ht=async()=>{let e=I(E.cwd(),"biome.json"),t=I(E.cwd(),"biome.jsonc"),o=null;if(U(e)?o=e:U(t)&&(o=t),!o)return{message:"No biome.json or biome.jsonc file found",name:"Biome configuration",status:"warn"};try{let i=await te(o,"utf-8"),a=$t(i);return Array.isArray(a?.extends)&&a.extends.includes("ultracite/biome/core")?{message:"biome.json(c) extends ultracite/biome/core",name:"Biome configuration",status:"pass"}:{message:"biome.json(c) exists but doesn't extend ultracite/biome/core",name:"Biome configuration",status:"warn"}}catch{return{message:"Could not parse biome.json(c) file",name:"Biome configuration",status:"fail"}}},Kt=async()=>{let e=["eslint.config.mjs","eslint.config.js","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts"],t=null;for(let o of e){let i=I(E.cwd(),o);if(U(i)){t=i;break}}if(!t)return{message:"No eslint.config.* file found (optional)",name:"ESLint configuration",status:"warn"};try{return(await te(t,"utf-8")).includes("ultracite/eslint")?{message:"eslint.config.* imports ultracite/eslint",name:"ESLint configuration",status:"pass"}:{message:"eslint.config.* exists but doesn't import ultracite/eslint",name:"ESLint configuration",status:"warn"}}catch{return{message:"Could not read eslint.config.* file",name:"ESLint configuration",status:"fail"}}},Qt=e=>`ultracite/config/oxlint/${e}`,Zt=async()=>{let e=I(E.cwd(),"oxlint.config.ts");if(!U(e))return{message:"No oxlint.config.ts file found (optional)",name:"Oxlint configuration",status:"warn"};try{return(await te(e,"utf-8")).includes(Qt("core"))?{message:"oxlint.config.ts extends ultracite oxlint config",name:"Oxlint configuration",status:"pass"}:{message:"oxlint.config.ts exists but doesn't extend ultracite config",name:"Oxlint configuration",status:"warn"}}catch{return{message:"Could not read oxlint.config.ts file",name:"Oxlint configuration",status:"fail"}}},Yt=async()=>{let e=I(E.cwd(),"package.json");if(!U(e))return{message:"No package.json found",name:"Ultracite dependency",status:"warn"};try{let t=JSON.parse(await te(e,"utf-8")),o=t.dependencies?.ultracite||t.devDependencies?.ultracite||t.peerDependencies?.ultracite;return o?{message:`Ultracite is in package.json (${o})`,name:"Ultracite dependency",status:"pass"}:{message:"Ultracite not found in package.json dependencies",name:"Ultracite dependency",status:"warn"}}catch{return{message:"Could not parse package.json",name:"Ultracite dependency",status:"warn"}}},Xt=()=>{let e=_t.some(i=>U(I(E.cwd(),i))),o=Vt.filter(i=>!i.startsWith("eslint.config")).some(i=>U(I(E.cwd(),i)));if(e||o){let i=[];return e&&i.push("Prettier"),o&&i.push("ESLint (legacy config)"),{message:`Found potentially conflicting tools: ${i.join(", ")}`,name:"Conflicting tools",status:"warn"}}return{message:"No conflicting formatting/linting tools found",name:"Conflicting tools",status:"pass"}},A=async(e,t)=>{let o=Mt();o.start(`Checking ${t}...`);let i=await e();return i.status==="pass"||i.status,o.stop(i.message),i},Fe=async()=>{Rt(`Ultracite v${d.version} Doctor`);let e=[await A(Wt,"Biome installation"),await A(Jt,"ESLint installation"),await A(qt,"Oxlint installation"),await A(Ht,"Biome configuration"),await A(Kt,"ESLint configuration"),await A(Zt,"Oxlint configuration"),await A(Yt,"Ultracite dependency"),await A(Xt,"conflicting tools")],t=e.filter(a=>a.status==="pass").length,o=e.filter(a=>a.status==="fail").length,i=e.filter(a=>a.status==="warn").length;if(ee.info(`Summary: ${t} passed, ${i} warnings, ${o} failed`),o>0)throw ee.error("Some checks failed. Run 'ultracite init' to fix issues."),ye("Doctor complete"),new Error("Doctor checks failed");if(i>0){ee.warn("Some optional improvements available. Run 'ultracite init' to configure."),ye("Doctor complete");return}ee.success("Everything looks good!"),ye("Doctor complete")};var e2=(e,t)=>{let o=["check","--write","--no-errors-on-unmatched",...t];e.length>0?o.push(...e):o.push("./");let i=h("biome",o,{stdio:"inherit"});v("Biome",i)},t2=(e,t)=>{let o=["--fix",...t,...e.length>0?e:["."]],i=h("eslint",o,{stdio:"inherit"});v("ESLint",i)},o2=(e,t)=>{let o=["--write",...t,...e.length>0?e:["."]],i=h("prettier",o,{stdio:"inherit"});v("Prettier",i)},i2=(e,t)=>{let o=["--fix",...t,...e.length>0?e:["."]],i=h("stylelint",o,{stdio:"inherit"});v("Stylelint",i)},s2=(e,t)=>{let o=t.includes("--unsafe"),i=t.filter(l=>l!=="--unsafe"),a=[o?"--fix-dangerously":"--fix",...i,...e.length>0?e:["."]],r=h("oxlint",a,{stdio:"inherit"});v("Oxlint",r)},n2=(e,t)=>{let o=["--write",...t,...e.length>0?e:["."]],i=h("oxfmt",o,{stdio:"inherit"});v("oxfmt",i)},Ne=async(e,t=[])=>{let o=await X();if(!o)throw new Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(o){case"eslint":{await o2(e,[]),await t2(e,t),await i2(e,[]);break}case"oxlint":{await n2(e,[]),await s2(e,t);break}default:await e2(e,t)}};import Ii from"process";import{cancel as L,intro as Ei,isCancel as R,log as Z,multiselect as Y,select as ji,spinner as w}from"@clack/prompts";var Oe="./adal-VMG3GLKT.svg";var Le="./aider-K7JLZT2D.svg";var Re="./amazon-q-TSOJNPXB.svg";var Me="./amp-EV4LVL5I.svg";var $e="./augmentcode-Q62PVXKO.svg";var oe="./bob-MRQ23J26.svg";var _e="./claude-6DLEHRDQ.svg";var Ve="./cline-6HWKIYN7.svg";var We="./coder-7BVXO5OJ.svg";var Je="./codex-NQZ5TJCL.svg";var qe="./continue-LKI2ZW3R.svg";var He="./copilot-L2IY45R2.svg";var Ke="./crush-LYLRDQGZ.svg";var ie="./cursor-GQNH5LCA.svg";var Qe="./devin-KY5ISKEW.svg";var Ze="./droid-266OHJBT.svg";var Ye="./firebase-studio-ILLWWYU7.svg";var Xe="./firebender-UNO6LSZG.svg";var e1="./gemini-OYS6V4BH.svg";var t1="./goose-XBIEVD4H.svg";var o1="./jules-HJPVWU73.svg";var i1="./junie-RUWBUV6N.svg";var s1="./kilo-code-4QYUYY2E.svg";var n1="./kimi-6SOFW673.svg";var a1="./langchain-5SXQKAL3.svg";var r1="./lovable-UELF2DY5.svg";var l1="./mcpjam-V2GHUPJN.svg";var c1="./mistral-HQ63EC2B.svg";var d1="./ona-KYYK3HQX.svg";var p1="./open-hands-K5EYKO6T.svg";var m1="./openclaw-XFPF7FMJ.svg";var f1="./opencode-K3274JKQ.svg";var g1="./pi-AZOSKO3D.svg";var u1="./qoder-LPW47DKG.svg";var h1="./qwen-N3D5CQYL.svg";var w1="./replit-WKR4Y6HH.svg";var v1="./roo-code-CVLBTS7D.svg";var y1="./snowflake-S3LTTUXJ.svg";var k1="./vercel-27VSITAQ.svg";var b1="./warp-OZKAAQRT.svg";var x1="./zencoder-VTSK5Z7Z.svg";var se=(e,t)=>`# Ultracite Code Standards
2
+ import{Command as Zi}from"commander";var d={name:"ultracite",version:"7.5.4",description:"The AI-ready formatter that helps you write and generate code faster.",keywords:["biome","fixer","formatter","linter","ultracite"],homepage:"https://www.ultracite.ai/",bugs:{url:"https://github.com/haydenbleasel/ultracite/issues"},license:"MIT",author:"Hayden Bleasel <hello@haydenbleasel.com>",repository:{type:"git",url:"git+https://github.com/haydenbleasel/ultracite.git"},bin:{ultracite:"dist/index.js"},files:["config","dist","README.md"],type:"module",exports:{"./oxlint":{types:"./dist/oxlint.d.ts",default:"./dist/oxlint.js"},"./biome/*":"./config/biome/*/biome.jsonc","./eslint/*":"./config/eslint/*/eslint.config.mjs","./oxlint/*":"./config/oxlint/*/index.ts","./oxfmt":"./config/oxfmt/index.ts","./prettier":"./config/prettier/prettier.config.mjs","./stylelint":"./config/stylelint/stylelint.config.mjs","./*":"./config/biome/*/biome.jsonc"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},scripts:{build:"tsup",test:"bun test","test:coverage":"bun test --coverage","check-types":"tsc --noEmit"},dependencies:{"@clack/prompts":"^1.2.0",commander:"^14.0.3","cross-spawn":"^7.0.6",deepmerge:"^4.3.1",glob:"^13.0.6","jsonc-parser":"^3.3.1",nypm:"^0.6.5"},devDependencies:{"@biomejs/biome":"2.4.11","@eslint/js":"^10.0.1","@next/eslint-plugin-next":"^16.2.3","@repo/data":"workspace:*","@tanstack/eslint-plugin-query":"^5.97.0","@types/cross-spawn":"^6.0.6","@types/node":"^25.6.0","@typescript-eslint/eslint-plugin":"^8.58.1","@typescript-eslint/parser":"^8.58.1","@vitest/eslint-plugin":"^1.6.15","eslint-config-prettier":"^10.1.8","eslint-import-resolver-typescript":"^4.4.4","eslint-plugin-angular":"^5.0.0","eslint-plugin-astro":"^1.7.0","eslint-plugin-compat":"^7.0.1","eslint-plugin-cypress":"^6.3.0","eslint-plugin-github":"6.0.0","eslint-plugin-html":"^8.1.4","eslint-plugin-import-x":"^4.16.2","eslint-plugin-jest":"^29.15.2","eslint-plugin-jsx-a11y":"^6.10.2","eslint-plugin-n":"^17.24.0","eslint-plugin-prettier":"^5.5.5","eslint-plugin-promise":"^7.2.1","eslint-plugin-qwik":"^1.19.2","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^7.0.1","eslint-plugin-remix":"^1.1.1","eslint-plugin-solid":"^0.14.5","eslint-plugin-sonarjs":"^4.0.2","eslint-plugin-storybook":"^10.3.5","eslint-plugin-svelte":"^3.17.0","eslint-plugin-unicorn":"^64.0.0","eslint-plugin-unused-imports":"^4.4.1","eslint-plugin-vue":"^10.8.0",globals:"^17.4.0",oxlint:"^1.59.0","prettier-plugin-svelte":"^3.5.1","prettier-plugin-tailwindcss":"^0.7.2","stylelint-config-idiomatic-order":"^10.0.0","stylelint-config-standard":"^40.0.0","stylelint-prettier":"^5.0.3",tsup:"^8.5.1"},peerDependencies:{oxlint:"^1.0.0"},peerDependenciesMeta:{oxlint:{optional:!0}},packageManager:"bun@1.3.12"};import At from"process";import{sync as Te}from"cross-spawn";var h=(e,t,o)=>Te(e,t,{...o,shell:!1}),Ge=(e,t)=>Te(e,[],{...t,shell:!0}),v=(e,t)=>{if(t.error)throw new Error(`Failed to run ${e}: ${t.error.message}`);t.status!==0&&At.exit(t.status??1)};import{access as zt,mkdir as Ut,readFile as Be,writeFile as It}from"fs/promises";import{dirname as De,join as ve}from"path";import Et from"process";import{parse as jt}from"jsonc-parser";var m=async e=>{try{return await zt(e),!0}catch{return!1}},S=async()=>{if(await m("pnpm-workspace.yaml"))return!0;try{let e=jt(await Be("package.json","utf-8"));return e?!!e.workspaces||!!e.workspace:!1}catch{return!1}},k=async({dependencies:e,devDependencies:t,scripts:o,type:i})=>{let a=await Be("package.json","utf-8"),r=JSON.parse(a),l={...r};i&&(l.type=i),(r.devDependencies||t)&&(l.devDependencies={...r.devDependencies,...t}),(r.dependencies||e)&&(l.dependencies={...r.dependencies,...e}),(r.scripts||o)&&(l.scripts={...r.scripts,...o}),await It("package.json",JSON.stringify(l,null,2))},b=async e=>{let t=De(e);if(t!=="."){let o=t.startsWith("./")?t.slice(2):t;await Ut(o,{recursive:!0})}},Tt=["biome.json","biome.jsonc"],Gt=["eslint.config.mjs","eslint.config.js","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts"],Bt=[".oxlintrc.json","oxlint.config.ts"],X=async()=>{let e=Et.cwd();for(;;){for(let o of Tt)if(await m(ve(e,o)))return"biome";for(let o of Gt)if(await m(ve(e,o)))return"eslint";for(let o of Bt)if(await m(ve(e,o)))return"oxlint";let t=De(e);if(t===e)break;e=t}return null};var Dt=(e,t)=>{let o=["check","--no-errors-on-unmatched",...t];e.length>0?o.push(...e):o.push("./");let i=h("biome",o,{stdio:"inherit"});v("Biome",i)},Pt=(e,t)=>{let o=[...t,...e.length>0?e:["."]],i=h("eslint",o,{stdio:"inherit"});v("ESLint",i)},Ft=(e,t)=>{let o=["--check",...t,...e.length>0?e:["."]],i=h("prettier",o,{stdio:"inherit"});v("Prettier",i)},Nt=(e,t)=>{let o=[...t,...e.length>0?e:["."]],i=h("stylelint",o,{stdio:"inherit"});v("Stylelint",i)},Ot=(e,t)=>{let o=[...t,...e.length>0?e:["."]],i=h("oxlint",o,{stdio:"inherit"});v("Oxlint",i)},Lt=(e,t)=>{let o=["--check",...t,...e.length>0?e:["."]],i=h("oxfmt",o,{stdio:"inherit"});v("oxfmt",i)},Pe=async(e=[],t=[])=>{let o=await X();if(!o)throw new Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(o){case"eslint":{await Ft(e,[]),await Pt(e,t),await Nt(e,[]);break}case"oxlint":{await Lt(e,[]),await Ot(e,t);break}default:await Dt(e,t)}};import{existsSync as U}from"fs";import{readFile as te}from"fs/promises";import{join as I}from"path";import E from"process";import{intro as Rt,log as ee,outro as ye,spinner as Mt}from"@clack/prompts";import{parse as $t}from"jsonc-parser";var _t=[".prettierrc",".prettierrc.js",".prettierrc.cjs",".prettierrc.mjs",".prettierrc.json",".prettierrc.yaml",".prettierrc.yml","prettier.config.js","prettier.config.mjs","prettier.config.cjs"],Vt=[".eslintrc",".eslintrc.js",".eslintrc.cjs",".eslintrc.mjs",".eslintrc.json",".eslintrc.yaml",".eslintrc.yml","eslint.config.js","eslint.config.mjs","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts"],Wt=()=>{let e=h("biome",["--version"],{encoding:"utf-8"});return e.status===0&&e.stdout?{message:`Biome is installed (${String(e.stdout).trim()})`,name:"Biome installation",status:"pass"}:{message:"Biome is not installed or not accessible",name:"Biome installation",status:"fail"}},Jt=()=>{let e=h("eslint",["--version"],{encoding:"utf-8"});return e.status===0&&e.stdout?{message:`ESLint is installed (${String(e.stdout).trim()})`,name:"ESLint installation",status:"pass"}:{message:"ESLint is not installed (optional)",name:"ESLint installation",status:"warn"}},qt=()=>{let e=h("oxlint",["--version"],{encoding:"utf-8"});return e.status===0&&e.stdout?{message:`Oxlint is installed (${String(e.stdout).trim()})`,name:"Oxlint installation",status:"pass"}:{message:"Oxlint is not installed (optional)",name:"Oxlint installation",status:"warn"}},Ht=async()=>{let e=I(E.cwd(),"biome.json"),t=I(E.cwd(),"biome.jsonc"),o=null;if(U(e)?o=e:U(t)&&(o=t),!o)return{message:"No biome.json or biome.jsonc file found",name:"Biome configuration",status:"warn"};try{let i=await te(o,"utf-8"),a=$t(i);return Array.isArray(a?.extends)&&a.extends.includes("ultracite/biome/core")?{message:"biome.json(c) extends ultracite/biome/core",name:"Biome configuration",status:"pass"}:{message:"biome.json(c) exists but doesn't extend ultracite/biome/core",name:"Biome configuration",status:"warn"}}catch{return{message:"Could not parse biome.json(c) file",name:"Biome configuration",status:"fail"}}},Kt=async()=>{let e=["eslint.config.mjs","eslint.config.js","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts"],t=null;for(let o of e){let i=I(E.cwd(),o);if(U(i)){t=i;break}}if(!t)return{message:"No eslint.config.* file found (optional)",name:"ESLint configuration",status:"warn"};try{return(await te(t,"utf-8")).includes("ultracite/eslint")?{message:"eslint.config.* imports ultracite/eslint",name:"ESLint configuration",status:"pass"}:{message:"eslint.config.* exists but doesn't import ultracite/eslint",name:"ESLint configuration",status:"warn"}}catch{return{message:"Could not read eslint.config.* file",name:"ESLint configuration",status:"fail"}}},Qt=e=>`ultracite/oxlint/${e}`,Zt=async()=>{let e=I(E.cwd(),"oxlint.config.ts");if(!U(e))return{message:"No oxlint.config.ts file found (optional)",name:"Oxlint configuration",status:"warn"};try{return(await te(e,"utf-8")).includes(Qt("core"))?{message:"oxlint.config.ts extends ultracite oxlint config",name:"Oxlint configuration",status:"pass"}:{message:"oxlint.config.ts exists but doesn't extend ultracite config",name:"Oxlint configuration",status:"warn"}}catch{return{message:"Could not read oxlint.config.ts file",name:"Oxlint configuration",status:"fail"}}},Yt=async()=>{let e=I(E.cwd(),"package.json");if(!U(e))return{message:"No package.json found",name:"Ultracite dependency",status:"warn"};try{let t=JSON.parse(await te(e,"utf-8")),o=t.dependencies?.ultracite||t.devDependencies?.ultracite||t.peerDependencies?.ultracite;return o?{message:`Ultracite is in package.json (${o})`,name:"Ultracite dependency",status:"pass"}:{message:"Ultracite not found in package.json dependencies",name:"Ultracite dependency",status:"warn"}}catch{return{message:"Could not parse package.json",name:"Ultracite dependency",status:"warn"}}},Xt=()=>{let e=_t.some(i=>U(I(E.cwd(),i))),o=Vt.filter(i=>!i.startsWith("eslint.config")).some(i=>U(I(E.cwd(),i)));if(e||o){let i=[];return e&&i.push("Prettier"),o&&i.push("ESLint (legacy config)"),{message:`Found potentially conflicting tools: ${i.join(", ")}`,name:"Conflicting tools",status:"warn"}}return{message:"No conflicting formatting/linting tools found",name:"Conflicting tools",status:"pass"}},A=async(e,t)=>{let o=Mt();o.start(`Checking ${t}...`);let i=await e();return i.status==="pass"||i.status,o.stop(i.message),i},Fe=async()=>{Rt(`Ultracite v${d.version} Doctor`);let e=[await A(Wt,"Biome installation"),await A(Jt,"ESLint installation"),await A(qt,"Oxlint installation"),await A(Ht,"Biome configuration"),await A(Kt,"ESLint configuration"),await A(Zt,"Oxlint configuration"),await A(Yt,"Ultracite dependency"),await A(Xt,"conflicting tools")],t=e.filter(a=>a.status==="pass").length,o=e.filter(a=>a.status==="fail").length,i=e.filter(a=>a.status==="warn").length;if(ee.info(`Summary: ${t} passed, ${i} warnings, ${o} failed`),o>0)throw ee.error("Some checks failed. Run 'ultracite init' to fix issues."),ye("Doctor complete"),new Error("Doctor checks failed");if(i>0){ee.warn("Some optional improvements available. Run 'ultracite init' to configure."),ye("Doctor complete");return}ee.success("Everything looks good!"),ye("Doctor complete")};var e2=(e,t)=>{let o=["check","--write","--no-errors-on-unmatched",...t];e.length>0?o.push(...e):o.push("./");let i=h("biome",o,{stdio:"inherit"});v("Biome",i)},t2=(e,t)=>{let o=["--fix",...t,...e.length>0?e:["."]],i=h("eslint",o,{stdio:"inherit"});v("ESLint",i)},o2=(e,t)=>{let o=["--write",...t,...e.length>0?e:["."]],i=h("prettier",o,{stdio:"inherit"});v("Prettier",i)},i2=(e,t)=>{let o=["--fix",...t,...e.length>0?e:["."]],i=h("stylelint",o,{stdio:"inherit"});v("Stylelint",i)},s2=(e,t)=>{let o=t.includes("--unsafe"),i=t.filter(l=>l!=="--unsafe"),a=[o?"--fix-dangerously":"--fix",...i,...e.length>0?e:["."]],r=h("oxlint",a,{stdio:"inherit"});v("Oxlint",r)},n2=(e,t)=>{let o=["--write",...t,...e.length>0?e:["."]],i=h("oxfmt",o,{stdio:"inherit"});v("oxfmt",i)},Ne=async(e,t=[])=>{let o=await X();if(!o)throw new Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(o){case"eslint":{await o2(e,[]),await t2(e,t),await i2(e,[]);break}case"oxlint":{await n2(e,[]),await s2(e,t);break}default:await e2(e,t)}};import Ii from"process";import{cancel as L,intro as Ei,isCancel as R,log as Z,multiselect as Y,select as ji,spinner as w}from"@clack/prompts";var Oe="./adal-VMG3GLKT.svg";var Le="./aider-K7JLZT2D.svg";var Re="./amazon-q-TSOJNPXB.svg";var Me="./amp-EV4LVL5I.svg";var $e="./augmentcode-Q62PVXKO.svg";var oe="./bob-MRQ23J26.svg";var _e="./claude-6DLEHRDQ.svg";var Ve="./cline-6HWKIYN7.svg";var We="./coder-7BVXO5OJ.svg";var Je="./codex-NQZ5TJCL.svg";var qe="./continue-LKI2ZW3R.svg";var He="./copilot-L2IY45R2.svg";var Ke="./crush-LYLRDQGZ.svg";var ie="./cursor-GQNH5LCA.svg";var Qe="./devin-KY5ISKEW.svg";var Ze="./droid-266OHJBT.svg";var Ye="./firebase-studio-ILLWWYU7.svg";var Xe="./firebender-UNO6LSZG.svg";var e1="./gemini-OYS6V4BH.svg";var t1="./goose-XBIEVD4H.svg";var o1="./jules-HJPVWU73.svg";var i1="./junie-RUWBUV6N.svg";var s1="./kilo-code-4QYUYY2E.svg";var n1="./kimi-6SOFW673.svg";var a1="./langchain-5SXQKAL3.svg";var r1="./lovable-UELF2DY5.svg";var l1="./mcpjam-V2GHUPJN.svg";var c1="./mistral-HQ63EC2B.svg";var d1="./ona-KYYK3HQX.svg";var p1="./open-hands-K5EYKO6T.svg";var m1="./openclaw-XFPF7FMJ.svg";var f1="./opencode-K3274JKQ.svg";var g1="./pi-AZOSKO3D.svg";var u1="./qoder-LPW47DKG.svg";var h1="./qwen-N3D5CQYL.svg";var w1="./replit-WKR4Y6HH.svg";var v1="./roo-code-CVLBTS7D.svg";var y1="./snowflake-S3LTTUXJ.svg";var k1="./vercel-27VSITAQ.svg";var b1="./warp-OZKAAQRT.svg";var x1="./zencoder-VTSK5Z7Z.svg";var se=(e,t)=>`# Ultracite Code Standards
3
3
 
4
4
  This project uses **Ultracite**, a zero-config preset that enforces strict code quality standards through automated formatting and linting.
5
5
 
@@ -145,7 +145,7 @@ export default defineConfig([
145
145
  },
146
146
  ]);`,lang:"javascript",name:"eslint.config.mjs"},{code:()=>'export { default } from "ultracite/prettier";',lang:"javascript",name:"prettier.config.mjs"},{code:()=>'export { default } from "ultracite/stylelint";',lang:"javascript",name:"stylelint.config.mjs"}],description:"The most mature and comprehensive linting solution. Combines ESLint for JavaScript/TypeScript, Prettier for formatting, and Stylelint for CSS with 20+ plugins and hundreds of preconfigured rules.",id:"eslint",includes:["ESLint","Prettier","Stylelint"],logo:G1,name:"ESLint + Prettier + Stylelint",subtitle:"The most mature linting ecosystem",vscodeExtensionId:"dbaeumer.vscode-eslint"},{benefits:[{description:"Lint your entire codebase in milliseconds. No more waiting for slow linting processes.",icon:"Zap",title:"50-100x faster"},{description:"Built-in support for React, TypeScript, Next.js, Vue, Jest, Vitest, JSDoc, and more without extra deps.",icon:"Puzzle",title:"15 plugin equivalents"},{description:"Prioritizes catching real bugs over stylistic issues. High signal-to-noise ratio.",icon:"Bug",title:"Bug-focused rules"},{description:"Part of the larger Oxc project with parser, resolver, transformer, and minifier built for speed.",icon:"Boxes",title:"Oxc ecosystem"},{description:"Rules organized into correctness, suspicious, pedantic, performance, restriction, and style categories.",icon:"FolderTree",title:"Category-based config"},{description:"Works alongside your existing ESLint setup or as a complete replacement with Oxfmt for formatting.",icon:"RefreshCw",title:"Drop-in ready"}],configFiles:[{code:e=>`import { defineConfig } from "oxlint";
147
147
 
148
- ${e.map(t=>`import ${t} from "ultracite/config/oxlint/${t}/index.js";`).join(`
148
+ ${e.map(t=>`import ${t} from "ultracite/oxlint/${t}";`).join(`
149
149
  `)}
150
150
 
151
151
  export default defineConfig({
@@ -153,19 +153,9 @@ export default defineConfig({
153
153
  ${e.join(`,
154
154
  `)}
155
155
  ],
156
- });`,lang:"typescript",name:"oxlint.config.ts"},{code:()=>`import { defineConfig } from "oxfmt";
156
+ });`,lang:"typescript",name:"oxlint.config.ts"},{code:()=>`import config from "ultracite/oxfmt";
157
157
 
158
- export default defineConfig({
159
- tabWidth: 2,
160
- useTabs: false,
161
- semi: true,
162
- singleQuote: true,
163
- trailingComma: "es5",
164
- bracketSpacing: true,
165
- arrowParens: "always",
166
- proseWrap: "never",
167
- printWidth: 80,
168
- });`,lang:"typescript",name:"oxfmt.config.ts"}],description:"The fastest linter available. Oxlint is part of the Oxc project, running 50-100x faster than ESLint with a focus on catching bugs and reducing false positives.",id:"oxlint",includes:["Oxlint","Oxfmt"],logo:B1,name:"Oxlint + Oxfmt",subtitle:"The fastest linter available",vscodeExtensionId:"oxc.oxc-vscode"}];import{addDevDependency as Ti,detectPackageManager as Gi}from"nypm";import{readFile as vo,writeFile as ke}from"fs/promises";import{dlxCommand as yo}from"nypm";var F1=e=>e.replace(/ Code$/,"").replace(/ Agent$/,""),ko=(e,t)=>{if(e==="AGENTS.md"&&t.length>1){let i=t.slice(0,3),a=t.length>i.length?", and more":"";return`Universal (creates ${e} for ${i.join(", ")}${a})`}let[o]=t;return`${o} (creates ${e})`},N1=()=>{let e=new Map;for(let o of j){let i=e.get(o.config.path)??[];i.push(o),e.set(o.config.path,i)}return[...e.entries()].map(([o,i])=>{let[a]=i,r=i.map(c=>F1(c.name)),l=o==="AGENTS.md"&&i.length>1;return{agentIds:i.map(c=>c.id),displayName:l?"Universal":F1(a.name),id:l?"universal":a.id,path:o,promptLabel:ko(o,r),representativeAgentId:a.id}}).toSorted((o,i)=>o.path==="AGENTS.md"?-1:i.path==="AGENTS.md"?1:0)},O1=(e,t,o)=>{let i=j.find(f=>f.id===e);if(!i)throw new Error(`Agent "${e}" not found`);let a=re.find(f=>f.id===o);if(!a)throw new Error(`Provider "${o}" not found`);let r=yo(t,""),l=se(r,a.name),c=i.config.header?`${i.config.header}
158
+ export default config;`,lang:"typescript",name:"oxfmt.config.ts"}],description:"The fastest linter available. Oxlint is part of the Oxc project, running 50-100x faster than ESLint with a focus on catching bugs and reducing false positives.",id:"oxlint",includes:["Oxlint","Oxfmt"],logo:B1,name:"Oxlint + Oxfmt",subtitle:"The fastest linter available",vscodeExtensionId:"oxc.oxc-vscode"}];import{addDevDependency as Ti,detectPackageManager as Gi}from"nypm";import{readFile as vo,writeFile as ke}from"fs/promises";import{dlxCommand as yo}from"nypm";var F1=e=>e.replace(/ Code$/,"").replace(/ Agent$/,""),ko=(e,t)=>{if(e==="AGENTS.md"&&t.length>1){let i=t.slice(0,3),a=t.length>i.length?", and more":"";return`Universal (creates ${e} for ${i.join(", ")}${a})`}let[o]=t;return`${o} (creates ${e})`},N1=()=>{let e=new Map;for(let o of j){let i=e.get(o.config.path)??[];i.push(o),e.set(o.config.path,i)}return[...e.entries()].map(([o,i])=>{let[a]=i,r=i.map(c=>F1(c.name)),l=o==="AGENTS.md"&&i.length>1;return{agentIds:i.map(c=>c.id),displayName:l?"Universal":F1(a.name),id:l?"universal":a.id,path:o,promptLabel:ko(o,r),representativeAgentId:a.id}}).toSorted((o,i)=>o.path==="AGENTS.md"?-1:i.path==="AGENTS.md"?1:0)},O1=(e,t,o)=>{let i=j.find(f=>f.id===e);if(!i)throw new Error(`Agent "${e}" not found`);let a=re.find(f=>f.id===o);if(!a)throw new Error(`Provider "${o}" not found`);let r=yo(t,""),l=se(r,a.name),c=i.config.header?`${i.config.header}
169
159
 
170
160
  ${l}`:l;return{create:async()=>{await b(i.config.path),await ke(i.config.path,c)},exists:()=>m(i.config.path),update:async()=>{await b(i.config.path);let f=await m(i.config.path);if(!(i.config.appendMode&&f)){await ke(i.config.path,c);return}let u=await vo(i.config.path,"utf-8");u.includes(l.trim())||await ke(i.config.path,`${u}
171
161
 
@@ -277,7 +267,7 @@ export default [
277
267
  `},pe={create:async e=>{let t=X1(e);await Z1(Y1,t)},exists:async()=>await ni()!==null,update:async e=>{let t=X1(e);await Z1(Y1,t)}};import{writeFile as et}from"fs/promises";var Ie="./oxfmt.config.ts",tt=`import config from "ultracite/oxfmt";
278
268
 
279
269
  export default config;
280
- `,me={create:async()=>await et(Ie,tt),exists:async()=>await m(Ie),update:async()=>await et(Ie,tt)};import{readFile as ai,writeFile as ot}from"fs/promises";var fe="./oxlint.config.ts",Q=e=>`ultracite/config/oxlint/${e}`,it=e=>{let t=e.split("/").pop();return t==="core"?"core":t},st=e=>{let t=e.map(i=>`import ${it(i)} from "${i}/index.js";`).join(`
270
+ `,me={create:async()=>await et(Ie,tt),exists:async()=>await m(Ie),update:async()=>await et(Ie,tt)};import{readFile as ai,writeFile as ot}from"fs/promises";var fe="./oxlint.config.ts",Q=e=>`ultracite/oxlint/${e}`,it=e=>{let t=e.split("/").pop();return t==="core"?"core":t},st=e=>{let t=e.map(i=>`import ${it(i)} from "${i}";`).join(`
281
271
  `),o=e.map(i=>` ${it(i)},`).join(`
282
272
  `);return`import { defineConfig } from "oxlint";
283
273
 
@@ -288,6 +278,6 @@ export default defineConfig({
288
278
  ${o}
289
279
  ],
290
280
  });
291
- `},ge={create:async e=>{let t=[Q("core")];if(e?.frameworks&&e.frameworks.length>0)for(let o of e.frameworks)t.push(Q(o));return await ot(fe,st(t))},exists:async()=>await m(fe),update:async e=>{let t=await ai(fe,"utf-8"),o=[],i=t.matchAll(/import \w+ from ["']([^"']+)["']/g);for(let l of i)l[1].startsWith("ultracite/config/oxlint/")&&o.push(l[1].replace(/\/index\.[tj]s$/,""));if(o.length===0){let l=t.match(/extends:\s*\[([\s\S]*?)\]/);if(l?.[1]){let c=l[1].matchAll(/"([^"]+)"/g);for(let f of c){let u=f[1].replace(/^\.\/node_modules\/ultracite\/config\/oxlint\//,"ultracite/config/oxlint/");o.push(u)}}}let a=l=>o.some(c=>c===Q(l)),r=[...o];if(a("core")||r.push(Q("core")),e?.frameworks&&e.frameworks.length>0)for(let l of e.frameworks)a(l)||r.push(Q(l));await ot(fe,st(r))}};import{readFile as ri,writeFile as nt}from"fs/promises";var li=["./.prettierrc.mjs","./prettier.config.mjs","./.prettierrc.mts","./prettier.config.mts","./.prettierrc.cjs","./prettier.config.cjs","./.prettierrc.cts","./prettier.config.cts","./.prettierrc.js","./prettier.config.js","./.prettierrc.ts","./prettier.config.ts","./.prettierrc","./.prettierrc.json","./.prettierrc.json5","./.prettierrc.yml","./.prettierrc.yaml","./.prettierrc.toml"],at="./prettier.config.mjs",ci=async()=>{try{return"prettier"in JSON.parse(await ri("./package.json","utf-8"))}catch{return!1}},di=async()=>{if(await ci())return"./package.json";for(let e of li)if(await m(e))return e;return null},rt=()=>`export { default } from "ultracite/prettier";
281
+ `},ge={create:async e=>{let t=[Q("core")];if(e?.frameworks&&e.frameworks.length>0)for(let o of e.frameworks)t.push(Q(o));return await ot(fe,st(t))},exists:async()=>await m(fe),update:async e=>{let t=await ai(fe,"utf-8"),o=[],i=t.matchAll(/import \w+ from ["']([^"']+)["']/g);for(let l of i)l[1].startsWith("ultracite/oxlint/")&&o.push(l[1].replace(/\/index\.[tj]s$/,""));if(o.length===0){let l=t.match(/extends:\s*\[([\s\S]*?)\]/);if(l?.[1]){let c=l[1].matchAll(/"([^"]+)"/g);for(let f of c){let u=f[1].replace(/^\.\/node_modules\/ultracite\/config\/oxlint\//,"ultracite/oxlint/");o.push(u)}}}let a=l=>o.some(c=>c===Q(l)),r=[...o];if(a("core")||r.push(Q("core")),e?.frameworks&&e.frameworks.length>0)for(let l of e.frameworks)a(l)||r.push(Q(l));await ot(fe,st(r))}};import{readFile as ri,writeFile as nt}from"fs/promises";var li=["./.prettierrc.mjs","./prettier.config.mjs","./.prettierrc.mts","./prettier.config.mts","./.prettierrc.cjs","./prettier.config.cjs","./.prettierrc.cts","./prettier.config.cts","./.prettierrc.js","./prettier.config.js","./.prettierrc.ts","./prettier.config.ts","./.prettierrc","./.prettierrc.json","./.prettierrc.json5","./.prettierrc.yml","./.prettierrc.yaml","./.prettierrc.toml"],at="./prettier.config.mjs",ci=async()=>{try{return"prettier"in JSON.parse(await ri("./package.json","utf-8"))}catch{return!1}},di=async()=>{if(await ci())return"./package.json";for(let e of li)if(await m(e))return e;return null},rt=()=>`export { default } from "ultracite/prettier";
292
282
  `,ue={create:async()=>{let e=rt();await nt(at,e)},exists:async()=>await di()!==null,update:async()=>{let e=rt();await nt(at,e)}};import{readFile as pi,writeFile as lt}from"fs/promises";var mi=["./.stylelintrc.mjs","./stylelint.config.mjs","./.stylelintrc.cjs","./stylelint.config.cjs","./.stylelintrc.js","./stylelint.config.js","./.stylelintrc","./.stylelintrc.json","./.stylelintrc.yml","./.stylelintrc.yaml"],ct="./stylelint.config.mjs",fi=async()=>{try{return"stylelint"in JSON.parse(await pi("./package.json","utf-8"))}catch{return!1}},gi=async()=>{if(await fi())return"./package.json";for(let e of mi)if(await m(e))return e;return null},dt=()=>`export { default } from "ultracite/stylelint";
293
283
  `,he={create:async()=>{let e=dt();await lt(ct,e)},exists:async()=>await gi()!==null,update:async()=>{let e=dt();await lt(ct,e)}};import{isCancel as ui,select as hi,spinner as wi}from"@clack/prompts";import{dlxCommand as vi}from"nypm";var yi="haydenbleasel/ultracite",pt=e=>vi(e,"skills",{args:["add",yi],short:e==="npm"}),ki=async()=>{let e=await hi({message:"Do you want to install the Ultracite skill?",options:[{label:"Yes, install it",value:"install"},{label:"No, I'll do it later",value:"skip"}]});return!ui(e)&&e==="install"},mt=e=>pt(e),ft=async({packageManager:e,quiet:t=!1,shouldInstall:o})=>{if(!(o??(!t&&await ki())))return!1;let a=pt(e),r=wi();t||r.start("Installing the Ultracite skill...");let l=Ge(a,{stdio:"pipe"}),c=!l.error&&l.status===0;return t||r.stop(c?"Ultracite skill installed.":"Couldn't install the Ultracite skill automatically."),c};import{readFile as bi,writeFile as gt}from"fs/promises";import{glob as xi}from"glob";import{applyEdits as Ci,modify as Si,parse as Ai}from"jsonc-parser";var ut=async()=>{try{return await xi("**/tsconfig*.json",{absolute:!1,ignore:["**/node_modules/**","**/dist/**","**/build/**","**/.next/**"]})}catch{return[]}},zi=e=>{if(!e)return!1;let t=e.compilerOptions;return t?t.strict===!0||t.strictNullChecks===!0:!1},Ui=async e=>{try{let t=await bi(e,"utf-8"),o=Ai(t);if(zi(o))return;if(o===void 0){await gt(e,JSON.stringify({compilerOptions:{strictNullChecks:!0}},null,2));return}let a=Si(t,["compilerOptions","strictNullChecks"],!0,{formattingOptions:{insertSpaces:!0,tabSize:2}}),r=Ci(t,a);await gt(e,r)}catch(t){console.warn(`Failed to update ${e}:`,t)}},Ee={exists:async()=>(await ut()).length>0,update:async()=>{let e=await ut();if(e.length===0){console.warn("No tsconfig.json files found in the project");return}await Promise.all(e.map(t=>Ui(t)))}};var wt=d.devDependencies["@biomejs/biome"],je=d.version,ht="^9.0.0",Bi={"@eslint/js":ht,"@typescript-eslint/eslint-plugin":d.devDependencies["@typescript-eslint/eslint-plugin"],"@typescript-eslint/parser":d.devDependencies["@typescript-eslint/parser"],eslint:ht,"eslint-config-prettier":d.devDependencies["eslint-config-prettier"],"eslint-import-resolver-typescript":d.devDependencies["eslint-import-resolver-typescript"],"eslint-plugin-compat":d.devDependencies["eslint-plugin-compat"],"eslint-plugin-cypress":d.devDependencies["eslint-plugin-cypress"],"eslint-plugin-github":d.devDependencies["eslint-plugin-github"],"eslint-plugin-html":d.devDependencies["eslint-plugin-html"],"eslint-plugin-import-x":d.devDependencies["eslint-plugin-import-x"],"eslint-plugin-n":d.devDependencies["eslint-plugin-n"],"eslint-plugin-prettier":d.devDependencies["eslint-plugin-prettier"],"eslint-plugin-promise":d.devDependencies["eslint-plugin-promise"],"eslint-plugin-sonarjs":d.devDependencies["eslint-plugin-sonarjs"],"eslint-plugin-storybook":d.devDependencies["eslint-plugin-storybook"],"eslint-plugin-unicorn":d.devDependencies["eslint-plugin-unicorn"],"eslint-plugin-unused-imports":d.devDependencies["eslint-plugin-unused-imports"],globals:d.devDependencies.globals,prettier:"latest","prettier-plugin-svelte":d.devDependencies["prettier-plugin-svelte"],"prettier-plugin-tailwindcss":d.devDependencies["prettier-plugin-tailwindcss"],stylelint:"latest"},Di={angular:{"@angular-eslint/eslint-plugin":"latest"},astro:{"eslint-plugin-astro":d.devDependencies["eslint-plugin-astro"]},jest:{"eslint-plugin-jest":d.devDependencies["eslint-plugin-jest"]},next:{"@next/eslint-plugin-next":d.devDependencies["@next/eslint-plugin-next"]},qwik:{"eslint-plugin-qwik":d.devDependencies["eslint-plugin-qwik"]},react:{"@tanstack/eslint-plugin-query":d.devDependencies["@tanstack/eslint-plugin-query"],"eslint-plugin-jsx-a11y":d.devDependencies["eslint-plugin-jsx-a11y"],"eslint-plugin-react":d.devDependencies["eslint-plugin-react"],"eslint-plugin-react-hooks":d.devDependencies["eslint-plugin-react-hooks"]},remix:{"eslint-plugin-remix":d.devDependencies["eslint-plugin-remix"]},solid:{"eslint-plugin-solid":d.devDependencies["eslint-plugin-solid"]},svelte:{"eslint-plugin-svelte":d.devDependencies["eslint-plugin-svelte"]},vitest:{"@vitest/eslint-plugin":d.devDependencies["@vitest/eslint-plugin"]},vue:{"eslint-plugin-vue":d.devDependencies["eslint-plugin-vue"]}},vt=e=>{let t={...Bi};for(let o of e)Object.assign(t,Di[o]);return t},Pi=(e,t,o)=>{let i={ultracite:je};return e==="biome"&&(i["@biomejs/biome"]=wt),e==="eslint"&&Object.assign(i,vt(o)),e==="oxlint"&&(i.oxlint="latest",i.oxfmt="latest",t&&(i["oxlint-tsgolint"]="latest")),i},Fi=async(e,t="biome",o=!0,i=!1,a=!1,r=["react"])=>{let l=w();i||l.start("Installing dependencies...");let c=[`ultracite@${je}`];if(t==="biome"&&c.push(`@biomejs/biome@${wt}`),t==="eslint"&&c.push(...Object.entries(vt(r)).map(([f,u])=>`${f}@${u}`)),t==="oxlint"&&(c.push("oxlint@latest"),c.push("oxfmt@latest"),a&&c.push("oxlint-tsgolint@latest")),o)for(let f of c)await Ti(f,{corepack:!1,packageManager:e,silent:!0,workspace:await S()});else{let f=Pi(t,a,r);await k({devDependencies:f})}await k({scripts:{check:"ultracite check",fix:"ultracite fix"}}),i||l.stop("Dependencies installed.")},Ni=async(e=!1)=>{let t=w();if(e||t.start("Checking for tsconfig.json files..."),await Ee.exists()){e||t.message("Found tsconfig.json files, updating with strictNullChecks..."),await Ee.update(),e||t.stop("tsconfig.json files updated.");return}e||t.stop("No tsconfig.json files found, skipping.")},Oi=async(e,t="biome",o=!1)=>{let i=F.find(l=>l.id===e);if(!i)throw new Error(`Editor "${e}" not found`);let a=L1(e,t),r=w();if(o||r.start(`Checking for ${i.config.path}...`),await a.exists()){o||r.message(`${i.config.path} found, updating...`),await a.update(),o||r.stop(`${i.config.path} updated.`);return}if(o||r.message(`${i.config.path} not found, creating...`),await a.create(),a.extension){let l=re.find(c=>c.id===t)?.vscodeExtensionId;if(!l)throw new Error(`Linter extension not found for ${t}`);o||r.message(`Installing ${l} extension...`);try{if(a.extension(l).status===0){o||r.stop(`${i.config.path} created and ${l} extension installed.`);return}}catch{}o||r.stop(`${i.config.path} created. Install ${l} extension manually.`);return}o||(e==="zed"?r.stop(`${i.config.path} created. Install the Biome extension: https://biomejs.dev/reference/zed/`):r.stop(`${i.config.path} created.`))},Li=async(e,t=!1,o=!1)=>{let i=w();if(t||i.start("Checking for Biome configuration..."),await de.exists()){t||i.message("Biome configuration found, updating..."),await de.update({frameworks:e,typeAware:o}),t||i.stop("Biome configuration updated.");return}t||i.message("Biome configuration not found, creating..."),await de.create({frameworks:e,typeAware:o}),t||i.stop("Biome configuration created.")},Ri=async(e,t=!1)=>{let o=w();if(t||o.start("Checking for ESLint configuration..."),await pe.exists()){t||o.message("ESLint configuration found, updating..."),await pe.update({frameworks:e}),t||o.stop("ESLint configuration updated.");return}t||o.message("ESLint configuration not found, creating..."),await pe.create({frameworks:e}),t||o.stop("ESLint configuration created.")},Mi=async(e,t=!1)=>{let o=w();if(t||o.start("Checking for Oxlint configuration..."),await ge.exists()){t||o.message("Oxlint configuration found, updating..."),await ge.update({frameworks:e}),t||o.stop("Oxlint configuration updated.");return}t||o.message("Oxlint configuration not found, creating..."),await ge.create({frameworks:e}),t||o.stop("Oxlint configuration created.")},$i=async(e=!1)=>{let t=w();if(e||t.start("Checking for Prettier configuration..."),await ue.exists()){e||t.message("Prettier configuration found, updating..."),await ue.update(),e||t.stop("Prettier configuration updated.");return}e||t.message("Prettier configuration not found, creating..."),await ue.create(),e||t.stop("Prettier configuration created.")},_i=async(e=!1)=>{let t=w();if(e||t.start("Checking for Stylelint configuration..."),await he.exists()){e||t.message("Stylelint configuration found, updating..."),await he.update(),e||t.stop("Stylelint configuration updated.");return}e||t.message("Stylelint configuration not found, creating..."),await he.create(),e||t.stop("Stylelint configuration created.")},Vi=async(e=!1)=>{let t=w();if(e||t.start("Checking for oxfmt configuration..."),await me.exists()){e||t.message("oxfmt configuration found, updating..."),await me.update(),e||t.stop("oxfmt configuration updated.");return}e||t.message("oxfmt configuration not found, creating..."),await me.create(),e||t.stop("oxfmt configuration created.")},Wi=async(e,t=!0,o=!1,i=!1)=>{let a=w();if(o||(a.start("Initializing pre-commit hooks..."),a.message("Installing Husky...")),await(t?O.install(e):k({devDependencies:{husky:"latest"},scripts:{prepare:"husky"}})),o||a.message("Initializing Husky..."),O.init(e.name),await O.exists()){o||a.message("Pre-commit hook found, updating..."),await O.update(e.name,i),o||a.stop("Pre-commit hook updated.");return}o||a.message("Pre-commit hook not found, creating..."),await O.create(e.name,i),o||a.stop("Pre-commit hook created.")},Ji=async(e,t=!0,o=!1)=>{let i=w();if(o||(i.start("Initializing lefthook..."),i.message("Installing lefthook...")),await(t?J.install(e):k({devDependencies:{lefthook:"latest"}})),await J.exists()){o||i.message("lefthook.yml found, updating..."),await J.update(e.name),o||i.stop("lefthook.yml updated.");return}o||i.message("lefthook.yml not found, creating..."),await J.create(e.name),o||i.stop("lefthook.yml created.")},qi=async(e,t=!0,o=!1)=>{let i=w();if(o||(i.start("Initializing lint-staged..."),i.message("Installing lint-staged...")),await(t?H.install(e):k({devDependencies:{"lint-staged":"latest"}})),await H.exists()){o||i.message("lint-staged found, updating..."),await H.update(e.name),o||i.stop("lint-staged updated.");return}o||i.message("lint-staged not found, creating..."),await H.create(e.name),o||i.stop("lint-staged created.")},Hi=async(e,t=!1)=>{let o=w();if(t||o.start("Initializing pre-commit..."),await ce.exists()){t||o.message(".pre-commit-config.yaml found, updating..."),await ce.update(e),t||o.stop(".pre-commit-config.yaml updated.");return}t||o.message(".pre-commit-config.yaml not found, creating..."),await ce.create(e),t||o.stop(".pre-commit-config.yaml created.")},yt=async(e,t,o,i,a=!1)=>{let r=w();a||r.start(`Checking for ${t}...`);let l=O1(e,o,i);if(await l.exists()){a||r.message(`${t} found, updating...`),await l.update(),a||r.stop(`${t} updated.`);return}a||r.message(`${t} not found, creating...`),await l.create(),a||r.stop(`${t} created.`)},Ki=async(e,t,o,i=!1)=>{let a=`${e.displayName} (${e.path})`;await yt(e.representativeAgentId,a,t,o,i)},Qi=async(e,t,o="biome",i=!1)=>{let a=w(),r=$.find(c=>c.id===e)?.name??e;i||a.start(`Checking for ${r} hooks...`);let l=R1(e,t,o);if(await l.exists()){i||a.message(`${r} hooks found, updating...`),await l.update(),i||a.stop(`${r} hooks updated.`);return}i||a.message(`${r} hooks not found, creating...`),await l.create(),i||a.stop(`${r} hooks created.`)},kt=async e=>{let t=e??{},o=t.quiet??!1;o||Ei(`Ultracite v${je} Initialization`);try{let{pm:i}=t,a;if(i)a={command:i,name:i};else{let p=await Gi(Ii.cwd());if(!p)throw new Error("No package manager specified or detected");if(!o&&p.warnings)for(let g of p.warnings)Z.warn(g);o||Z.info(`Detected lockfile, using ${p.name}`),i=p.name,a=p}let{linter:r}=t;if(r===void 0)if(o||t.pm||t.editors||t.agents||t.hooks||t.integrations!==void 0||t.frameworks!==void 0)r="biome";else{let g=await ji({message:"Which linter do you want to use?",options:[{label:"Biome (Recommended)",value:"biome"},{label:"ESLint + Prettier + Stylelint",value:"eslint"},{label:"Oxlint + Oxfmt",value:"oxlint"}]});if(R(g)){L("Operation cancelled.");return}r=g}let{frameworks:l}=t;if(l===void 0)if(o||t.pm||t.editors||t.agents||t.hooks||t.integrations!==void 0)l=[];else{let g=await Y({message:"Which frameworks are you using (optional)?",options:[{label:"React",value:"react"},{label:"Next.js",value:"next"},{label:"Solid",value:"solid"},{label:"Vue",value:"vue"},{label:"Svelte",value:"svelte"},{label:"Qwik",value:"qwik"},{label:"Angular",value:"angular"},{label:"Remix / TanStack Router / React Router",value:"remix"},{label:"Astro",value:"astro"},{label:"NestJS",value:"nestjs"},{label:"Jest",value:"jest"},{label:"Vitest / Bun",value:"vitest"}],required:!1});if(R(g)){L("Operation cancelled.");return}l=g}let c=t.editors;if(!c)if(o)c=[];else{let p=await Y({message:"Which editors do you want to configure (recommended)?",options:[{label:"VSCode / Cursor / Windsurf",value:"vscode"},{label:"Zed",value:"zed"}],required:!1});if(R(p)){L("Operation cancelled.");return}c=p}let{agents:f}=t,u=[],{hooks:y}=t,B=N1(),D=B.find(p=>p.id==="universal"),we=Object.fromEntries(j.map(p=>[p.id,p.name]));if(f){if(f.includes("universal")&&D){u=[D];let p=new Set(D.agentIds);f=f.filter(g=>g!=="universal"&&!p.has(g))}}else if(o)f=[];else{let p=await Y({message:"Which agent files do you want to add (optional)?",options:B.map(g=>({label:g.promptLabel,value:g.id})),required:!1});if(R(p)){L("Operation cancelled.");return}u=B.filter(g=>p.includes(g.id))}let bt=Object.fromEntries($.map(p=>[p.id,p.name]));if(!y)if(o)y=[];else{let p=await Y({message:"Which agent hooks do you want to enable (optional)?",options:Object.entries(bt).map(([g,Ct])=>({label:Ct,value:g})),required:!1});if(R(p)){L("Operation cancelled.");return}y=p}let{integrations:C}=t;if(C===void 0)if(o||t.pm||t.editors||t.agents||t.hooks)C=[];else{let g=await Y({message:"Would you like any of the following (optional)?",options:[{label:"Husky pre-commit hook",value:"husky"},{label:"Lefthook pre-commit hook",value:"lefthook"},{label:"Lint-staged",value:"lint-staged"},{label:"pre-commit (Python framework)",value:"pre-commit"}],required:!1});if(R(g)){L("Operation cancelled.");return}C=g}await Fi(a,r,!t.skipInstall,o,t["type-aware"],l),await Ni(o),r==="biome"&&await Li(l,o,t["type-aware"]),r==="eslint"&&(await Ri(l,o),await $i(o),await _i(o)),r==="oxlint"&&(await k({type:"module"}),await Mi(l,o),await Vi(o));for(let p of c??[])await Oi(p,r,o);for(let p of u)await Ki(p,i,r,o);for(let p of f??[])await yt(p,we[p],i,r,o);for(let p of y??[])await Qi(p,i,r,o);if(C?.includes("husky")){let p=C?.includes("lint-staged")??!1;await Wi(a,!t.skipInstall,o,p)}C?.includes("lefthook")&&await Ji(a,!t.skipInstall,o),C?.includes("lint-staged")&&await qi(a,!t.skipInstall,o),C?.includes("pre-commit")&&await Hi(i,o),o||Z.success("Successfully initialized Ultracite!");let xt=await ft({packageManager:i,quiet:o,shouldInstall:t.installSkill});!o&&!xt&&Z.info(`You can install the Ultracite skill later with \`${mt(i)}\`.`)}catch(i){let a=i instanceof Error?i.message:"Unknown error";throw o||Z.error(`Failed to initialize Ultracite configuration: ${a}`),i}};var M=new Zi;M.name("ultracite").version(d.version).description(d.description);M.command("init").description("Initialize Ultracite in the current directory").option("--pm <pm>","Package manager to use").option("--linter <linter>","Linter to use").option("--editors <editors...>","Editors to configure").option("--agents <agents...>","Agents to enable (use universal for AGENTS.md)").option("--hooks <hooks...>","Hooks to enable").option("--frameworks <frameworks...>","Frameworks being used").option("--integrations <integrations...>","Integrations to enable").option("--install-skill","Install the reusable Ultracite skill after setup").option("--type-aware","Enable type-aware linting (enables project/scanner rules)").option("--skip-install","Skip installing dependencies").option("--quiet","Suppress interactive prompts").action(async e=>{await kt({agents:e.agents,editors:e.editors,frameworks:e.frameworks,hooks:e.hooks,installSkill:e.installSkill,integrations:e.integrations,linter:e.linter,pm:e.pm,quiet:e.quiet??(process.env.CI==="true"||process.env.CI==="1"),skipInstall:e.skipInstall,"type-aware":e.typeAware})});M.command("check").argument("[files...]","Files to check").description("Run linter without fixing files. Unknown options are passed to the underlying linter.").allowUnknownOption().action(async e=>{let t=process.argv.indexOf("check"),i=process.argv.slice(t+1).filter(r=>r.startsWith("-")),a=e.filter(r=>!r.startsWith("--"));await Pe(a,i)});M.command("fix").argument("[files...]","Files to fix").description("Run linter and fix files. Unknown options are passed to the underlying linter.").allowUnknownOption().action(async e=>{let t=process.argv.indexOf("fix"),i=process.argv.slice(t+1).filter(r=>r.startsWith("-")),a=e.filter(r=>!r.startsWith("--"));await Ne(a,i)});M.command("doctor").description("Verify your Ultracite setup").action(async()=>{await Fe()});process.env.TEST||M.parse();export{M as program};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultracite",
3
- "version": "7.5.2",
3
+ "version": "7.5.4",
4
4
  "description": "The AI-ready formatter that helps you write and generate code faster.",
5
5
  "keywords": [
6
6
  "biome",
@@ -35,8 +35,8 @@
35
35
  },
36
36
  "./biome/*": "./config/biome/*/biome.jsonc",
37
37
  "./eslint/*": "./config/eslint/*/eslint.config.mjs",
38
- "./oxlint/*": "./config/oxlint/*/index.js",
39
- "./oxfmt": "./config/oxfmt/index.js",
38
+ "./oxlint/*": "./config/oxlint/*/index.ts",
39
+ "./oxfmt": "./config/oxfmt/index.ts",
40
40
  "./prettier": "./config/prettier/prettier.config.mjs",
41
41
  "./stylelint": "./config/stylelint/stylelint.config.mjs",
42
42
  "./*": "./config/biome/*/biome.jsonc"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,8 +1,6 @@
1
1
  import { defineConfig } from "oxlint";
2
2
 
3
3
  export default defineConfig({
4
- plugins: ["nextjs"],
5
- rules: {},
6
4
  overrides: [
7
5
  {
8
6
  files: ["**/next-env.d.ts"],
@@ -11,4 +9,6 @@ export default defineConfig({
11
9
  },
12
10
  },
13
11
  ],
12
+ plugins: ["nextjs"],
13
+ rules: {},
14
14
  });
File without changes
@@ -3,19 +3,19 @@ import { defineConfig } from "oxlint";
3
3
  export default defineConfig({
4
4
  plugins: ["react", "react-perf", "jsx-a11y"],
5
5
  rules: {
6
- "react/only-export-components": "off",
6
+ "jsx-a11y/no-autofocus": "off",
7
+ "react-perf/jsx-no-jsx-as-prop": "off",
8
+ "react-perf/jsx-no-new-array-as-prop": "off",
9
+ "react-perf/jsx-no-new-object-as-prop": "off",
7
10
  "react/jsx-boolean-value": "off",
8
- "react/react-in-jsx-scope": "off",
9
11
  "react/jsx-filename-extension": "off",
10
- "react/no-unknown-property": "off",
11
- "react/jsx-props-no-spreading": "off",
12
12
  "react/jsx-max-depth": "off",
13
- "react/no-multi-comp": "off",
13
+ "react/jsx-props-no-spreading": "off",
14
14
 
15
- "react-perf/jsx-no-jsx-as-prop": "off",
16
- "react-perf/jsx-no-new-object-as-prop": "off",
17
- "react-perf/jsx-no-new-array-as-prop": "off",
15
+ "react/no-multi-comp": "off",
16
+ "react/no-unknown-property": "off",
17
+ "react/only-export-components": "off",
18
18
 
19
- "jsx-a11y/no-autofocus": "off",
19
+ "react/react-in-jsx-scope": "off",
20
20
  },
21
21
  });
File without changes
File without changes
File without changes
File without changes
File without changes