ultracite 7.3.1 → 7.3.2
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 +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{Command as oi}from"commander";var y={name:"ultracite",version:"7.3.1",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/index.js","dist/index.d.ts","README.md"],type:"module",exports:{"./biome/*":"./config/biome/*/biome.jsonc","./eslint/*":"./config/eslint/*/eslint.config.mjs","./oxlint/*":"./config/oxlint/*/.oxlintrc.json","./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"},dependencies:{"@clack/prompts":"^1.1.0",commander:"^14.0.3",deepmerge:"^4.3.1",glob:"^13.0.6","jsonc-parser":"^3.3.1",nypm:"^0.6.5"},devDependencies:{"@biomejs/biome":"2.4.7","@eslint/js":"^10.0.1","@next/eslint-plugin-next":"^16.1.6","@repo/data":"workspace:*","@tanstack/eslint-plugin-query":"^5.91.4","@types/node":"^25.3.3","@typescript-eslint/eslint-plugin":"^8.56.1","@typescript-eslint/parser":"^8.56.1","@vitest/eslint-plugin":"^1.6.12","eslint-config-prettier":"^10.1.8","eslint-import-resolver-typescript":"^4.4.4","eslint-plugin-angular":"^5.0.0","eslint-plugin-astro":"^1.6.0","eslint-plugin-compat":"^7.0.1","eslint-plugin-cypress":"^6.1.0","eslint-plugin-github":"6.0.0","eslint-plugin-html":"^8.1.4","eslint-plugin-import-x":"^4.12.2","eslint-plugin-jest":"^29.15.0","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.1","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.0","eslint-plugin-storybook":"^10.2.15","eslint-plugin-svelte":"^3.15.0","eslint-plugin-unicorn":"^63.0.0","eslint-plugin-unused-imports":"^4.4.1","eslint-plugin-vue":"^10.8.0",globals:"^17.4.0",oxlint:"^1.51.0","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.10"};import{spawnSync as I}from"child_process";import F from"process";import{access as Yt,mkdir as qt,readFile as F1,writeFile as te}from"fs/promises";import{dirname as B1,join as x1}from"path";import E1 from"process";import{parse as ee}from"jsonc-parser";var m=E1.platform==="win32",c=async t=>{try{return await Yt(t),!0}catch{return!1}},k=async()=>{if(await c("pnpm-workspace.yaml"))return!0;try{let t=ee(await F1("package.json","utf8"));return t?!!t.workspaces||!!t.workspace:!1}catch{return!1}},x=async({dependencies:t,devDependencies:e,scripts:i})=>{let o=await F1("package.json","utf8"),n=JSON.parse(o),s={...n};(n.devDependencies||e)&&(s.devDependencies={...n.devDependencies,...e}),(n.dependencies||t)&&(s.dependencies={...n.dependencies,...t}),(n.scripts||i)&&(s.scripts={...n.scripts,...i}),await te("package.json",JSON.stringify(s,null,2))},ie=/[ $(){}[\]&|;<>!"'`*?#~]/,oe=/'/g,u=t=>t.map(e=>ie.test(e)?`'${e.replace(oe,"'\\''")}' `:e),v=async t=>{let e=B1(t);if(e!=="."){let i=e.startsWith("./")?e.slice(2):e;await qt(i,{recursive:!0})}},ne=["biome.json","biome.jsonc"],se=["eslint.config.mjs","eslint.config.js","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts"],re=".oxlintrc.json",t1=async()=>{let t=E1.cwd();for(;;){for(let i of ne)if(await c(x1(t,i)))return"biome";for(let i of se)if(await c(x1(t,i)))return"eslint";if(await c(x1(t,re)))return"oxlint";let e=B1(t);if(e===t)break;t=e}return null};var ae=(t,e)=>{let i=["check","--no-errors-on-unmatched",...e];t.length>0?i.push(...u(t)):i.push("./");let o=I("biome",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run Biome: ${o.error.message}`);o.status!==0&&F.exit(o.status??1)},le=(t,e)=>{let i=[...e,...t.length>0?u(t):["."]],o=I("eslint",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run ESLint: ${o.error.message}`);o.status!==0&&F.exit(o.status??1)},ce=(t,e)=>{let i=["--check",...e,...t.length>0?u(t):["."]],o=I("prettier",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run Prettier: ${o.error.message}`);o.status!==0&&F.exit(o.status??1)},fe=(t,e)=>{let i=[...e,...t.length>0?u(t):["."]],o=I("stylelint",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run Stylelint: ${o.error.message}`);o.status!==0&&F.exit(o.status??1)},de=(t,e)=>{let i=[...e,...t.length>0?u(t):["."]],o=I("oxlint",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run Oxlint: ${o.error.message}`);o.status!==0&&F.exit(o.status??1)},me=(t,e)=>{let i=["--check",...e,...t.length>0?u(t):["."]],o=I("oxfmt",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run oxfmt: ${o.error.message}`);o.status!==0&&F.exit(o.status??1)},U1=async(t=[],e=[])=>{let i=await t1();if(!i)throw new Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(i){case"eslint":{await ce(t,[]),await le(t,e),await fe(t,[]);break}case"oxlint":{await me(t,[]),await de(t,e);break}default:await ae(t,e)}};import{spawnSync as y1}from"child_process";import{existsSync as C}from"fs";import{readFile as i1}from"fs/promises";import{join as S}from"path";import j from"process";import{intro as pe,log as e1,outro as v1,spinner as ge}from"@clack/prompts";import{parse as $1}from"jsonc-parser";var ue=[".prettierrc",".prettierrc.js",".prettierrc.cjs",".prettierrc.mjs",".prettierrc.json",".prettierrc.yaml",".prettierrc.yml","prettier.config.js","prettier.config.mjs","prettier.config.cjs"],he=[".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"],we=()=>{let t=y1("biome",["--version"],{encoding:"utf8",shell:m});return t.status===0&&t.stdout?{message:`Biome is installed (${t.stdout.trim()})`,name:"Biome installation",status:"pass"}:{message:"Biome is not installed or not accessible",name:"Biome installation",status:"fail"}},xe=()=>{let t=y1("eslint",["--version"],{encoding:"utf8",shell:m});return t.status===0&&t.stdout?{message:`ESLint is installed (${t.stdout.trim()})`,name:"ESLint installation",status:"pass"}:{message:"ESLint is not installed (optional)",name:"ESLint installation",status:"warn"}},ve=()=>{let t=y1("oxlint",["--version"],{encoding:"utf8",shell:m});return t.status===0&&t.stdout?{message:`Oxlint is installed (${t.stdout.trim()})`,name:"Oxlint installation",status:"pass"}:{message:"Oxlint is not installed (optional)",name:"Oxlint installation",status:"warn"}},ye=async()=>{let t=S(j.cwd(),"biome.json"),e=S(j.cwd(),"biome.jsonc"),i=null;if(C(t)?i=t:C(e)&&(i=e),!i)return{message:"No biome.json or biome.jsonc file found",name:"Biome configuration",status:"warn"};try{let o=await i1(i,"utf8"),n=$1(o);return Array.isArray(n?.extends)&&n.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"}}},ke=async()=>{let t=["eslint.config.mjs","eslint.config.js","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts"],e=null;for(let i of t){let o=S(j.cwd(),i);if(C(o)){e=o;break}}if(!e)return{message:"No eslint.config.* file found (optional)",name:"ESLint configuration",status:"warn"};try{return(await i1(e,"utf8")).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"}}},be=t=>`./node_modules/ultracite/config/oxlint/${t}/.oxlintrc.json`,ze=async()=>{let t=S(j.cwd(),".oxlintrc.json");if(!C(t))return{message:"No .oxlintrc.json file found (optional)",name:"Oxlint configuration",status:"warn"};try{let e=await i1(t,"utf8"),i=$1(e);return Array.isArray(i?.extends)&&i.extends.includes(be("core"))?{message:".oxlintrc.json extends ultracite oxlint config",name:"Oxlint configuration",status:"pass"}:{message:".oxlintrc.json exists but doesn't extend ultracite config",name:"Oxlint configuration",status:"warn"}}catch{return{message:"Could not parse .oxlintrc.json file",name:"Oxlint configuration",status:"fail"}}},Ce=async()=>{let t=S(j.cwd(),"package.json");if(!C(t))return{message:"No package.json found",name:"Ultracite dependency",status:"warn"};try{let e=JSON.parse(await i1(t,"utf8")),i=e.dependencies?.ultracite||e.devDependencies?.ultracite||e.peerDependencies?.ultracite;return i?{message:`Ultracite is in package.json (${i})`,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"}}},Se=()=>{let t=ue.some(o=>C(S(j.cwd(),o))),i=he.filter(o=>!o.startsWith("eslint.config")).some(o=>C(S(j.cwd(),o)));if(t||i){let o=[];return t&&o.push("Prettier"),i&&o.push("ESLint (legacy config)"),{message:`Found potentially conflicting tools: ${o.join(", ")}`,name:"Conflicting tools",status:"warn"}}return{message:"No conflicting formatting/linting tools found",name:"Conflicting tools",status:"pass"}},b=async(t,e)=>{let i=ge();i.start(`Checking ${e}...`);let o=await t();return o.status==="pass"||o.status,i.stop(o.message),o},_1=async()=>{pe(`Ultracite v${y.version} Doctor`);let t=[await b(we,"Biome installation"),await b(xe,"ESLint installation"),await b(ve,"Oxlint installation"),await b(ye,"Biome configuration"),await b(ke,"ESLint configuration"),await b(ze,"Oxlint configuration"),await b(Ce,"Ultracite dependency"),await b(Se,"conflicting tools")],e=t.filter(n=>n.status==="pass").length,i=t.filter(n=>n.status==="fail").length,o=t.filter(n=>n.status==="warn").length;if(e1.info(`Summary: ${e} passed, ${o} warnings, ${i} failed`),i>0)throw e1.error("Some checks failed. Run 'ultracite init' to fix issues."),v1("Doctor complete"),new Error("Doctor checks failed");if(o>0){e1.warn("Some optional improvements available. Run 'ultracite init' to configure."),v1("Doctor complete");return}e1.success("Everything looks good!"),v1("Doctor complete")};import{spawnSync as B}from"child_process";import E from"process";var je=(t,e)=>{let i=["check","--write","--no-errors-on-unmatched",...e];t.length>0?i.push(...u(t)):i.push("./");let o=B("biome",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run Biome: ${o.error.message}`);o.status!==0&&E.exit(o.status??1)},Pe=(t,e)=>{let i=["--fix",...e,...t.length>0?u(t):["."]],o=B("eslint",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run ESLint: ${o.error.message}`);o.status!==0&&E.exit(o.status??1)},Oe=(t,e)=>{let i=["--write",...e,...t.length>0?u(t):["."]],o=B("prettier",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run Prettier: ${o.error.message}`);o.status!==0&&E.exit(o.status??1)},Ae=(t,e)=>{let i=["--fix",...e,...t.length>0?u(t):["."]],o=B("stylelint",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run Stylelint: ${o.error.message}`);o.status!==0&&E.exit(o.status??1)},Ie=(t,e)=>{let i=e.includes("--unsafe"),o=e.filter(r=>r!=="--unsafe"),n=[i?"--fix-dangerously":"--fix",...o,...t.length>0?u(t):["."]],s=B("oxlint",n,{shell:m,stdio:"inherit"});if(s.error)throw new Error(`Failed to run Oxlint: ${s.error.message}`);s.status!==0&&E.exit(s.status??1)},Fe=(t,e)=>{let i=["--write",...e,...t.length>0?u(t):["."]],o=B("oxfmt",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run oxfmt: ${o.error.message}`);o.status!==0&&E.exit(o.status??1)},L1=async(t,e=[])=>{let i=await t1();if(!i)throw new Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(i){case"eslint":{await Oe(t,[]),await Pe(t,e),await Ae(t,[]);break}case"oxlint":{await Fe(t,[]),await Ie(t,e);break}default:await je(t,e)}};import U3 from"process";import{cancel as R,intro as $3,isCancel as T,log as Z,multiselect as Y,select as _3,spinner as p}from"@clack/prompts";var D1="./aider-K7JLZT2D.svg";var N1="./amazon-q-TSOJNPXB.svg";var R1="./amp-EV4LVL5I.svg";var T1="./augmentcode-Q62PVXKO.svg";var G1="./claude-6DLEHRDQ.svg";var M1="./cline-6HWKIYN7.svg";var J1="./codex-NQZ5TJCL.svg";var W1="./copilot-L2IY45R2.svg";var H1="./crush-LYLRDQGZ.svg";var o1="./cursor-GQNH5LCA.svg";var V1="./droid-266OHJBT.svg";var X1="./firebase-studio-ILLWWYU7.svg";var Q1="./firebender-UNO6LSZG.svg";var K1="./gemini-OYS6V4BH.svg";var Z1="./goose-XBIEVD4H.svg";var Y1="./jules-HJPVWU73.svg";var q1="./junie-RUWBUV6N.svg";var tt="./kilo-code-4QYUYY2E.svg";var et="./mistral-HQ63EC2B.svg";var it="./open-hands-K5EYKO6T.svg";var ot="./opencode-K3274JKQ.svg";var nt="./qwen-N3D5CQYL.svg";var st="./roo-code-CVLBTS7D.svg";var rt="./vercel-27VSITAQ.svg";var at="./warp-OZKAAQRT.svg";var U=[{config:{appendMode:!0,path:".claude/CLAUDE.md"},description:"Anthropic's official CLI for Claude, an agentic coding tool that lives in your terminal.",hooks:{getContent:t=>({hooks:{PostToolUse:[{hooks:[{command:t,type:"command"}],matcher:"Write|Edit"}]}}),path:".claude/settings.json"},id:"claude",logo:G1,name:"Claude Code",subtitle:"Anthropic's agentic CLI"},{config:{appendMode:!0,path:"AGENTS.md"},description:"OpenAI's cloud-based coding agent for autonomous software development tasks.",id:"codex",logo:J1,name:"Codex",subtitle:"OpenAI's coding agent"},{config:{appendMode:!0,path:"AGENTS.md"},description:"Google's asynchronous AI coding agent that works in the background to complete development tasks.",id:"jules",logo:Y1,name:"Jules",subtitle:"Google's async agent"},{config:{appendMode:!0,header:`---
|
|
2
|
+
import{Command as oi}from"commander";var y={name:"ultracite",version:"7.3.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/index.js","dist/index.d.ts","README.md"],type:"module",exports:{"./biome/*":"./config/biome/*/biome.jsonc","./eslint/*":"./config/eslint/*/eslint.config.mjs","./oxlint/*":"./config/oxlint/*/.oxlintrc.json","./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"},dependencies:{"@clack/prompts":"^1.1.0",commander:"^14.0.3",deepmerge:"^4.3.1",glob:"^13.0.6","jsonc-parser":"^3.3.1",nypm:"^0.6.5"},devDependencies:{"@biomejs/biome":"2.4.7","@eslint/js":"^10.0.1","@next/eslint-plugin-next":"^16.1.6","@repo/data":"workspace:*","@tanstack/eslint-plugin-query":"^5.91.4","@types/node":"^25.3.3","@typescript-eslint/eslint-plugin":"^8.56.1","@typescript-eslint/parser":"^8.56.1","@vitest/eslint-plugin":"^1.6.12","eslint-config-prettier":"^10.1.8","eslint-import-resolver-typescript":"^4.4.4","eslint-plugin-angular":"^5.0.0","eslint-plugin-astro":"^1.6.0","eslint-plugin-compat":"^7.0.1","eslint-plugin-cypress":"^6.1.0","eslint-plugin-github":"6.0.0","eslint-plugin-html":"^8.1.4","eslint-plugin-import-x":"^4.12.2","eslint-plugin-jest":"^29.15.0","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.1","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.0","eslint-plugin-storybook":"^10.2.15","eslint-plugin-svelte":"^3.15.0","eslint-plugin-unicorn":"^63.0.0","eslint-plugin-unused-imports":"^4.4.1","eslint-plugin-vue":"^10.8.0",globals:"^17.4.0",oxlint:"^1.51.0","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.10"};import{spawnSync as I}from"child_process";import F from"process";import{access as Yt,mkdir as qt,readFile as F1,writeFile as te}from"fs/promises";import{dirname as B1,join as x1}from"path";import E1 from"process";import{parse as ee}from"jsonc-parser";var m=E1.platform==="win32",c=async t=>{try{return await Yt(t),!0}catch{return!1}},k=async()=>{if(await c("pnpm-workspace.yaml"))return!0;try{let t=ee(await F1("package.json","utf8"));return t?!!t.workspaces||!!t.workspace:!1}catch{return!1}},x=async({dependencies:t,devDependencies:e,scripts:i})=>{let o=await F1("package.json","utf8"),n=JSON.parse(o),s={...n};(n.devDependencies||e)&&(s.devDependencies={...n.devDependencies,...e}),(n.dependencies||t)&&(s.dependencies={...n.dependencies,...t}),(n.scripts||i)&&(s.scripts={...n.scripts,...i}),await te("package.json",JSON.stringify(s,null,2))},ie=/[ $(){}[\]&|;<>!"'`*?#~]/,oe=/'/g,u=t=>t.map(e=>ie.test(e)?`'${e.replace(oe,"'\\''")}' `:e),v=async t=>{let e=B1(t);if(e!=="."){let i=e.startsWith("./")?e.slice(2):e;await qt(i,{recursive:!0})}},ne=["biome.json","biome.jsonc"],se=["eslint.config.mjs","eslint.config.js","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts"],re=[".oxlintrc.json",".oxlintrc.mjs","oxlint.config.ts"],t1=async()=>{let t=E1.cwd();for(;;){for(let i of ne)if(await c(x1(t,i)))return"biome";for(let i of se)if(await c(x1(t,i)))return"eslint";for(let i of re)if(await c(x1(t,i)))return"oxlint";let e=B1(t);if(e===t)break;t=e}return null};var ae=(t,e)=>{let i=["check","--no-errors-on-unmatched",...e];t.length>0?i.push(...u(t)):i.push("./");let o=I("biome",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run Biome: ${o.error.message}`);o.status!==0&&F.exit(o.status??1)},le=(t,e)=>{let i=[...e,...t.length>0?u(t):["."]],o=I("eslint",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run ESLint: ${o.error.message}`);o.status!==0&&F.exit(o.status??1)},ce=(t,e)=>{let i=["--check",...e,...t.length>0?u(t):["."]],o=I("prettier",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run Prettier: ${o.error.message}`);o.status!==0&&F.exit(o.status??1)},fe=(t,e)=>{let i=[...e,...t.length>0?u(t):["."]],o=I("stylelint",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run Stylelint: ${o.error.message}`);o.status!==0&&F.exit(o.status??1)},de=(t,e)=>{let i=[...e,...t.length>0?u(t):["."]],o=I("oxlint",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run Oxlint: ${o.error.message}`);o.status!==0&&F.exit(o.status??1)},me=(t,e)=>{let i=["--check",...e,...t.length>0?u(t):["."]],o=I("oxfmt",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run oxfmt: ${o.error.message}`);o.status!==0&&F.exit(o.status??1)},U1=async(t=[],e=[])=>{let i=await t1();if(!i)throw new Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(i){case"eslint":{await ce(t,[]),await le(t,e),await fe(t,[]);break}case"oxlint":{await me(t,[]),await de(t,e);break}default:await ae(t,e)}};import{spawnSync as y1}from"child_process";import{existsSync as C}from"fs";import{readFile as i1}from"fs/promises";import{join as S}from"path";import j from"process";import{intro as pe,log as e1,outro as v1,spinner as ge}from"@clack/prompts";import{parse as $1}from"jsonc-parser";var ue=[".prettierrc",".prettierrc.js",".prettierrc.cjs",".prettierrc.mjs",".prettierrc.json",".prettierrc.yaml",".prettierrc.yml","prettier.config.js","prettier.config.mjs","prettier.config.cjs"],he=[".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"],we=()=>{let t=y1("biome",["--version"],{encoding:"utf8",shell:m});return t.status===0&&t.stdout?{message:`Biome is installed (${t.stdout.trim()})`,name:"Biome installation",status:"pass"}:{message:"Biome is not installed or not accessible",name:"Biome installation",status:"fail"}},xe=()=>{let t=y1("eslint",["--version"],{encoding:"utf8",shell:m});return t.status===0&&t.stdout?{message:`ESLint is installed (${t.stdout.trim()})`,name:"ESLint installation",status:"pass"}:{message:"ESLint is not installed (optional)",name:"ESLint installation",status:"warn"}},ve=()=>{let t=y1("oxlint",["--version"],{encoding:"utf8",shell:m});return t.status===0&&t.stdout?{message:`Oxlint is installed (${t.stdout.trim()})`,name:"Oxlint installation",status:"pass"}:{message:"Oxlint is not installed (optional)",name:"Oxlint installation",status:"warn"}},ye=async()=>{let t=S(j.cwd(),"biome.json"),e=S(j.cwd(),"biome.jsonc"),i=null;if(C(t)?i=t:C(e)&&(i=e),!i)return{message:"No biome.json or biome.jsonc file found",name:"Biome configuration",status:"warn"};try{let o=await i1(i,"utf8"),n=$1(o);return Array.isArray(n?.extends)&&n.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"}}},ke=async()=>{let t=["eslint.config.mjs","eslint.config.js","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts"],e=null;for(let i of t){let o=S(j.cwd(),i);if(C(o)){e=o;break}}if(!e)return{message:"No eslint.config.* file found (optional)",name:"ESLint configuration",status:"warn"};try{return(await i1(e,"utf8")).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"}}},be=t=>`./node_modules/ultracite/config/oxlint/${t}/.oxlintrc.json`,ze=async()=>{let t=S(j.cwd(),".oxlintrc.json");if(!C(t))return{message:"No .oxlintrc.json file found (optional)",name:"Oxlint configuration",status:"warn"};try{let e=await i1(t,"utf8"),i=$1(e);return Array.isArray(i?.extends)&&i.extends.includes(be("core"))?{message:".oxlintrc.json extends ultracite oxlint config",name:"Oxlint configuration",status:"pass"}:{message:".oxlintrc.json exists but doesn't extend ultracite config",name:"Oxlint configuration",status:"warn"}}catch{return{message:"Could not parse .oxlintrc.json file",name:"Oxlint configuration",status:"fail"}}},Ce=async()=>{let t=S(j.cwd(),"package.json");if(!C(t))return{message:"No package.json found",name:"Ultracite dependency",status:"warn"};try{let e=JSON.parse(await i1(t,"utf8")),i=e.dependencies?.ultracite||e.devDependencies?.ultracite||e.peerDependencies?.ultracite;return i?{message:`Ultracite is in package.json (${i})`,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"}}},Se=()=>{let t=ue.some(o=>C(S(j.cwd(),o))),i=he.filter(o=>!o.startsWith("eslint.config")).some(o=>C(S(j.cwd(),o)));if(t||i){let o=[];return t&&o.push("Prettier"),i&&o.push("ESLint (legacy config)"),{message:`Found potentially conflicting tools: ${o.join(", ")}`,name:"Conflicting tools",status:"warn"}}return{message:"No conflicting formatting/linting tools found",name:"Conflicting tools",status:"pass"}},b=async(t,e)=>{let i=ge();i.start(`Checking ${e}...`);let o=await t();return o.status==="pass"||o.status,i.stop(o.message),o},_1=async()=>{pe(`Ultracite v${y.version} Doctor`);let t=[await b(we,"Biome installation"),await b(xe,"ESLint installation"),await b(ve,"Oxlint installation"),await b(ye,"Biome configuration"),await b(ke,"ESLint configuration"),await b(ze,"Oxlint configuration"),await b(Ce,"Ultracite dependency"),await b(Se,"conflicting tools")],e=t.filter(n=>n.status==="pass").length,i=t.filter(n=>n.status==="fail").length,o=t.filter(n=>n.status==="warn").length;if(e1.info(`Summary: ${e} passed, ${o} warnings, ${i} failed`),i>0)throw e1.error("Some checks failed. Run 'ultracite init' to fix issues."),v1("Doctor complete"),new Error("Doctor checks failed");if(o>0){e1.warn("Some optional improvements available. Run 'ultracite init' to configure."),v1("Doctor complete");return}e1.success("Everything looks good!"),v1("Doctor complete")};import{spawnSync as B}from"child_process";import E from"process";var je=(t,e)=>{let i=["check","--write","--no-errors-on-unmatched",...e];t.length>0?i.push(...u(t)):i.push("./");let o=B("biome",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run Biome: ${o.error.message}`);o.status!==0&&E.exit(o.status??1)},Pe=(t,e)=>{let i=["--fix",...e,...t.length>0?u(t):["."]],o=B("eslint",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run ESLint: ${o.error.message}`);o.status!==0&&E.exit(o.status??1)},Oe=(t,e)=>{let i=["--write",...e,...t.length>0?u(t):["."]],o=B("prettier",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run Prettier: ${o.error.message}`);o.status!==0&&E.exit(o.status??1)},Ae=(t,e)=>{let i=["--fix",...e,...t.length>0?u(t):["."]],o=B("stylelint",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run Stylelint: ${o.error.message}`);o.status!==0&&E.exit(o.status??1)},Ie=(t,e)=>{let i=e.includes("--unsafe"),o=e.filter(r=>r!=="--unsafe"),n=[i?"--fix-dangerously":"--fix",...o,...t.length>0?u(t):["."]],s=B("oxlint",n,{shell:m,stdio:"inherit"});if(s.error)throw new Error(`Failed to run Oxlint: ${s.error.message}`);s.status!==0&&E.exit(s.status??1)},Fe=(t,e)=>{let i=["--write",...e,...t.length>0?u(t):["."]],o=B("oxfmt",i,{shell:m,stdio:"inherit"});if(o.error)throw new Error(`Failed to run oxfmt: ${o.error.message}`);o.status!==0&&E.exit(o.status??1)},L1=async(t,e=[])=>{let i=await t1();if(!i)throw new Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(i){case"eslint":{await Oe(t,[]),await Pe(t,e),await Ae(t,[]);break}case"oxlint":{await Fe(t,[]),await Ie(t,e);break}default:await je(t,e)}};import U3 from"process";import{cancel as R,intro as $3,isCancel as T,log as Z,multiselect as Y,select as _3,spinner as p}from"@clack/prompts";var D1="./aider-K7JLZT2D.svg";var N1="./amazon-q-TSOJNPXB.svg";var R1="./amp-EV4LVL5I.svg";var T1="./augmentcode-Q62PVXKO.svg";var G1="./claude-6DLEHRDQ.svg";var M1="./cline-6HWKIYN7.svg";var J1="./codex-NQZ5TJCL.svg";var W1="./copilot-L2IY45R2.svg";var H1="./crush-LYLRDQGZ.svg";var o1="./cursor-GQNH5LCA.svg";var V1="./droid-266OHJBT.svg";var X1="./firebase-studio-ILLWWYU7.svg";var Q1="./firebender-UNO6LSZG.svg";var K1="./gemini-OYS6V4BH.svg";var Z1="./goose-XBIEVD4H.svg";var Y1="./jules-HJPVWU73.svg";var q1="./junie-RUWBUV6N.svg";var tt="./kilo-code-4QYUYY2E.svg";var et="./mistral-HQ63EC2B.svg";var it="./open-hands-K5EYKO6T.svg";var ot="./opencode-K3274JKQ.svg";var nt="./qwen-N3D5CQYL.svg";var st="./roo-code-CVLBTS7D.svg";var rt="./vercel-27VSITAQ.svg";var at="./warp-OZKAAQRT.svg";var U=[{config:{appendMode:!0,path:".claude/CLAUDE.md"},description:"Anthropic's official CLI for Claude, an agentic coding tool that lives in your terminal.",hooks:{getContent:t=>({hooks:{PostToolUse:[{hooks:[{command:t,type:"command"}],matcher:"Write|Edit"}]}}),path:".claude/settings.json"},id:"claude",logo:G1,name:"Claude Code",subtitle:"Anthropic's agentic CLI"},{config:{appendMode:!0,path:"AGENTS.md"},description:"OpenAI's cloud-based coding agent for autonomous software development tasks.",id:"codex",logo:J1,name:"Codex",subtitle:"OpenAI's coding agent"},{config:{appendMode:!0,path:"AGENTS.md"},description:"Google's asynchronous AI coding agent that works in the background to complete development tasks.",id:"jules",logo:Y1,name:"Jules",subtitle:"Google's async agent"},{config:{appendMode:!0,header:`---
|
|
3
3
|
applyTo: "**/*.{ts,tsx,js,jsx}"
|
|
4
4
|
---`,path:".github/copilot-instructions.md"},description:"GitHub's AI pair programmer that suggests code completions and helps write code faster.",hooks:{getContent:t=>({hooks:{PostToolUse:[{command:t,type:"command"}]}}),path:".github/hooks/ultracite.json"},id:"copilot",logo:W1,name:"GitHub Copilot",subtitle:"GitHub's AI pair programmer"},{config:{appendMode:!0,path:".clinerules"},description:"An autonomous coding agent for VS Code that can create and edit files, run commands, and more.",id:"cline",logo:M1,name:"Cline",subtitle:"Autonomous VS Code agent"},{config:{appendMode:!0,path:"AGENTS.md"},description:"Sourcegraph's AI coding agent that understands your entire codebase for intelligent assistance.",id:"amp",logo:R1,name:"AMP",subtitle:"Sourcegraph's coding agent"},{config:{path:"ultracite.md"},description:"AI pair programming in your terminal with support for multiple LLM providers.",id:"aider",logo:D1,name:"Aider",subtitle:"Terminal pair programming"},{config:{appendMode:!0,path:".idx/airules.md"},description:"Google's AI-powered development environment integrated with Firebase services.",id:"firebase-studio",logo:X1,name:"Firebase Studio",subtitle:"Google's cloud IDE"},{config:{appendMode:!0,path:".openhands/microagents/repo.md"},description:"An open-source platform for AI software development agents with autonomous capabilities.",id:"open-hands",logo:it,name:"OpenHands",subtitle:"Open-source AI agents"},{config:{appendMode:!0,path:"GEMINI.md"},description:"Google's command-line interface for Gemini, bringing AI assistance to your terminal.",id:"gemini",logo:K1,name:"Gemini",subtitle:"Google's terminal AI"},{config:{appendMode:!0,path:".junie/guidelines.md"},description:"JetBrains' AI coding agent integrated into their IDE ecosystem.",id:"junie",logo:q1,name:"Junie",subtitle:"JetBrains' AI agent"},{config:{path:".augment/rules/ultracite.md"},description:"An AI coding assistant focused on enterprise development workflows and team collaboration.",id:"augmentcode",logo:T1,name:"Augment Code",subtitle:"Enterprise AI assistant"},{config:{path:".kilocode/rules/ultracite.md"},description:"A VS Code extension providing AI-powered coding assistance with customizable rules.",id:"kilo-code",logo:tt,name:"Kilo Code",subtitle:"Customizable VS Code AI"},{config:{appendMode:!0,path:".goosehints"},description:"Block's open-source AI developer agent for autonomous software development.",id:"goose",logo:Z1,name:"Goose",subtitle:"Block's open-source agent"},{config:{appendMode:!0,path:".roo/rules/ultracite.md"},description:"An AI coding assistant focused on understanding and navigating complex codebases.",id:"roo-code",logo:st,name:"Roo Code",subtitle:"Codebase navigation AI"},{config:{appendMode:!0,path:"AGENTS.md"},description:"A modern terminal with AI-powered command suggestions and workflow automation.",id:"warp",logo:at,name:"Warp",subtitle:"Modern AI terminal"},{config:{appendMode:!0,path:"AGENTS.md"},description:"An AI development agent focused on automated code generation and task completion.",id:"droid",logo:V1,name:"Droid",subtitle:"Automated code generation"},{config:{appendMode:!0,path:"AGENTS.md"},description:"An open-source AI coding agent that runs in your terminal, desktop, or IDE with support for 75+ LLM providers.",id:"opencode",logo:ot,name:"OpenCode",subtitle:"Open-source coding agent"},{config:{appendMode:!0,path:"CRUSH.md"},description:"Charmbracelet's glamorous AI coding agent for your terminal with multi-model support.",id:"crush",logo:H1,name:"Crush",subtitle:"Glamorous terminal agent"},{config:{appendMode:!0,path:"AGENTS.md"},description:"Alibaba's command-line interface for Qwen3-Coder, enabling agentic coding with natural language.",id:"qwen",logo:nt,name:"Qwen Code",subtitle:"Alibaba's coding CLI"},{config:{appendMode:!0,path:".amazonq/rules/ultracite.md"},description:"Amazon's AI-powered CLI with command autocompletion, natural language chat, and AWS integration.",id:"amazon-q-cli",logo:N1,name:"Amazon Q CLI",subtitle:"AWS's terminal AI"},{config:{path:"firebender.json"},description:"The most powerful AI coding assistant for Android Studio with codebase context and up-to-date Android knowledge.",id:"firebender",logo:Q1,name:"Firebender",subtitle:"Android Studio AI"},{config:{appendMode:!0,path:".cursor/rules/ultracite.mdc"},description:"Cursor's CLI, built to help you ship right from your terminal.",id:"cursor-cli",logo:o1,name:"Cursor CLI",subtitle:"Cursor's terminal agent"},{config:{path:"VIBE.md"},description:"Mistral's minimal CLI coding agent for streamlined development tasks.",id:"mistral-vibe",logo:et,name:"Mistral Vibe",subtitle:"Minimal CLI coding agent"},{config:{appendMode:!0,path:"AGENTS.md"},description:"Vercel's agent, powered by their AI Cloud.",id:"vercel",logo:rt,name:"Vercel Agent",subtitle:"Vercel's AI Cloud agent"}];import $ from"deepmerge";var lt="./antigravity-JVONECNW.svg";var ct="./kiro-N2M256R6.svg";var ft="./trae-RXVCFBOF.svg";var dt="./void-NYH3U3BB.svg";var mt="./vscode-DEOUEB65.svg";var pt="./windsurf-5T7JOTST.svg";var gt="./zed-SIARPESF.svg";var n1={"editor.defaultFormatter":"esbenp.prettier-vscode","editor.formatOnPaste":!0,"editor.formatOnSave":!0,"emmet.showExpandedAbbreviation":"never","typescript.tsdk":"node_modules/typescript/lib"},f2={"[css]":{"editor.defaultFormatter":"biomejs.biome"},"[graphql]":{"editor.defaultFormatter":"biomejs.biome"},"[html]":{"editor.defaultFormatter":"biomejs.biome"},"[javascript]":{"editor.defaultFormatter":"biomejs.biome"},"[javascriptreact]":{"editor.defaultFormatter":"biomejs.biome"},"[json]":{"editor.defaultFormatter":"biomejs.biome"},"[jsonc]":{"editor.defaultFormatter":"biomejs.biome"},"[markdown]":{"editor.defaultFormatter":"biomejs.biome"},"[mdx]":{"editor.defaultFormatter":"biomejs.biome"},"[svelte]":{"editor.defaultFormatter":"biomejs.biome"},"[typescript]":{"editor.defaultFormatter":"biomejs.biome"},"[typescriptreact]":{"editor.defaultFormatter":"biomejs.biome"},"[vue]":{"editor.defaultFormatter":"biomejs.biome"},"[yaml]":{"editor.defaultFormatter":"biomejs.biome"},"editor.codeActionsOnSave":{"source.fixAll.biome":"explicit","source.organizeImports.biome":"explicit"}},d2={"[css]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[graphql]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[handlebars]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[html]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[javascript]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[javascriptreact]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[json]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[jsonc]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[less]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[markdown]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[scss]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[typescript]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[typescriptreact]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[vue-html]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[vue]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[yaml]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"editor.codeActionsOnSave":{"source.fixAll.oxc":"explicit"}},m2={"editor.codeActionsOnSave":{"source.fixAll.eslint":"explicit","source.organizeImports":"explicit"}},P=(t="biome")=>{switch(t){case"biome":return $(n1,f2);case"eslint":return $(n1,m2);case"oxlint":return $(n1,d2);default:return n1}},s1={format_on_save:"on",formatter:"language_server",lsp:{"typescript-language-server":{settings:{typescript:{preferences:{includePackageJsonAutoImports:"on"}}}}}},p2={languages:{JavaScript:{code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0},formatter:{language_server:{name:"biome"}}},TSX:{code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0},formatter:{language_server:{name:"biome"}}},TypeScript:{code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0},formatter:{language_server:{name:"biome"}}}}},g2={languages:{JavaScript:{code_actions_on_format:{"source.fixAll.eslint":!0,"source.organizeImports.eslint":!0},formatter:{language_server:{name:"eslint"}}},TSX:{code_actions_on_format:{"source.fixAll.eslint":!0,"source.organizeImports.eslint":!0},formatter:{language_server:{name:"eslint"}}},TypeScript:{code_actions_on_format:{"source.fixAll.eslint":!0,"source.organizeImports.eslint":!0},formatter:{language_server:{name:"eslint"}}}}},u2={languages:{JavaScript:{code_actions_on_format:{"source.fixAll.oxc":!0,"source.organizeImports.oxc":!0},formatter:{language_server:{name:"oxfmt"}}},TSX:{code_actions_on_format:{"source.fixAll.oxc":!0,"source.organizeImports.oxc":!0},formatter:{language_server:{name:"oxfmt"}}},TypeScript:{code_actions_on_format:{"source.fixAll.oxc":!0,"source.organizeImports.oxc":!0},formatter:{language_server:{name:"oxfmt"}}}},lsp:{oxfmt:{initialization_options:{settings:{configPath:null,flags:{},"fmt.configPath":null,"fmt.experimental":!0,run:"onSave",typeAware:!1,unusedDisableDirectives:!1}}},oxlint:{initialization_options:{settings:{disableNestedConfig:!1,fixKind:"safe_fix",run:"onType",typeAware:!0,unusedDisableDirectives:"deny"}}}}},h2=(t="biome")=>{switch(t){case"biome":return $(s1,p2);case"eslint":return $(s1,g2);case"oxlint":return $(s1,u2);default:return s1}},_=[{config:{extensionCommand:"code --install-extension",getContent:P,path:".vscode/settings.json"},description:"Microsoft's popular code editor with extensive extension support and built-in Git integration.",id:"vscode",logo:mt,name:"Visual Studio Code",subtitle:"The most popular code editor"},{config:{extensionCommand:"code --install-extension",getContent:P,path:".vscode/settings.json"},description:"The AI-first code editor built on VS Code with deep AI integration for coding assistance.",hooks:{getContent:t=>({hooks:{afterFileEdit:[{command:t}]},version:1}),path:".cursor/hooks.json"},id:"cursor",logo:o1,name:"Cursor",rules:{header:`---
|
|
5
5
|
description: Ultracite Rules - AI-Ready Formatter and Linter
|