ultracite 7.5.4 → 7.5.5
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 +3 -3
- /package/config/oxfmt/{index.ts → index.mjs} +0 -0
- /package/config/oxlint/angular/{index.ts → index.mjs} +0 -0
- /package/config/oxlint/astro/{index.ts → index.mjs} +0 -0
- /package/config/oxlint/core/{index.ts → index.mjs} +0 -0
- /package/config/oxlint/jest/{index.ts → index.mjs} +0 -0
- /package/config/oxlint/nestjs/{index.ts → index.mjs} +0 -0
- /package/config/oxlint/next/{index.ts → index.mjs} +0 -0
- /package/config/oxlint/qwik/{index.ts → index.mjs} +0 -0
- /package/config/oxlint/react/{index.ts → index.mjs} +0 -0
- /package/config/oxlint/remix/{index.ts → index.mjs} +0 -0
- /package/config/oxlint/solid/{index.ts → index.mjs} +0 -0
- /package/config/oxlint/svelte/{index.ts → index.mjs} +0 -0
- /package/config/oxlint/vitest/{index.ts → index.mjs} +0 -0
- /package/config/oxlint/vue/{index.ts → index.mjs} +0 -0
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.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
|
|
2
|
+
import{Command as Zi}from"commander";var d={name:"ultracite",version:"7.5.5",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.mjs","./oxfmt":"./config/oxfmt/index.mjs","./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
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ultracite",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.5",
|
|
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.
|
|
39
|
-
"./oxfmt": "./config/oxfmt/index.
|
|
38
|
+
"./oxlint/*": "./config/oxlint/*/index.mjs",
|
|
39
|
+
"./oxfmt": "./config/oxfmt/index.mjs",
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|