ultracite 7.3.0 → 7.3.1

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.
Files changed (37) hide show
  1. package/README.md +4 -0
  2. package/config/biome/core/biome.jsonc +9 -16
  3. package/config/biome/jest/biome.jsonc +21 -0
  4. package/config/biome/type-aware/biome.jsonc +19 -0
  5. package/config/biome/vitest/biome.jsonc +21 -0
  6. package/config/eslint/angular/eslint.config.mjs +1 -0
  7. package/config/eslint/astro/eslint.config.mjs +1 -0
  8. package/config/eslint/astro/rules/astro.mjs +1 -3
  9. package/config/eslint/core/eslint.config.mjs +21 -38
  10. package/config/eslint/core/rules/eslint-typescript.mjs +1 -1
  11. package/config/eslint/core/rules/eslint.mjs +1 -1
  12. package/config/eslint/core/rules/import.mjs +17 -17
  13. package/config/eslint/core/rules/n.mjs +2 -2
  14. package/config/eslint/core/rules/storybook.mjs +1 -3
  15. package/config/eslint/core/rules/typescript.mjs +20 -21
  16. package/config/eslint/core/rules/unicorn.mjs +2 -2
  17. package/config/eslint/jest/eslint.config.mjs +25 -0
  18. package/config/eslint/next/eslint.config.mjs +1 -0
  19. package/config/eslint/qwik/eslint.config.mjs +1 -0
  20. package/config/eslint/react/eslint.config.mjs +4 -3
  21. package/config/eslint/react/rules/jsx-a11y.mjs +2 -2
  22. package/config/eslint/react/rules/query.mjs +1 -3
  23. package/config/eslint/react/rules/react.mjs +7 -7
  24. package/config/eslint/remix/eslint.config.mjs +1 -0
  25. package/config/eslint/solid/eslint.config.mjs +1 -0
  26. package/config/eslint/svelte/eslint.config.mjs +1 -0
  27. package/config/eslint/vitest/eslint.config.mjs +19 -0
  28. package/config/eslint/vitest/rules/vitest.mjs +36 -0
  29. package/config/eslint/vue/eslint.config.mjs +1 -0
  30. package/config/oxlint/core/.oxlintrc.json +7 -65
  31. package/config/oxlint/jest/.oxlintrc.json +74 -0
  32. package/config/oxlint/vitest/.oxlintrc.json +65 -0
  33. package/config/prettier/prettier.config.mjs +6 -6
  34. package/config/stylelint/stylelint.config.mjs +3 -3
  35. package/dist/index.js +114 -114
  36. package/package.json +36 -35
  37. /package/config/eslint/{core → jest}/rules/jest.mjs +0 -0
package/dist/index.js CHANGED
@@ -1,115 +1,17 @@
1
1
  #!/usr/bin/env node
2
- var b1=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var ge=Object.prototype.hasOwnProperty;var z1=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),G1=t=>e=>{var i=t[e];if(i)return i();throw new Error("Module not found in bundle: "+e)};var B=(t,e)=>()=>(t&&(e=t(t=0)),e);var o1=(t,e)=>{for(var i in e)b1(t,i,{get:e[i],enumerable:!0})},ue=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of me(e))!ge.call(t,n)&&n!==i&&b1(t,n,{get:()=>e[n],enumerable:!(o=pe(e,n))||o.enumerable});return t};var n1=t=>ue(b1({},"__esModule",{value:!0}),t);import{access as we,mkdir as xe,readFile as M1,writeFile as ve}from"fs/promises";import{dirname as J1,join as C1}from"path";import W1 from"process";import{parse as ye}from"jsonc-parser";var p,l,b,v,ke,be,w,y,ze,Ce,Se,s1,m=B(()=>{"use strict";p=W1.platform==="win32",l=async t=>{try{return await we(t),!0}catch{return!1}},b=async()=>{if(await l("pnpm-workspace.yaml"))return!0;try{let t=ye(await M1("package.json","utf-8"));return t?!!t.workspaces||!!t.workspace:!1}catch{return!1}},v=async({dependencies:t,devDependencies:e,scripts:i})=>{let o=await M1("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 ve("package.json",JSON.stringify(s,null,2))},ke=/[ $(){}[\]&|;<>!"'`*?#~]/,be=/'/g,w=t=>t.map(e=>ke.test(e)?`'${e.replace(be,"'\\''")}' `:e),y=async t=>{let e=J1(t);if(e!=="."){let i=e.startsWith("./")?e.slice(2):e;await xe(i,{recursive:!0})}},ze=["biome.json","biome.jsonc"],Ce=["eslint.config.mjs","eslint.config.js","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts"],Se=".oxlintrc.json",s1=async()=>{let t=W1.cwd();for(;;){for(let i of ze)if(await l(C1(t,i)))return"biome";for(let i of Ce)if(await l(C1(t,i)))return"eslint";if(await l(C1(t,Se)))return"oxlint";let e=J1(t);if(e===t)break;t=e}return null}});var Dt={};o1(Dt,{husky:()=>I});import{execSync as e3}from"child_process";import{mkdir as i3,readFile as o3,writeFile as A1}from"fs/promises";import{addDevDependency as n3,dlxCommand as Q}from"nypm";var _t,Lt,K,T,I,F1=B(()=>{"use strict";m();_t=t=>`#!/bin/sh
3
- ${t}
4
- `,Lt=t=>`#!/bin/sh
5
- # Exit on any error
6
- set -e
7
-
8
- # Check if there are any staged files
9
- STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACMR)
10
- if [ -z "$STAGED_FILES" ]; then
11
- echo "No staged files to format"
12
- exit 0
13
- fi
14
-
15
- # Run formatter
16
- ${t}
17
- FORMAT_EXIT_CODE=$?
18
-
19
- # Re-stage files that were already staged
20
- echo "$STAGED_FILES" | while IFS= read -r file; do
21
- if [ -f "$file" ]; then
22
- git add "$file"
23
- fi
24
- done
25
-
26
- if [ $FORMAT_EXIT_CODE -ne 0 ]; then
27
- echo "Ultracite found issues that could not be auto-fixed."
28
- exit $FORMAT_EXIT_CODE
29
- fi
30
-
31
- echo "\u2728 Files formatted by Ultracite"
32
- `,K="./.husky/pre-commit",T="# ultracite",I={exists:()=>l(K),install:async t=>{await n3("husky",{packageManager:t,workspace:await b(),silent:!0,corepack:!1}),await v({scripts:{prepare:"husky"}})},init:t=>{let e=Q(t,"husky",{args:["init"]});try{e3(e,{stdio:"pipe"})}catch{}},create:async(t,e=!1)=>{await i3(".husky",{recursive:!0});let i;if(e){let o=Q(t,"lint-staged",{short:t==="npm"});i=_t(o)}else{let o=Q(t,"ultracite",{args:["fix"],short:t==="npm"});i=Lt(o)}await A1(K,`${T}
33
- ${i}`)},update:async(t,e=!1)=>{let i=await o3(K,"utf-8"),o;if(e){let n=Q(t,"lint-staged",{short:t==="npm"});o=_t(n)}else{let n=Q(t,"ultracite",{args:["fix"],short:t==="npm"});o=Lt(n)}if(i.includes(T)){let n=i.split(`
34
- `),s=n.indexOf(T),r=n.slice(0,s).join(`
35
- `);await A1(K,r?`${r}
36
- ${T}
37
- ${o}`:`${T}
38
- ${o}`)}else await A1(K,`${i}
39
- ${T}
40
- ${o}`)}}});var Gt={};o1(Gt,{lefthook:()=>G});import{execSync as s3}from"child_process";import{readFile as r3,writeFile as Z}from"fs/promises";import{addDevDependency as a3,dlxCommand as Rt}from"nypm";var c3,l3,Tt,A,Nt,G,E1=B(()=>{"use strict";m();c3=/(pre-commit:\s*\n\s*jobs:\s*\n)/,l3=/(pre-commit:\s*\n)/,Tt=t=>Rt(t,"ultracite",{args:["fix"],short:t==="npm"}),A="./lefthook.yml",Nt=t=>`pre-commit:
41
- jobs:
42
- - run: ${Tt(t)}
43
- glob:
44
- - "**/*.js"
45
- - "**/*.jsx"
46
- - "**/*.ts"
47
- - "**/*.tsx"
48
- - "**/*.json"
49
- - "**/*.jsonc"
50
- - "**/*.css"
51
- stage_fixed: true
52
- `,G={exists:()=>l(A),install:async t=>{await a3("lefthook",{packageManager:t,workspace:await b(),silent:!0,corepack:!1}),await v({scripts:{prepare:"lefthook install"}});let e=Rt(t,"lefthook",{args:["install"],short:t==="npm"});s3(e,{stdio:"pipe"})},create:async t=>{let e=Nt(t);await Z(A,e)},update:async t=>{let e=await r3(A,"utf-8"),i=Tt(t),o=Nt(t);if(e.includes(i))return;if(e.startsWith("# EXAMPLE USAGE:")){await Z(A,o);return}if(e.includes("pre-commit:"))if(e.includes("jobs:")){let s=` - run: ${i}
53
- glob:
54
- - "**/*.js"
55
- - "**/*.jsx"
56
- - "**/*.ts"
57
- - "**/*.tsx"
58
- - "**/*.json"
59
- - "**/*.jsonc"
60
- - "**/*.css"
61
- stage_fixed: true`,r=e.replace(c3,`$1${s}
62
- `);await Z(A,r)}else{let s=` jobs:
63
- - run: ${i}
64
- glob:
65
- - "**/*.js"
66
- - "**/*.jsx"
67
- - "**/*.ts"
68
- - "**/*.tsx"
69
- - "**/*.json"
70
- - "**/*.jsonc"
71
- - "**/*.css"
72
- stage_fixed: true`,r=e.replace(l3,`$1${s}
73
- `);await Z(A,r)}else await Z(A,`${e}
74
- ${o}`)}}});var Jt={};o1(Jt,{preCommit:()=>q});import{readFile as f3,writeFile as B1}from"fs/promises";import{dlxCommand as d3}from"nypm";var Y,p3,Mt,m3,q,U1=B(()=>{"use strict";m();Y="./.pre-commit-config.yaml",p3=/^repos:\s*\n/m,Mt=t=>d3(t,"ultracite",{args:["fix"],short:t==="npm"}),m3=t=>`repos:
75
- - repo: local
76
- hooks:
77
- - id: ultracite
78
- name: ultracite
79
- entry: ${Mt(t)}
80
- language: system
81
- types_or: [javascript, jsx, ts, tsx, json, css]
82
- pass_filenames: false
83
- `,q={exists:()=>l(Y),create:async t=>{let e=m3(t);await B1(Y,e)},update:async t=>{let e=await f3(Y,"utf-8"),i=Mt(t);if(e.includes("id: ultracite"))return;let o=` - repo: local
84
- hooks:
85
- - id: ultracite
86
- name: ultracite
87
- entry: ${i}
88
- language: system
89
- types_or: [javascript, jsx, ts, tsx, json, css]
90
- pass_filenames: false
91
- `;if(e.includes("repos:")){let n=e.replace(p3,`repos:
92
- ${o}`);await B1(Y,n)}else await B1(Y,`${e}
93
- repos:
94
- ${o}`)}}});var g3,$1=B(()=>{g3=G1({"./husky.ts":()=>(F1(),n1(Dt)),"./lefthook.ts":()=>(E1(),n1(Gt)),"./lint-staged.ts":()=>(_1(),n1(Wt)),"./pre-commit.ts":()=>(U1(),n1(Jt))})});var Wt={};o1(Wt,{lintStaged:()=>M});import{readFile as p1,writeFile as F}from"fs/promises";import{pathToFileURL as u3}from"url";import t1 from"deepmerge";import{parse as D1}from"jsonc-parser";import{addDevDependency as h3,dlxCommand as w3}from"nypm";var C,Ht,x3,v3,y3,k3,b3,z3,C3,S3,j3,L1,P3,M,_1=B(()=>{"use strict";m();$1();C=t=>({"*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}":[w3(t,"ultracite",{args:["fix"],short:t==="npm"})]}),Ht=["./package.json","./.lintstagedrc.json","./.lintstagedrc.js","./.lintstagedrc.cjs","./.lintstagedrc.mjs","./lint-staged.config.js","./lint-staged.config.cjs","./lint-staged.config.mjs","./.lintstagedrc.yaml","./.lintstagedrc.yml","./.lintstagedrc"],x3=(t,e,i,o)=>{let n=t.trim();if(n.includes(":")&&!n.startsWith("-")){i&&o.length>0&&(e[i]=o);let[s,...r]=n.split(":"),a=r.join(":").trim(),f=s.trim().replace(/['"]/g,"");return a&&a!==""?(a.startsWith("[")&&a.endsWith("]")?e[f]=a.slice(1,-1).split(",").map(d=>d.trim().replace(/['"]/g,"")):e[f]=a.replace(/['"]/g,""),{newCurrentKey:null,newCurrentArray:[]}):{newCurrentKey:f,newCurrentArray:[]}}if(n.startsWith("-")&&i){let s=[...o,n.slice(1).trim().replace(/['"]/g,"")];return{newCurrentKey:i,newCurrentArray:s}}return{newCurrentKey:i,newCurrentArray:o}},v3=t=>{let e=t.split(`
95
- `).filter(s=>s.trim()&&!s.trim().startsWith("#")),i={},o=null,n=[];for(let s of e){let r=x3(s,i,o,n);o=r.newCurrentKey,n=r.newCurrentArray}return o&&n.length>0&&(i[o]=n),i},y3=t=>{let e="";for(let[i,o]of Object.entries(t))if(Array.isArray(o)){e+=`${i}:
96
- `;for(let n of o)e+=` - '${n}'
97
- `}else e+=`${i}: '${o}'
98
- `;return e},k3=async()=>{try{let t=D1(await p1("./package.json","utf-8"));return t?t.type==="module":!1}catch{return!1}},b3=async t=>{let e=D1(await p1("./package.json","utf-8"));e&&(e["lint-staged"]?e["lint-staged"]=t1(e["lint-staged"],C(t)):e["lint-staged"]=C(t),await F("./package.json",JSON.stringify(e,null,2)))},z3=async(t,e)=>{let i=await p1(t,"utf-8"),o=D1(i);if(!o)return;let n=t1(o,C(e));await F(t,JSON.stringify(n,null,2))},C3=async(t,e)=>{let i=await p1(t,"utf-8"),o=v3(i);if(!o)return;let n=t1(o,C(e));await F(t,y3(n))},S3=async(t,e)=>{let n=(await import(u3(t).href)).default||{},s=t1(n,C(e)),r=`export default ${JSON.stringify(s,null,2)};
99
- `;await F(t,r)},j3=async(t,e)=>{delete z1.cache[z1.resolve(`./${t}`)];let i=g3(`./${t}`),o=t1(i,C(e)),n=`module.exports = ${JSON.stringify(o,null,2)};
100
- `;await F(t,n)},L1=async t=>{await F(".lintstagedrc.json",JSON.stringify(C(t),null,2))},P3=async(t,e)=>{if(t==="./package.json"){await b3(e);return}if(t.endsWith(".json")||t==="./.lintstagedrc"){await z3(t,e);return}if(t.endsWith(".yaml")||t.endsWith(".yml")){await C3(t,e);return}let i=await k3();if(t.endsWith(".mjs")||t.endsWith(".js")&&i){try{await S3(t,e)}catch{await L1(e)}return}if(t.endsWith(".cjs")||t.endsWith(".js")&&!i)try{await j3(t,e)}catch{await L1(e)}},M={exists:async()=>{for(let t of Ht)if(await l(t))return!0;return!1},install:async t=>{await h3("lint-staged",{packageManager:t,workspace:await b(),silent:!0,corepack:!1})},create:async t=>{await F(".lintstagedrc.json",JSON.stringify(C(t),null,2))},update:async t=>{let e=null;for(let i of Ht)if(await l(i)){e=i;break}if(!e){await L1(t);return}await P3(e,t)}}});import{Command as zi}from"commander";var k={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"7.3.0",type:"module",bin:{ultracite:"dist/index.js"},files:["config","dist/index.js","dist/index.d.ts","README.md"],scripts:{build:"tsup",test:"bun test","test:coverage":"bun test --coverage"},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"},author:"Hayden Bleasel <hello@haydenbleasel.com>",bugs:{url:"https://github.com/haydenbleasel/ultracite/issues"},homepage:"https://www.ultracite.ai/",keywords:["ultracite","biome","linter","formatter","fixer"],license:"MIT",publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},repository:{type:"git",url:"git+https://github.com/haydenbleasel/ultracite.git"},devDependencies:{"@biomejs/biome":"2.4.5","@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","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":"^2.32.0","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","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",oxlint:"^1.51.0"},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"},peerDependencies:{oxlint:"^1.0.0"},peerDependenciesMeta:{oxlint:{optional:!0}},packageManager:"bun@1.3.10"};m();import{spawnSync as U}from"child_process";import $ from"process";var je=(t,e)=>{let i=e.includes("--type-aware"),o=e.filter(r=>r!=="--type-aware"),n=["check","--no-errors-on-unmatched"];i||n.push("--skip=project"),n.push(...o),t.length>0?n.push(...w(t)):n.push("./");let s=U("biome",n,{stdio:"inherit",shell:p});if(s.error)throw new Error(`Failed to run Biome: ${s.error.message}`);s.status!==0&&$.exit(s.status??1)},Pe=(t,e)=>{let i=[...e,...t.length>0?w(t):["."]],o=U("eslint",i,{stdio:"inherit",shell:p});if(o.error)throw new Error(`Failed to run ESLint: ${o.error.message}`);o.status!==0&&$.exit(o.status??1)},Oe=(t,e)=>{let i=["--check",...e,...t.length>0?w(t):["."]],o=U("prettier",i,{stdio:"inherit",shell:p});if(o.error)throw new Error(`Failed to run Prettier: ${o.error.message}`);o.status!==0&&$.exit(o.status??1)},Ie=(t,e)=>{let i=[...e,...t.length>0?w(t):["."]],o=U("stylelint",i,{stdio:"inherit",shell:p});if(o.error)throw new Error(`Failed to run Stylelint: ${o.error.message}`);o.status!==0&&$.exit(o.status??1)},Ae=(t,e)=>{let i=[...e,...t.length>0?w(t):["."]],o=U("oxlint",i,{stdio:"inherit",shell:p});if(o.error)throw new Error(`Failed to run Oxlint: ${o.error.message}`);o.status!==0&&$.exit(o.status??1)},Fe=(t,e)=>{let i=["--check",...e,...t.length>0?w(t):["."]],o=U("oxfmt",i,{stdio:"inherit",shell:p});if(o.error)throw new Error(`Failed to run oxfmt: ${o.error.message}`);o.status!==0&&$.exit(o.status??1)},H1=async(t=[],e=[])=>{let i=await s1();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 Ie(t,[]);break}case"oxlint":{await Fe(t,[]),await Ae(t,e);break}default:await je(t,e)}};import{spawnSync as j1}from"child_process";import{existsSync as S}from"fs";import{readFile as a1}from"fs/promises";import{join as j}from"path";import P from"process";import{intro as Ee,log as r1,outro as S1,spinner as Be}from"@clack/prompts";import{parse as V1}from"jsonc-parser";m();var Ue=[".prettierrc",".prettierrc.js",".prettierrc.cjs",".prettierrc.mjs",".prettierrc.json",".prettierrc.yaml",".prettierrc.yml","prettier.config.js","prettier.config.mjs","prettier.config.cjs"],$e=[".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"],_e=()=>{let t=j1("biome",["--version"],{encoding:"utf-8",shell:p});return t.status===0&&t.stdout?{name:"Biome installation",status:"pass",message:`Biome is installed (${t.stdout.trim()})`}:{name:"Biome installation",status:"fail",message:"Biome is not installed or not accessible"}},Le=()=>{let t=j1("eslint",["--version"],{encoding:"utf-8",shell:p});return t.status===0&&t.stdout?{name:"ESLint installation",status:"pass",message:`ESLint is installed (${t.stdout.trim()})`}:{name:"ESLint installation",status:"warn",message:"ESLint is not installed (optional)"}},De=()=>{let t=j1("oxlint",["--version"],{encoding:"utf-8",shell:p});return t.status===0&&t.stdout?{name:"Oxlint installation",status:"pass",message:`Oxlint is installed (${t.stdout.trim()})`}:{name:"Oxlint installation",status:"warn",message:"Oxlint is not installed (optional)"}},Ne=async()=>{let t=j(P.cwd(),"biome.json"),e=j(P.cwd(),"biome.jsonc"),i=null;if(S(t)?i=t:S(e)&&(i=e),!i)return{name:"Biome configuration",status:"warn",message:"No biome.json or biome.jsonc file found"};try{let o=await a1(i,"utf-8"),n=V1(o);return Array.isArray(n?.extends)&&n.extends.includes("ultracite/biome/core")?{name:"Biome configuration",status:"pass",message:"biome.json(c) extends ultracite/biome/core"}:{name:"Biome configuration",status:"warn",message:"biome.json(c) exists but doesn't extend ultracite/biome/core"}}catch{return{name:"Biome configuration",status:"fail",message:"Could not parse biome.json(c) file"}}},Re=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=j(P.cwd(),i);if(S(o)){e=o;break}}if(!e)return{name:"ESLint configuration",status:"warn",message:"No eslint.config.* file found (optional)"};try{return(await a1(e,"utf-8")).includes("ultracite/eslint")?{name:"ESLint configuration",status:"pass",message:"eslint.config.* imports ultracite/eslint"}:{name:"ESLint configuration",status:"warn",message:"eslint.config.* exists but doesn't import ultracite/eslint"}}catch{return{name:"ESLint configuration",status:"fail",message:"Could not read eslint.config.* file"}}},Te=t=>`./node_modules/ultracite/config/oxlint/${t}/.oxlintrc.json`,Ge=async()=>{let t=j(P.cwd(),".oxlintrc.json");if(!S(t))return{name:"Oxlint configuration",status:"warn",message:"No .oxlintrc.json file found (optional)"};try{let e=await a1(t,"utf-8"),i=V1(e);return Array.isArray(i?.extends)&&i.extends.includes(Te("core"))?{name:"Oxlint configuration",status:"pass",message:".oxlintrc.json extends ultracite oxlint config"}:{name:"Oxlint configuration",status:"warn",message:".oxlintrc.json exists but doesn't extend ultracite config"}}catch{return{name:"Oxlint configuration",status:"fail",message:"Could not parse .oxlintrc.json file"}}},Me=async()=>{let t=j(P.cwd(),"package.json");if(!S(t))return{name:"Ultracite dependency",status:"warn",message:"No package.json found"};try{let e=JSON.parse(await a1(t,"utf-8")),i=e.dependencies?.ultracite||e.devDependencies?.ultracite||e.peerDependencies?.ultracite;return i?{name:"Ultracite dependency",status:"pass",message:`Ultracite is in package.json (${i})`}:{name:"Ultracite dependency",status:"warn",message:"Ultracite not found in package.json dependencies"}}catch{return{name:"Ultracite dependency",status:"warn",message:"Could not parse package.json"}}},Je=()=>{let t=Ue.some(o=>S(j(P.cwd(),o))),i=$e.filter(o=>!o.startsWith("eslint.config")).some(o=>S(j(P.cwd(),o)));if(t||i){let o=[];return t&&o.push("Prettier"),i&&o.push("ESLint (legacy config)"),{name:"Conflicting tools",status:"warn",message:`Found potentially conflicting tools: ${o.join(", ")}`}}return{name:"Conflicting tools",status:"pass",message:"No conflicting formatting/linting tools found"}},z=async(t,e)=>{let i=Be();i.start(`Checking ${e}...`);let o=await t();return o.status==="pass"||o.status,i.stop(o.message),o},X1=async()=>{Ee(`Ultracite v${k.version} Doctor`);let t=[];t.push(await z(_e,"Biome installation")),t.push(await z(Le,"ESLint installation")),t.push(await z(De,"Oxlint installation")),t.push(await z(Ne,"Biome configuration")),t.push(await z(Re,"ESLint configuration")),t.push(await z(Ge,"Oxlint configuration")),t.push(await z(Me,"Ultracite dependency")),t.push(await z(Je,"conflicting tools"));let 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(r1.info(`Summary: ${e} passed, ${o} warnings, ${i} failed`),i>0)throw r1.error("Some checks failed. Run 'ultracite init' to fix issues."),S1("Doctor complete"),new Error("Doctor checks failed");if(o>0){r1.warn("Some optional improvements available. Run 'ultracite init' to configure."),S1("Doctor complete");return}r1.success("Everything looks good!"),S1("Doctor complete")};m();import{spawnSync as _}from"child_process";import L from"process";var We=(t,e)=>{let i=e.includes("--type-aware"),o=e.filter(r=>r!=="--type-aware"),n=["check","--write","--no-errors-on-unmatched"];i||n.push("--skip=project"),n.push(...o),t.length>0?n.push(...w(t)):n.push("./");let s=_("biome",n,{stdio:"inherit",shell:p});if(s.error)throw new Error(`Failed to run Biome: ${s.error.message}`);s.status!==0&&L.exit(s.status??1)},He=(t,e)=>{let i=["--fix",...e,...t.length>0?w(t):["."]],o=_("eslint",i,{stdio:"inherit",shell:p});if(o.error)throw new Error(`Failed to run ESLint: ${o.error.message}`);o.status!==0&&L.exit(o.status??1)},Ve=(t,e)=>{let i=["--write",...e,...t.length>0?w(t):["."]],o=_("prettier",i,{stdio:"inherit",shell:p});if(o.error)throw new Error(`Failed to run Prettier: ${o.error.message}`);o.status!==0&&L.exit(o.status??1)},Xe=(t,e)=>{let i=["--fix",...e,...t.length>0?w(t):["."]],o=_("stylelint",i,{stdio:"inherit",shell:p});if(o.error)throw new Error(`Failed to run Stylelint: ${o.error.message}`);o.status!==0&&L.exit(o.status??1)},Qe=(t,e)=>{let i=e.includes("--unsafe"),o=e.filter(r=>r!=="--unsafe"),n=[i?"--fix-dangerously":"--fix",...o,...t.length>0?w(t):["."]],s=_("oxlint",n,{stdio:"inherit",shell:p});if(s.error)throw new Error(`Failed to run Oxlint: ${s.error.message}`);s.status!==0&&L.exit(s.status??1)},Ke=(t,e)=>{let i=["--write",...e,...t.length>0?w(t):["."]],o=_("oxfmt",i,{stdio:"inherit",shell:p});if(o.error)throw new Error(`Failed to run oxfmt: ${o.error.message}`);o.status!==0&&L.exit(o.status??1)},Q1=async(t,e=[])=>{let i=await s1();if(!i)throw new Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(i){case"eslint":{await Ve(t,[]),await He(t,e),await Xe(t,[]);break}case"oxlint":{await Ke(t,[]),await Qe(t,e);break}default:await We(t,e)}};import ti from"process";import{cancel as W,intro as ei,isCancel as H,log as e1,multiselect as i1,select as ii,spinner as h}from"@clack/prompts";var K1="./aider-K7JLZT2D.svg";var Z1="./amazon-q-TSOJNPXB.svg";var Y1="./amp-EV4LVL5I.svg";var q1="./augmentcode-Q62PVXKO.svg";var tt="./claude-6DLEHRDQ.svg";var et="./cline-6HWKIYN7.svg";var it="./codex-NQZ5TJCL.svg";var ot="./copilot-L2IY45R2.svg";var nt="./crush-LYLRDQGZ.svg";var c1="./cursor-GQNH5LCA.svg";var st="./droid-266OHJBT.svg";var rt="./firebase-studio-ILLWWYU7.svg";var at="./firebender-UNO6LSZG.svg";var ct="./gemini-OYS6V4BH.svg";var lt="./goose-XBIEVD4H.svg";var ft="./jules-HJPVWU73.svg";var dt="./junie-RUWBUV6N.svg";var pt="./kilo-code-4QYUYY2E.svg";var mt="./mistral-HQ63EC2B.svg";var gt="./open-hands-K5EYKO6T.svg";var ut="./opencode-K3274JKQ.svg";var ht="./qwen-N3D5CQYL.svg";var wt="./roo-code-CVLBTS7D.svg";var xt="./vercel-27VSITAQ.svg";var vt="./warp-OZKAAQRT.svg";var D=[{id:"claude",name:"Claude Code",subtitle:"Anthropic's agentic CLI",description:"Anthropic's official CLI for Claude, an agentic coding tool that lives in your terminal.",config:{path:".claude/CLAUDE.md",appendMode:!0},logo:tt,hooks:{path:".claude/settings.json",getContent:t=>({hooks:{PostToolUse:[{matcher:"Write|Edit",hooks:[{type:"command",command:t}]}]}})}},{id:"codex",name:"Codex",subtitle:"OpenAI's coding agent",description:"OpenAI's cloud-based coding agent for autonomous software development tasks.",config:{path:"AGENTS.md",appendMode:!0},logo:it},{id:"jules",name:"Jules",subtitle:"Google's async agent",description:"Google's asynchronous AI coding agent that works in the background to complete development tasks.",config:{path:"AGENTS.md",appendMode:!0},logo:ft},{id:"copilot",name:"GitHub Copilot",subtitle:"GitHub's AI pair programmer",description:"GitHub's AI pair programmer that suggests code completions and helps write code faster.",config:{path:".github/copilot-instructions.md",appendMode:!0,header:`---
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:`---
101
3
  applyTo: "**/*.{ts,tsx,js,jsx}"
102
- ---`},logo:ot,hooks:{path:".github/hooks/ultracite.json",getContent:t=>({hooks:{PostToolUse:[{type:"command",command:t}]}})}},{id:"cline",name:"Cline",subtitle:"Autonomous VS Code agent",description:"An autonomous coding agent for VS Code that can create and edit files, run commands, and more.",config:{path:".clinerules",appendMode:!0},logo:et},{id:"amp",name:"AMP",subtitle:"Sourcegraph's coding agent",description:"Sourcegraph's AI coding agent that understands your entire codebase for intelligent assistance.",config:{path:"AGENTS.md",appendMode:!0},logo:Y1},{id:"aider",name:"Aider",subtitle:"Terminal pair programming",description:"AI pair programming in your terminal with support for multiple LLM providers.",config:{path:"ultracite.md"},logo:K1},{id:"firebase-studio",name:"Firebase Studio",subtitle:"Google's cloud IDE",description:"Google's AI-powered development environment integrated with Firebase services.",config:{path:".idx/airules.md",appendMode:!0},logo:rt},{id:"open-hands",name:"OpenHands",subtitle:"Open-source AI agents",description:"An open-source platform for AI software development agents with autonomous capabilities.",config:{path:".openhands/microagents/repo.md",appendMode:!0},logo:gt},{id:"gemini",name:"Gemini",subtitle:"Google's terminal AI",description:"Google's command-line interface for Gemini, bringing AI assistance to your terminal.",config:{path:"GEMINI.md",appendMode:!0},logo:ct},{id:"junie",name:"Junie",subtitle:"JetBrains' AI agent",description:"JetBrains' AI coding agent integrated into their IDE ecosystem.",config:{path:".junie/guidelines.md",appendMode:!0},logo:dt},{id:"augmentcode",name:"Augment Code",subtitle:"Enterprise AI assistant",description:"An AI coding assistant focused on enterprise development workflows and team collaboration.",config:{path:".augment/rules/ultracite.md"},logo:q1},{id:"kilo-code",name:"Kilo Code",subtitle:"Customizable VS Code AI",description:"A VS Code extension providing AI-powered coding assistance with customizable rules.",config:{path:".kilocode/rules/ultracite.md"},logo:pt},{id:"goose",name:"Goose",subtitle:"Block's open-source agent",description:"Block's open-source AI developer agent for autonomous software development.",config:{path:".goosehints",appendMode:!0},logo:lt},{id:"roo-code",name:"Roo Code",subtitle:"Codebase navigation AI",description:"An AI coding assistant focused on understanding and navigating complex codebases.",config:{path:".roo/rules/ultracite.md",appendMode:!0},logo:wt},{id:"warp",name:"Warp",subtitle:"Modern AI terminal",description:"A modern terminal with AI-powered command suggestions and workflow automation.",config:{path:"AGENTS.md",appendMode:!0},logo:vt},{id:"droid",name:"Droid",subtitle:"Automated code generation",description:"An AI development agent focused on automated code generation and task completion.",config:{path:"AGENTS.md",appendMode:!0},logo:st},{id:"opencode",name:"OpenCode",subtitle:"Open-source coding agent",description:"An open-source AI coding agent that runs in your terminal, desktop, or IDE with support for 75+ LLM providers.",config:{path:"AGENTS.md",appendMode:!0},logo:ut},{id:"crush",name:"Crush",subtitle:"Glamorous terminal agent",description:"Charmbracelet's glamorous AI coding agent for your terminal with multi-model support.",config:{path:"CRUSH.md",appendMode:!0},logo:nt},{id:"qwen",name:"Qwen Code",subtitle:"Alibaba's coding CLI",description:"Alibaba's command-line interface for Qwen3-Coder, enabling agentic coding with natural language.",config:{path:"AGENTS.md",appendMode:!0},logo:ht},{id:"amazon-q-cli",name:"Amazon Q CLI",subtitle:"AWS's terminal AI",description:"Amazon's AI-powered CLI with command autocompletion, natural language chat, and AWS integration.",config:{path:".amazonq/rules/ultracite.md",appendMode:!0},logo:Z1},{id:"firebender",name:"Firebender",subtitle:"Android Studio AI",description:"The most powerful AI coding assistant for Android Studio with codebase context and up-to-date Android knowledge.",config:{path:"firebender.json"},logo:at},{id:"cursor-cli",name:"Cursor CLI",subtitle:"Cursor's terminal agent",description:"Cursor's CLI, built to help you ship right from your terminal.",config:{path:".cursor/rules/ultracite.mdc",appendMode:!0},logo:c1},{id:"mistral-vibe",name:"Mistral Vibe",subtitle:"Minimal CLI coding agent",description:"Mistral's minimal CLI coding agent for streamlined development tasks.",config:{path:"VIBE.md"},logo:mt},{id:"vercel",name:"Vercel Agent",subtitle:"Vercel's AI Cloud agent",description:"Vercel's agent, powered by their AI Cloud.",config:{path:"AGENTS.md",appendMode:!0},logo:xt}];import N from"deepmerge";var yt="./antigravity-JVONECNW.svg";var kt="./kiro-N2M256R6.svg";var bt="./trae-RXVCFBOF.svg";var zt="./void-NYH3U3BB.svg";var Ct="./vscode-DEOUEB65.svg";var St="./windsurf-5T7JOTST.svg";var jt="./zed-SIARPESF.svg";var l1={"editor.defaultFormatter":"esbenp.prettier-vscode","typescript.tsdk":"node_modules/typescript/lib","editor.formatOnSave":!0,"editor.formatOnPaste":!0,"emmet.showExpandedAbbreviation":"never"},I2={"[javascript]":{"editor.defaultFormatter":"biomejs.biome"},"[typescript]":{"editor.defaultFormatter":"biomejs.biome"},"[javascriptreact]":{"editor.defaultFormatter":"biomejs.biome"},"[typescriptreact]":{"editor.defaultFormatter":"biomejs.biome"},"[json]":{"editor.defaultFormatter":"biomejs.biome"},"[jsonc]":{"editor.defaultFormatter":"biomejs.biome"},"[html]":{"editor.defaultFormatter":"biomejs.biome"},"[vue]":{"editor.defaultFormatter":"biomejs.biome"},"[svelte]":{"editor.defaultFormatter":"biomejs.biome"},"[css]":{"editor.defaultFormatter":"biomejs.biome"},"[yaml]":{"editor.defaultFormatter":"biomejs.biome"},"[graphql]":{"editor.defaultFormatter":"biomejs.biome"},"[markdown]":{"editor.defaultFormatter":"biomejs.biome"},"[mdx]":{"editor.defaultFormatter":"biomejs.biome"},"editor.codeActionsOnSave":{"source.fixAll.biome":"explicit","source.organizeImports.biome":"explicit"}},A2={"[javascript]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[javascriptreact]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[typescript]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[typescriptreact]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[json]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[jsonc]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[yaml]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[html]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[vue]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[vue-html]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[handlebars]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[css]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[scss]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[less]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[graphql]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"[markdown]":{"editor.defaultFormatter":"oxc.oxc-vscode"},"editor.codeActionsOnSave":{"source.fixAll.oxc":"explicit"}},F2={"editor.codeActionsOnSave":{"source.fixAll.eslint":"explicit","source.organizeImports":"explicit"}},O=(t="biome")=>{switch(t){case"biome":return N(l1,I2);case"eslint":return N(l1,F2);case"oxlint":return N(l1,A2);default:return l1}},f1={formatter:"language_server",format_on_save:"on",lsp:{"typescript-language-server":{settings:{typescript:{preferences:{includePackageJsonAutoImports:"on"}}}}}},E2={languages:{JavaScript:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},TypeScript:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}},TSX:{formatter:{language_server:{name:"biome"}},code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0}}}},B2={languages:{JavaScript:{formatter:{language_server:{name:"eslint"}},code_actions_on_format:{"source.fixAll.eslint":!0,"source.organizeImports.eslint":!0}},TypeScript:{formatter:{language_server:{name:"eslint"}},code_actions_on_format:{"source.fixAll.eslint":!0,"source.organizeImports.eslint":!0}},TSX:{formatter:{language_server:{name:"eslint"}},code_actions_on_format:{"source.fixAll.eslint":!0,"source.organizeImports.eslint":!0}}}},U2={languages:{JavaScript:{formatter:{language_server:{name:"oxfmt"}},code_actions_on_format:{"source.fixAll.oxc":!0,"source.organizeImports.oxc":!0}},TypeScript:{formatter:{language_server:{name:"oxfmt"}},code_actions_on_format:{"source.fixAll.oxc":!0,"source.organizeImports.oxc":!0}},TSX:{formatter:{language_server:{name:"oxfmt"}},code_actions_on_format:{"source.fixAll.oxc":!0,"source.organizeImports.oxc":!0}}},lsp:{oxlint:{initialization_options:{settings:{disableNestedConfig:!1,fixKind:"safe_fix",run:"onType",typeAware:!0,unusedDisableDirectives:"deny"}}},oxfmt:{initialization_options:{settings:{configPath:null,flags:{},"fmt.configPath":null,"fmt.experimental":!0,run:"onSave",typeAware:!1,unusedDisableDirectives:!1}}}}},$2=(t="biome")=>{switch(t){case"biome":return N(f1,E2);case"eslint":return N(f1,B2);case"oxlint":return N(f1,U2);default:return f1}},R=[{id:"vscode",name:"Visual Studio Code",subtitle:"The most popular code editor",description:"Microsoft's popular code editor with extensive extension support and built-in Git integration.",logo:Ct,config:{path:".vscode/settings.json",getContent:O,extensionCommand:"code --install-extension"}},{id:"cursor",name:"Cursor",subtitle:"The AI-first code editor",description:"The AI-first code editor built on VS Code with deep AI integration for coding assistance.",logo:c1,rules:{path:".cursor/rules/ultracite.mdc",header:`---
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:`---
103
5
  description: Ultracite Rules - AI-Ready Formatter and Linter
104
6
  globs: "**/*.{ts,tsx,js,jsx,json,jsonc,html,vue,svelte,astro,css,yaml,yml,graphql,gql,md,mdx,grit}"
105
7
  alwaysApply: false
106
- ---`},hooks:{path:".cursor/hooks.json",getContent:t=>({version:1,hooks:{afterFileEdit:[{command:t}]}})},config:{path:".vscode/settings.json",getContent:O,extensionCommand:"code --install-extension"}},{id:"windsurf",name:"Windsurf",subtitle:"The agentic IDE by Codeium",description:"Codeium's agentic IDE that combines AI assistance with a powerful VS Code-based development environment.",logo:St,rules:{path:".windsurf/rules/ultracite.md"},hooks:{path:".windsurf/hooks.json",getContent:t=>({hooks:{post_write_code:[{command:t,show_output:!0}]}})},config:{path:".vscode/settings.json",getContent:O,extensionCommand:"code --install-extension"}},{id:"antigravity",name:"Antigravity",subtitle:"Google's next-generation IDE",description:"An AI-powered development platform built on VS Code for building and deploying applications faster.",logo:yt,config:{path:".vscode/settings.json",getContent:O,extensionCommand:"code --install-extension"}},{id:"kiro",name:"Kiro",subtitle:"AWS's spec-driven IDE",description:"AWS's spec-driven AI development environment for building production-ready applications.",logo:kt,rules:{path:".kiro/steering/ultracite.md"},config:{path:".vscode/settings.json",getContent:O,extensionCommand:"code --install-extension"}},{id:"trae",name:"Trae",subtitle:"ByteDance's AI IDE",description:"ByteDance's AI-powered IDE built on VS Code - the real AI engineer.",logo:bt,rules:{path:".trae/rules/project_rules.md"},config:{path:".vscode/settings.json",getContent:O,extensionCommand:"code --install-extension"}},{id:"void",name:"Void",subtitle:"Open-source AI editor",description:"An open-source AI code editor built on VS Code with a focus on privacy and extensibility.",logo:zt,config:{path:".vscode/settings.json",getContent:O,extensionCommand:"code --install-extension"}},{id:"zed",name:"Zed",subtitle:"The high-performance editor",description:"A high-performance, multiplayer code editor built in Rust with built-in AI assistance.",logo:jt,rules:{path:".rules",appendMode:!0},config:{path:".zed/settings.json",getContent:$2}}];var _2=t=>!!t.hooks,L2=t=>!!t.hooks,D2=()=>R.filter(_2).map(t=>({id:t.id,name:t.name,hooks:t.hooks})),N2=()=>D.filter(L2).map(t=>({id:t.id,name:t.name,hooks:t.hooks})),X=[...D2(),...N2()];var Pt="./biome-TVLEY2T4.svg";var Ot="./eslint-7IULJKW7.svg";var It="./oxlint-5IE3ABOZ.svg";var At="./prettier-O4V2FSEA.svg";var Ft="./stylelint-DEBSWZVS.svg";var d1=[{id:"biome",name:"Biome",subtitle:"The modern all-in-one toolchain",description:"The modern, all-in-one toolchain. Biome is a fast formatter and linter written in Rust that handles JavaScript, TypeScript, JSON, CSS, and more with a single tool.",benefits:[{title:"Lightning fast",description:"Written in Rust, Biome can format a large codebase in milliseconds.",icon:"Zap"},{title:"All-in-one toolchain",description:"No more juggling ESLint, Prettier, and other tools. Biome handles formatting and linting in a single pass.",icon:"Layers"},{title:"287 preconfigured rules",description:"Covers accessibility, complexity, correctness, performance, security, style, and suspicious patterns.",icon:"ShieldCheck"},{title:"Multi-language support",description:"Natively supports JavaScript, TypeScript, JSX, TSX, JSON, JSONC, CSS, GraphQL, and HTML.",icon:"Code"},{title:"Smart sorting",description:"Automatically organizes imports and JSX attributes, plus sorts Tailwind CSS classes.",icon:"ArrowUpDown"},{title:"Zero dependencies",description:"Biome has no JavaScript dependencies. One binary does everything with consistent behavior.",icon:"Package"}],logo:Pt,videos:["https://www.youtube.com/watch?v=lEkXbneUnWg","https://www.youtube.com/watch?v=b_F4LaycQcE"],configFiles:[{name:"biome.jsonc",lang:"json",code:t=>`{
8
+ ---`,path:".cursor/rules/ultracite.mdc"},subtitle:"The AI-first code editor"},{config:{extensionCommand:"code --install-extension",getContent:P,path:".vscode/settings.json"},description:"Codeium's agentic IDE that combines AI assistance with a powerful VS Code-based development environment.",hooks:{getContent:t=>({hooks:{post_write_code:[{command:t,show_output:!0}]}}),path:".windsurf/hooks.json"},id:"windsurf",logo:pt,name:"Windsurf",rules:{path:".windsurf/rules/ultracite.md"},subtitle:"The agentic IDE by Codeium"},{config:{extensionCommand:"code --install-extension",getContent:P,path:".vscode/settings.json"},description:"An AI-powered development platform built on VS Code for building and deploying applications faster.",id:"antigravity",logo:lt,name:"Antigravity",subtitle:"Google's next-generation IDE"},{config:{extensionCommand:"code --install-extension",getContent:P,path:".vscode/settings.json"},description:"AWS's spec-driven AI development environment for building production-ready applications.",id:"kiro",logo:ct,name:"Kiro",rules:{path:".kiro/steering/ultracite.md"},subtitle:"AWS's spec-driven IDE"},{config:{extensionCommand:"code --install-extension",getContent:P,path:".vscode/settings.json"},description:"ByteDance's AI-powered IDE built on VS Code - the real AI engineer.",id:"trae",logo:ft,name:"Trae",rules:{path:".trae/rules/project_rules.md"},subtitle:"ByteDance's AI IDE"},{config:{extensionCommand:"code --install-extension",getContent:P,path:".vscode/settings.json"},description:"An open-source AI code editor built on VS Code with a focus on privacy and extensibility.",id:"void",logo:dt,name:"Void",subtitle:"Open-source AI editor"},{config:{getContent:h2,path:".zed/settings.json"},description:"A high-performance, multiplayer code editor built in Rust with built-in AI assistance.",id:"zed",logo:gt,name:"Zed",rules:{appendMode:!0,path:".rules"},subtitle:"The high-performance editor"}];var w2=t=>!!t.hooks,x2=t=>!!t.hooks,v2=()=>_.filter(w2).map(t=>({hooks:t.hooks,id:t.id,name:t.name})),y2=()=>U.filter(x2).map(t=>({hooks:t.hooks,id:t.id,name:t.name})),M=[...v2(),...y2()];var ut="./biome-TVLEY2T4.svg";var ht="./eslint-7IULJKW7.svg";var wt="./oxlint-5IE3ABOZ.svg";var xt="./prettier-O4V2FSEA.svg";var vt="./stylelint-DEBSWZVS.svg";var r1=[{benefits:[{description:"Written in Rust, Biome can format a large codebase in milliseconds.",icon:"Zap",title:"Lightning fast"},{description:"No more juggling ESLint, Prettier, and other tools. Biome handles formatting and linting in a single pass.",icon:"Layers",title:"All-in-one toolchain"},{description:"Covers accessibility, complexity, correctness, performance, security, style, and suspicious patterns.",icon:"ShieldCheck",title:"287 preconfigured rules"},{description:"Natively supports JavaScript, TypeScript, JSX, TSX, JSON, JSONC, CSS, GraphQL, and HTML.",icon:"Code",title:"Multi-language support"},{description:"Automatically organizes imports and JSX attributes, plus sorts Tailwind CSS classes.",icon:"ArrowUpDown",title:"Smart sorting"},{description:"Biome has no JavaScript dependencies. One binary does everything with consistent behavior.",icon:"Package",title:"Zero dependencies"}],configFiles:[{code:t=>`{
107
9
  "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
108
10
  "extends": [
109
11
  ${t.map(e=>`"ultracite/biome/${e}"`).join(`,
110
12
  `)}
111
13
  ]
112
- }`}],vscodeExtensionId:"biomejs.biome"},{id:"eslint",name:"ESLint + Prettier + Stylelint",subtitle:"The most mature linting ecosystem",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.",benefits:[{title:"Battle-tested",description:"Used by millions of developers worldwide. The largest ecosystem of plugins and configurations available.",icon:"ShieldCheck"},{title:"20+ plugins included",description:"React, TypeScript, JSX A11y, Import, Promise, Node, Next.js, Unicorn, SonarJS, and more preconfigured.",icon:"Puzzle"},{title:"Three tools in one",description:"ESLint handles code quality, Prettier ensures consistent formatting, and Stylelint keeps your CSS clean.",icon:"Layers"},{title:"Framework-aware",description:"First-class support for React, Next.js, Vue, Svelte, and more with framework-specific rules.",icon:"Box"},{title:"Type-aware linting",description:"Deep TypeScript integration with type-aware rules that catch bugs static analysis alone can't find.",icon:"FileCode"},{title:"Maximum coverage",description:"Hundreds of rules covering accessibility, security, performance, and best practices out of the box.",icon:"Target"}],includes:["ESLint","Prettier","Stylelint"],logo:Ot,additionalLogos:[At,Ft],configFiles:[{name:"eslint.config.mjs",lang:"javascript",code:t=>`import { defineConfig } from "eslint/config";
14
+ }`,lang:"json",name:"biome.jsonc"}],description:"The modern, all-in-one toolchain. Biome is a fast formatter and linter written in Rust that handles JavaScript, TypeScript, JSON, CSS, and more with a single tool.",id:"biome",logo:ut,name:"Biome",subtitle:"The modern all-in-one toolchain",videos:["https://www.youtube.com/watch?v=lEkXbneUnWg","https://www.youtube.com/watch?v=b_F4LaycQcE"],vscodeExtensionId:"biomejs.biome"},{additionalLogos:[xt,vt],benefits:[{description:"Used by millions of developers worldwide. The largest ecosystem of plugins and configurations available.",icon:"ShieldCheck",title:"Battle-tested"},{description:"React, TypeScript, JSX A11y, Import, Promise, Node, Next.js, Unicorn, SonarJS, and more preconfigured.",icon:"Puzzle",title:"20+ plugins included"},{description:"ESLint handles code quality, Prettier ensures consistent formatting, and Stylelint keeps your CSS clean.",icon:"Layers",title:"Three tools in one"},{description:"First-class support for React, Next.js, Vue, Svelte, and more with framework-specific rules.",icon:"Box",title:"Framework-aware"},{description:"Deep TypeScript integration with type-aware rules that catch bugs static analysis alone can't find.",icon:"FileCode",title:"Type-aware linting"},{description:"Hundreds of rules covering accessibility, security, performance, and best practices out of the box.",icon:"Target",title:"Maximum coverage"}],configFiles:[{code:t=>`import { defineConfig } from "eslint/config";
113
15
  ${t.map(e=>`import ${e} from "ultracite/eslint/${e}";`).join(`
114
16
  `)}
115
17
 
@@ -120,13 +22,13 @@ export default defineConfig([
120
22
  `)}
121
23
  ],
122
24
  },
123
- ]);`},{name:"prettier.config.mjs",lang:"javascript",code:()=>'export { default } from "ultracite/prettier";'},{name:"stylelint.config.mjs",lang:"javascript",code:()=>'export { default } from "ultracite/stylelint";'}],vscodeExtensionId:"dbaeumer.vscode-eslint"},{id:"oxlint",name:"Oxlint + Oxfmt",subtitle:"The fastest linter available",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.",benefits:[{title:"50-100x faster",description:"Lint your entire codebase in milliseconds. No more waiting for slow linting processes.",icon:"Zap"},{title:"15 plugin equivalents",description:"Built-in support for React, TypeScript, Next.js, Vue, Jest, Vitest, JSDoc, and more without extra deps.",icon:"Puzzle"},{title:"Bug-focused rules",description:"Prioritizes catching real bugs over stylistic issues. High signal-to-noise ratio.",icon:"Bug"},{title:"Oxc ecosystem",description:"Part of the larger Oxc project with parser, resolver, transformer, and minifier built for speed.",icon:"Boxes"},{title:"Category-based config",description:"Rules organized into correctness, suspicious, pedantic, performance, restriction, and style categories.",icon:"FolderTree"},{title:"Drop-in ready",description:"Works alongside your existing ESLint setup or as a complete replacement with Oxfmt for formatting.",icon:"RefreshCw"}],includes:["Oxlint","Oxfmt"],logo:It,configFiles:[{name:".oxlintrc.json",lang:"json",code:t=>`{
25
+ ]);`,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:ht,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:t=>`{
124
26
  "$schema": "./node_modules/oxlint/configuration_schema.json",
125
27
  "extends": [
126
28
  ${t.map(e=>`"./node_modules/ultracite/config/oxlint/${e}/.oxlintrc.json"`).join(`,
127
29
  `)}
128
30
  ]
129
- }`},{name:".oxfmtrc.jsonc",lang:"json",code:()=>`{
31
+ }`,lang:"json",name:".oxlintrc.json"},{code:()=>`{
130
32
  "$schema": "./node_modules/oxfmt/configuration_schema.json",
131
33
  "tabWidth": 2,
132
34
  "useTabs": false,
@@ -137,7 +39,7 @@ export default defineConfig([
137
39
  "arrowParens": "always",
138
40
  "proseWrap": "never",
139
41
  "printWidth": 80,
140
- }`}],vscodeExtensionId:"oxc.oxc-vscode"}];import{addDevDependency as oi,detectPackageManager as ni}from"nypm";import{readFile as W2,writeFile as P1}from"fs/promises";var Et=(t,e)=>`# Ultracite Code Standards
42
+ }`,lang:"json",name:".oxfmtrc.jsonc"}],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:wt,name:"Oxlint + Oxfmt",subtitle:"The fastest linter available",vscodeExtensionId:"oxc.oxc-vscode"}];import{addDevDependency as L3,detectPackageManager as D3}from"nypm";import{readFile as j2,writeFile as k1}from"fs/promises";var yt=(t,e)=>`# Ultracite Code Standards
141
43
 
142
44
  This project uses **Ultracite**, a zero-config preset that enforces strict code quality standards through automated formatting and linting.
143
45
 
@@ -260,23 +162,121 @@ ${e}'s linter will catch most issues automatically. Focus your attention on:
260
162
  ---
261
163
 
262
164
  Most formatting and common issues are automatically fixed by ${e}. Run \`${t} ultracite fix\` before committing to ensure compliance.
263
- `;m();import{dlxCommand as H2}from"nypm";var Bt=(t,e,i)=>{let o=D.find(f=>f.id===t);if(!o)throw new Error(`Agent "${t}" not found`);let n=d1.find(f=>f.id===i);if(!n)throw new Error(`Provider "${i}" not found`);let s=H2(e,""),r=Et(s,n.name),a=o.config.header?`${o.config.header}
165
+ `;import{dlxCommand as P2}from"nypm";var kt=(t,e,i)=>{let o=U.find(f=>f.id===t);if(!o)throw new Error(`Agent "${t}" not found`);let n=r1.find(f=>f.id===i);if(!n)throw new Error(`Provider "${i}" not found`);let s=P2(e,""),r=yt(s,n.name),a=o.config.header?`${o.config.header}
264
166
 
265
- ${r}`:r;return{exists:()=>l(o.config.path),create:async()=>{await y(o.config.path),await P1(o.config.path,a)},update:async()=>{await y(o.config.path);let f=await l(o.config.path);if(!(o.config.appendMode&&f)){await P1(o.config.path,a);return}let d=await W2(o.config.path,"utf-8");d.includes(r.trim())||await P1(o.config.path,`${d}
167
+ ${r}`:r;return{create:async()=>{await v(o.config.path),await k1(o.config.path,a)},exists:()=>c(o.config.path),update:async()=>{await v(o.config.path);let f=await c(o.config.path);if(!(o.config.appendMode&&f)){await k1(o.config.path,a);return}let d=await j2(o.config.path,"utf8");d.includes(r.trim())||await k1(o.config.path,`${d}
266
168
 
267
- ${r}`)}}};import{spawnSync as V2}from"child_process";import{readFile as X2,writeFile as O1}from"fs/promises";m();import Q2 from"deepmerge";import{parse as K2}from"jsonc-parser";var Ut=(t,e="biome")=>{let i=R.find(n=>n.id===t);if(!i)throw new Error(`Editor "${t}" not found`);let o=i.config.getContent(e);return{exists:()=>l(i.config.path),create:async()=>{await y(i.config.path),await O1(i.config.path,JSON.stringify(o,null,2))},update:async()=>{if(await y(i.config.path),!await l(i.config.path)){await O1(i.config.path,JSON.stringify(o,null,2));return}let s=await X2(i.config.path,"utf-8"),a=K2(s)||{},f=Q2(a,o);await O1(i.config.path,JSON.stringify(f,null,2))},extension:i.config.extensionCommand?n=>V2(`${i.config.extensionCommand} ${n}`,{stdio:"pipe",shell:!0}):void 0}};import{readFile as Z2,writeFile as I1}from"fs/promises";m();import Y2 from"deepmerge";import{parse as q2}from"jsonc-parser";var t3=(t,e,i=[])=>{let o=[t];return t==="npm"&&o.push("run"),o.push(e),i.length>0&&(t==="npm"&&o.push("--"),o.push(...i)),o.join(" ")},$t=(t,e,i="biome")=>{let o=X.find(g=>g.id===t);if(!o)throw new Error(`Hook integration "${t}" not found`);let s=t3(e,"fix",i==="biome"?["--skip=correctness/noUnusedImports"]:[]),r=o.hooks.getContent(s),a=g=>typeof g=="object"&&g!==null&&!Array.isArray(g),f=g=>{let E=JSON.stringify(g);return E.includes("ultracite")||E.includes(s)},d=async()=>{if(!await l(o.hooks.path)){await I1(o.hooks.path,JSON.stringify(r,null,2));return}let E=await Z2(o.hooks.path,"utf-8"),x=q2(E),c=a(x)?x:{};if(!f(c)){let u=Y2(c,r);await I1(o.hooks.path,JSON.stringify(u,null,2))}};return{exists:()=>l(o.hooks.path),create:async()=>{await y(o.hooks.path),await I1(o.hooks.path,JSON.stringify(r,null,2))},update:async()=>{await y(o.hooks.path),await d()}}};F1();E1();_1();U1();m();import{readFile as O3,writeFile as Vt}from"fs/promises";import I3 from"deepmerge";import{parse as A3}from"jsonc-parser";var Xt={$schema:"./node_modules/@biomejs/biome/configuration_schema.json",extends:["ultracite/biome/core"]},N1=async()=>await l("./biome.json")?"./biome.json":"./biome.jsonc",m1={exists:async()=>{let t=await N1();return l(t)},create:async t=>{let e=await N1(),i=["ultracite/biome/core"];if(t?.frameworks&&t.frameworks.length>0)for(let n of t.frameworks)i.push(`ultracite/biome/${n}`);let o={...Xt,extends:i};return Vt(e,JSON.stringify(o,null,2))},update:async t=>{let e=await N1(),i=await O3(e,"utf-8"),n=A3(i)||{},r=[...n.extends&&Array.isArray(n.extends)?n.extends:[]];if(r.includes("ultracite/biome/core")||r.push("ultracite/biome/core"),t?.frameworks&&t.frameworks.length>0)for(let d of t.frameworks){let g=`ultracite/biome/${d}`;r.includes(g)||r.push(g)}n.extends=r;let a={$schema:Xt.$schema},f=I3(n,a);await Vt(e,JSON.stringify(f,null,2))}};m();import{writeFile as Qt}from"fs/promises";var F3=["./eslint.config.mjs","./eslint.config.js","./eslint.config.cjs","./eslint.config.ts","./eslint.config.mts","./eslint.config.cts"],Kt="./eslint.config.mjs",E3=async()=>{for(let t of F3)if(await l(t))return t;return null},Zt=t=>{let e=['import core from "ultracite/eslint/core";'],i=["...core"];if(t?.frameworks&&t.frameworks.length>0)for(let o of t.frameworks)e.push(`import ${o} from "ultracite/eslint/${o}";`),i.push(`...${o}`);return`${e.join(`
169
+ ${r}`)}}};import{spawnSync as O2}from"child_process";import{readFile as A2,writeFile as b1}from"fs/promises";import I2 from"deepmerge";import{parse as F2}from"jsonc-parser";var bt=(t,e="biome")=>{let i=_.find(n=>n.id===t);if(!i)throw new Error(`Editor "${t}" not found`);let o=i.config.getContent(e);return{create:async()=>{await v(i.config.path),await b1(i.config.path,JSON.stringify(o,null,2))},exists:()=>c(i.config.path),extension:i.config.extensionCommand?n=>O2(`${i.config.extensionCommand} ${n}`,{shell:!0,stdio:"pipe"}):void 0,update:async()=>{if(await v(i.config.path),!await c(i.config.path)){await b1(i.config.path,JSON.stringify(o,null,2));return}let s=await A2(i.config.path,"utf8"),a=F2(s)||{},f=I2(a,o);await b1(i.config.path,JSON.stringify(f,null,2))}}};import{readFile as B2,writeFile as z1}from"fs/promises";import E2 from"deepmerge";import{parse as U2}from"jsonc-parser";var $2=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),_2=(t,e,i=[])=>{let o=[t];return t==="npm"&&o.push("run"),o.push(e),i.length>0&&(t==="npm"&&o.push("--"),o.push(...i)),o.join(" ")},zt=(t,e,i="biome")=>{let o=M.find(d=>d.id===t);if(!o)throw new Error(`Hook integration "${t}" not found`);let s=_2(e,"fix",i==="biome"?["--skip=correctness/noUnusedImports"]:[]),r=o.hooks.getContent(s),a=d=>{let h=JSON.stringify(d);return h.includes("ultracite")||h.includes(s)},f=async()=>{if(!await c(o.hooks.path)){await z1(o.hooks.path,JSON.stringify(r,null,2));return}let h=await B2(o.hooks.path,"utf8"),q=U2(h),w=$2(q)?q:{};if(!a(w)){let l=E2(w,r);await z1(o.hooks.path,JSON.stringify(l,null,2))}};return{create:async()=>{await v(o.hooks.path),await z1(o.hooks.path,JSON.stringify(r,null,2))},exists:()=>c(o.hooks.path),update:async()=>{await v(o.hooks.path),await f()}}};import{execSync as L2}from"child_process";import{mkdir as D2,readFile as N2,writeFile as C1}from"fs/promises";import{addDevDependency as R2,dlxCommand as J}from"nypm";var Ct=t=>`#!/bin/sh
170
+ ${t}
171
+ `,St=t=>`#!/bin/sh
172
+ # Exit on any error
173
+ set -e
174
+
175
+ # Check if there are any staged files
176
+ STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACMR)
177
+ if [ -z "$STAGED_FILES" ]; then
178
+ echo "No staged files to format"
179
+ exit 0
180
+ fi
181
+
182
+ # Run formatter
183
+ ${t}
184
+ FORMAT_EXIT_CODE=$?
185
+
186
+ # Re-stage files that were already staged
187
+ echo "$STAGED_FILES" | while IFS= read -r file; do
188
+ if [ -f "$file" ]; then
189
+ git add "$file"
190
+ fi
191
+ done
192
+
193
+ if [ $FORMAT_EXIT_CODE -ne 0 ]; then
194
+ echo "Ultracite found issues that could not be auto-fixed."
195
+ exit $FORMAT_EXIT_CODE
196
+ fi
197
+
198
+ echo "\u2728 Files formatted by Ultracite"
199
+ `,W="./.husky/pre-commit",L="# ultracite",D={create:async(t,e=!1)=>{await D2(".husky",{recursive:!0});let i;if(e){let o=J(t,"lint-staged",{short:t==="npm"});i=Ct(o)}else{let o=J(t,"ultracite",{args:["fix"],short:t==="npm"});i=St(o)}await C1(W,`${L}
200
+ ${i}`)},exists:()=>c(W),init:t=>{let e=J(t,"husky",{args:["init"]});try{L2(e,{stdio:"pipe"})}catch{}},install:async t=>{await R2("husky",{corepack:!1,packageManager:t,silent:!0,workspace:await k()}),await x({scripts:{prepare:"husky"}})},update:async(t,e=!1)=>{let i=await N2(W,"utf8"),o;if(e){let n=J(t,"lint-staged",{short:t==="npm"});o=Ct(n)}else{let n=J(t,"ultracite",{args:["fix"],short:t==="npm"});o=St(n)}if(i.includes(L)){let n=i.split(`
201
+ `),s=n.indexOf(L),r=n.slice(0,s).join(`
202
+ `);await C1(W,r?`${r}
203
+ ${L}
204
+ ${o}`:`${L}
205
+ ${o}`)}else await C1(W,`${i}
206
+ ${L}
207
+ ${o}`)}};import{execSync as T2}from"child_process";import{readFile as G2,writeFile as H}from"fs/promises";import{addDevDependency as M2,dlxCommand as Pt}from"nypm";var J2=/(pre-commit:\s*\n\s*jobs:\s*\n)/,W2=/(pre-commit:\s*\n)/,Ot=t=>Pt(t,"ultracite",{args:["fix"],short:t==="npm"}),O="./lefthook.yml",jt=t=>`pre-commit:
208
+ jobs:
209
+ - run: ${Ot(t)}
210
+ glob:
211
+ - "**/*.js"
212
+ - "**/*.jsx"
213
+ - "**/*.ts"
214
+ - "**/*.tsx"
215
+ - "**/*.json"
216
+ - "**/*.jsonc"
217
+ - "**/*.css"
218
+ stage_fixed: true
219
+ `,V={create:async t=>{let e=jt(t);await H(O,e)},exists:()=>c(O),install:async t=>{await M2("lefthook",{corepack:!1,packageManager:t,silent:!0,workspace:await k()}),await x({scripts:{prepare:"lefthook install"}});let e=Pt(t,"lefthook",{args:["install"],short:t==="npm"});T2(e,{stdio:"pipe"})},update:async t=>{let e=await G2(O,"utf8"),i=Ot(t),o=jt(t);if(e.includes(i))return;if(e.startsWith("# EXAMPLE USAGE:")){await H(O,o);return}if(e.includes("pre-commit:"))if(e.includes("jobs:")){let s=` - run: ${i}
220
+ glob:
221
+ - "**/*.js"
222
+ - "**/*.jsx"
223
+ - "**/*.ts"
224
+ - "**/*.tsx"
225
+ - "**/*.json"
226
+ - "**/*.jsonc"
227
+ - "**/*.css"
228
+ stage_fixed: true`,r=e.replace(J2,`$1${s}
229
+ `);await H(O,r)}else{let s=` jobs:
230
+ - run: ${i}
231
+ glob:
232
+ - "**/*.js"
233
+ - "**/*.jsx"
234
+ - "**/*.ts"
235
+ - "**/*.tsx"
236
+ - "**/*.json"
237
+ - "**/*.jsonc"
238
+ - "**/*.css"
239
+ stage_fixed: true`,r=e.replace(W2,`$1${s}
240
+ `);await H(O,r)}else await H(O,`${e}
241
+ ${o}`)}};import{readFile as a1,writeFile as A}from"fs/promises";import{pathToFileURL as It}from"url";import X from"deepmerge";import{parse as j1}from"jsonc-parser";import{addDevDependency as H2,dlxCommand as V2}from"nypm";var z=t=>({"*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}":[V2(t,"ultracite",{args:["fix"],short:t==="npm"})]}),At=["./package.json","./.lintstagedrc.json","./.lintstagedrc.js","./.lintstagedrc.cjs","./.lintstagedrc.mjs","./lint-staged.config.js","./lint-staged.config.cjs","./lint-staged.config.mjs","./.lintstagedrc.yaml","./.lintstagedrc.yml","./.lintstagedrc"],X2=(t,e,i,o)=>{let n=t.trim();if(n.includes(":")&&!n.startsWith("-")){i&&o.length>0&&(e[i]=o);let[s,...r]=n.split(":"),a=r.join(":").trim(),f=s.trim().replaceAll(/['"]/g,"");return a&&a!==""?(e[f]=a.startsWith("[")&&a.endsWith("]")?a.slice(1,-1).split(",").map(d=>d.trim().replaceAll(/['"]/g,"")):a.replaceAll(/['"]/g,""),{newCurrentArray:[],newCurrentKey:null}):{newCurrentArray:[],newCurrentKey:f}}return n.startsWith("-")&&i?{newCurrentArray:[...o,n.slice(1).trim().replaceAll(/['"]/g,"")],newCurrentKey:i}:{newCurrentArray:o,newCurrentKey:i}},Q2=t=>{let e=t.split(`
242
+ `).filter(s=>s.trim()&&!s.trim().startsWith("#")),i={},o=null,n=[];for(let s of e){let r=X2(s,i,o,n);o=r.newCurrentKey,n=r.newCurrentArray}return o&&n.length>0&&(i[o]=n),i},K2=t=>{let e="";for(let[i,o]of Object.entries(t))if(Array.isArray(o)){e+=`${i}:
243
+ `;for(let n of o)e+=` - '${n}'
244
+ `}else e+=`${i}: '${o}'
245
+ `;return e},Z2=async()=>{try{let t=j1(await a1("./package.json","utf8"));return t?t.type==="module":!1}catch{return!1}},Y2=async t=>{let e=j1(await a1("./package.json","utf8"));e&&(e["lint-staged"]=e["lint-staged"]?X(e["lint-staged"],z(t)):z(t),await A("./package.json",JSON.stringify(e,null,2)))},q2=async(t,e)=>{let i=await a1(t,"utf8"),o=j1(i);if(!o)return;let n=X(o,z(e));await A(t,JSON.stringify(n,null,2))},t3=async(t,e)=>{let i=await a1(t,"utf8"),o=Q2(i);if(!o)return;let n=X(o,z(e));await A(t,K2(n))},e3=async(t,e)=>{let n=(await import(It(t).href)).default||{},s=X(n,z(e)),r=`export default ${JSON.stringify(s,null,2)};
246
+ `;await A(t,r)},i3=async(t,e)=>{let o=await import(`${It(t).href}?t=${Date.now()}`),n=o.default||o,s=X(n,z(e)),r=`module.exports = ${JSON.stringify(s,null,2)};
247
+ `;await A(t,r)},S1=async t=>{await A(".lintstagedrc.json",JSON.stringify(z(t),null,2))},o3=async(t,e)=>{if(t==="./package.json"){await Y2(e);return}if(t.endsWith(".json")||t==="./.lintstagedrc"){await q2(t,e);return}if(t.endsWith(".yaml")||t.endsWith(".yml")){await t3(t,e);return}let i=await Z2();if(t.endsWith(".mjs")||t.endsWith(".js")&&i){try{await e3(t,e)}catch{await S1(e)}return}if(t.endsWith(".cjs")||t.endsWith(".js")&&!i)try{await i3(t,e)}catch{await S1(e)}},Q={create:async t=>{await A(".lintstagedrc.json",JSON.stringify(z(t),null,2))},exists:async()=>{for(let t of At)if(await c(t))return!0;return!1},install:async t=>{await H2("lint-staged",{corepack:!1,packageManager:t,silent:!0,workspace:await k()})},update:async t=>{let e=null;for(let i of At)if(await c(i)){e=i;break}if(!e){await S1(t);return}await o3(e,t)}};import{readFile as n3,writeFile as P1}from"fs/promises";import{dlxCommand as s3}from"nypm";var K="./.pre-commit-config.yaml",r3=/^repos:\s*\n/m,Ft=t=>s3(t,"ultracite",{args:["fix"],short:t==="npm"}),a3=t=>`repos:
248
+ - repo: local
249
+ hooks:
250
+ - id: ultracite
251
+ name: ultracite
252
+ entry: ${Ft(t)}
253
+ language: system
254
+ types_or: [javascript, jsx, ts, tsx, json, css]
255
+ pass_filenames: false
256
+ `,l1={create:async t=>{let e=a3(t);await P1(K,e)},exists:()=>c(K),update:async t=>{let e=await n3(K,"utf8"),i=Ft(t);if(e.includes("id: ultracite"))return;let o=` - repo: local
257
+ hooks:
258
+ - id: ultracite
259
+ name: ultracite
260
+ entry: ${i}
261
+ language: system
262
+ types_or: [javascript, jsx, ts, tsx, json, css]
263
+ pass_filenames: false
264
+ `;if(e.includes("repos:")){let n=e.replace(r3,`repos:
265
+ ${o}`);await P1(K,n)}else await P1(K,`${e}
266
+ repos:
267
+ ${o}`)}};import{readFile as l3,writeFile as Bt}from"fs/promises";import c3 from"deepmerge";import{parse as f3}from"jsonc-parser";var Et={$schema:"./node_modules/@biomejs/biome/configuration_schema.json",extends:["ultracite/biome/core"]},O1=async()=>await c("./biome.json")?"./biome.json":"./biome.jsonc",c1={create:async t=>{let e=await O1(),i=["ultracite/biome/core"];if(t?.typeAware&&i.push("ultracite/biome/type-aware"),t?.frameworks&&t.frameworks.length>0)for(let n of t.frameworks)i.push(`ultracite/biome/${n}`);let o={...Et,extends:i};return Bt(e,JSON.stringify(o,null,2))},exists:async()=>{let t=await O1();return c(t)},update:async t=>{let e=await O1(),i=await l3(e,"utf8"),n=f3(i)||{},r=[...n.extends&&Array.isArray(n.extends)?n.extends:[]];if(r.includes("ultracite/biome/core")||r.push("ultracite/biome/core"),t?.typeAware&&!r.includes("ultracite/biome/type-aware")&&r.push("ultracite/biome/type-aware"),t?.frameworks&&t.frameworks.length>0)for(let d of t.frameworks){let h=`ultracite/biome/${d}`;r.includes(h)||r.push(h)}n.extends=r;let a={$schema:Et.$schema},f=c3(n,a);await Bt(e,JSON.stringify(f,null,2))}};import{writeFile as Ut}from"fs/promises";var d3=["./eslint.config.mjs","./eslint.config.js","./eslint.config.cjs","./eslint.config.ts","./eslint.config.mts","./eslint.config.cts"],$t="./eslint.config.mjs",m3=async()=>{for(let t of d3)if(await c(t))return t;return null},_t=t=>{let e=['import core from "ultracite/eslint/core";'],i=["...core"];if(t?.frameworks&&t.frameworks.length>0)for(let o of t.frameworks)e.push(`import ${o} from "ultracite/eslint/${o}";`),i.push(`...${o}`);return`${e.join(`
268
268
  `)}
269
269
 
270
270
  export default [
271
271
  ${i.join(`,
272
272
  `)},
273
273
  ];
274
- `},g1={exists:async()=>await E3()!==null,create:async t=>{let e=Zt(t);await Qt(Kt,e)},update:async t=>{let e=Zt(t);await Qt(Kt,e)}};m();import{readFile as B3,writeFile as Yt}from"fs/promises";import U3 from"deepmerge";import{parse as $3}from"jsonc-parser";var u1="./.oxfmtrc.jsonc",qt={$schema:"./node_modules/oxfmt/configuration_schema.json",printWidth:80,tabWidth:2,useTabs:!1,semi:!0,singleQuote:!1,quoteProps:"as-needed",jsxSingleQuote:!1,trailingComma:"es5",bracketSpacing:!0,bracketSameLine:!1,arrowParens:"always",endOfLine:"lf",experimentalSortPackageJson:!0,experimentalSortImports:{ignoreCase:!0,newlinesBetween:!0,order:"asc"}},h1={exists:async()=>await l(u1),create:async()=>{let t=`// Ultracite oxfmt Configuration
274
+ `},f1={create:async t=>{let e=_t(t);await Ut($t,e)},exists:async()=>await m3()!==null,update:async t=>{let e=_t(t);await Ut($t,e)}};import{readFile as p3,writeFile as Lt}from"fs/promises";import g3 from"deepmerge";import{parse as u3}from"jsonc-parser";var d1="./.oxfmtrc.jsonc",Dt={$schema:"./node_modules/oxfmt/configuration_schema.json",arrowParens:"always",bracketSameLine:!1,bracketSpacing:!0,endOfLine:"lf",experimentalSortImports:{ignoreCase:!0,newlinesBetween:!0,order:"asc"},experimentalSortPackageJson:!0,jsxSingleQuote:!1,printWidth:80,quoteProps:"as-needed",semi:!0,singleQuote:!1,tabWidth:2,trailingComma:"es5",useTabs:!1},m1={create:async()=>{let t=`// Ultracite oxfmt Configuration
275
275
  // https://oxc.rs/docs/guide/usage/formatter/config-file-reference.html
276
- ${JSON.stringify(qt,null,2)}
277
- `;return await Yt(u1,t)},update:async()=>{let t=await B3(u1,"utf-8"),i=$3(t)||{},o=U3(i,qt),n=`// Ultracite oxfmt Configuration
276
+ ${JSON.stringify(Dt,null,2)}
277
+ `;return await Lt(d1,t)},exists:async()=>await c(d1),update:async()=>{let t=await p3(d1,"utf8"),i=u3(t)||{},o=g3(i,Dt),n=`// Ultracite oxfmt Configuration
278
278
  // https://oxc.rs/docs/guide/usage/formatter/config-file-reference.html
279
279
  ${JSON.stringify(o,null,2)}
280
- `;await Yt(u1,n)}};m();import{readFile as _3,writeFile as te}from"fs/promises";import L3 from"deepmerge";import{parse as D3}from"jsonc-parser";var w1="./.oxlintrc.json",J=t=>`./node_modules/ultracite/config/oxlint/${t}/.oxlintrc.json`,ee={$schema:"./node_modules/oxlint/configuration_schema.json",extends:[J("core")]},x1={exists:async()=>await l(w1),create:async t=>{let e=[J("core")];if(t?.frameworks&&t.frameworks.length>0)for(let o of t.frameworks)e.push(J(o));let i={...ee,extends:e};return await te(w1,JSON.stringify(i,null,2))},update:async t=>{let e=await _3(w1,"utf-8"),o=D3(e)||{},n=o.extends&&Array.isArray(o.extends)?o.extends:[],s=d=>n.some(g=>g===J(d)),r=[...n];if(s("core")||r.push(J("core")),t?.frameworks&&t.frameworks.length>0)for(let d of t.frameworks)s(d)||r.push(J(d));o.extends=r;let a={$schema:ee.$schema},f=L3(o,a);await te(w1,JSON.stringify(f,null,2))}};m();import{readFile as N3,writeFile as ie}from"fs/promises";var R3=["./.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"],oe="./prettier.config.mjs",T3=async()=>{try{return"prettier"in JSON.parse(await N3("./package.json","utf-8"))}catch{return!1}},G3=async()=>{if(await T3())return"./package.json";for(let t of R3)if(await l(t))return t;return null},ne=()=>`export { default } from "ultracite/prettier";
281
- `,v1={exists:async()=>await G3()!==null,create:async()=>{let t=ne();await ie(oe,t)},update:async()=>{let t=ne();await ie(oe,t)}};m();import{readFile as M3,writeFile as se}from"fs/promises";var J3=["./.stylelintrc.mjs","./stylelint.config.mjs","./.stylelintrc.cjs","./stylelint.config.cjs","./.stylelintrc.js","./stylelint.config.js","./.stylelintrc","./.stylelintrc.json","./.stylelintrc.yml","./.stylelintrc.yaml"],re="./stylelint.config.mjs",W3=async()=>{try{return"stylelint"in JSON.parse(await M3("./package.json","utf-8"))}catch{return!1}},H3=async()=>{if(await W3())return"./package.json";for(let t of J3)if(await l(t))return t;return null},ae=()=>`export { default } from "ultracite/stylelint";
282
- `,y1={exists:async()=>await H3()!==null,create:async()=>{let t=ae();await se(re,t)},update:async()=>{let t=ae();await se(re,t)}};import{readFile as V3,writeFile as ce}from"fs/promises";import{glob as X3}from"glob";import{applyEdits as Q3,modify as K3,parse as Z3}from"jsonc-parser";var le=async()=>{try{return await X3("**/tsconfig*.json",{ignore:["**/node_modules/**","**/dist/**","**/build/**","**/.next/**"],absolute:!1})}catch{return[]}},Y3=t=>{if(!t)return!1;let e=t.compilerOptions;return e?e.strict===!0||e.strictNullChecks===!0:!1},q3=async t=>{try{let e=await V3(t,"utf-8"),i=Z3(e);if(Y3(i))return;if(i===void 0){await ce(t,JSON.stringify({compilerOptions:{strictNullChecks:!0}},null,2));return}let n=K3(e,["compilerOptions","strictNullChecks"],!0,{formattingOptions:{tabSize:2,insertSpaces:!0}}),s=Q3(e,n);await ce(t,s)}catch(e){console.warn(`Failed to update ${t}:`,e)}},R1={exists:async()=>(await le()).length>0,update:async()=>{let t=await le();if(t.length===0){console.warn("No tsconfig.json files found in the project");return}await Promise.all(t.map(e=>q3(e)))}};m();var fe=k.devDependencies["@biomejs/biome"],T1=k.version,si={angular:["@angular-eslint/eslint-plugin@latest"],astro:["eslint-plugin-astro@latest"],next:["@next/eslint-plugin-next@latest"],qwik:["eslint-plugin-qwik@latest"],react:["eslint-plugin-react@latest","eslint-plugin-react-hooks@latest","eslint-plugin-jsx-a11y@latest","@tanstack/eslint-plugin-query@latest"],remix:["eslint-plugin-remix@latest"],solid:["eslint-plugin-solid@latest"],svelte:["eslint-plugin-svelte@latest"],vue:["eslint-plugin-vue@latest"]},ri=(t,e)=>{for(let i of e){let o=si[i];o&&t.push(...o)}},ai=(t,e)=>{let i={ultracite:T1};return t==="biome"&&(i["@biomejs/biome"]=fe),t==="eslint"&&(i.eslint="latest",i.prettier="latest",i.stylelint="latest"),t==="oxlint"&&(i.oxlint="latest",i.oxfmt="latest",e&&(i["oxlint-tsgolint"]="latest")),i},ci=async(t,e="biome",i=!0,o=!1,n=!1,s=["react"])=>{let r=h();o||r.start("Installing dependencies...");let a=[`ultracite@${T1}`];if(e==="biome"&&a.push(`@biomejs/biome@${fe}`),e==="eslint"&&(a.push("eslint@latest"),a.push("@typescript-eslint/eslint-plugin@latest","@typescript-eslint/parser@latest","eslint-config-prettier@latest","eslint-import-resolver-typescript@latest","eslint-plugin-compat@latest","eslint-plugin-cypress@latest","eslint-plugin-github@latest","eslint-plugin-html@latest","eslint-plugin-import@latest","eslint-plugin-jest@latest","eslint-plugin-n@latest","eslint-plugin-prettier@latest","eslint-plugin-promise@latest","eslint-plugin-sonarjs@latest","eslint-plugin-storybook@latest","eslint-plugin-unicorn@latest","eslint-plugin-unused-imports@latest","globals@latest"),ri(a,s),a.push("prettier@latest"),a.push("stylelint@latest")),e==="oxlint"&&(a.push("oxlint@latest"),a.push("oxfmt@latest"),n&&a.push("oxlint-tsgolint@latest")),i)for(let d of a)await oi(d,{packageManager:t,workspace:await b(),silent:!0,corepack:!1});else{let d=ai(e,n);await v({devDependencies:d})}let f=n?" --type-aware":"";await v({scripts:{check:`ultracite check${f}`,fix:`ultracite fix${f}`}}),o||r.stop("Dependencies installed.")},li=async(t=!1)=>{let e=h();if(t||e.start("Checking for tsconfig.json files..."),await R1.exists()){t||e.message("Found tsconfig.json files, updating with strictNullChecks..."),await R1.update(),t||e.stop("tsconfig.json files updated.");return}t||e.stop("No tsconfig.json files found, skipping.")},fi=async(t,e="biome",i=!1)=>{let o=R.find(r=>r.id===t);if(!o)throw new Error(`Editor "${t}" not found`);let n=Ut(t,e),s=h();if(i||s.start(`Checking for ${o.config.path}...`),await n.exists()){i||s.message(`${o.config.path} found, updating...`),await n.update(),i||s.stop(`${o.config.path} updated.`);return}if(i||s.message(`${o.config.path} not found, creating...`),await n.create(),n.extension){let r=d1.find(a=>a.id===e)?.vscodeExtensionId;if(!r)throw new Error(`Linter extension not found for ${e}`);i||s.message(`Installing ${r} extension...`);try{if(n.extension(r).status===0){i||s.stop(`${o.config.path} created and ${r} extension installed.`);return}}catch{}i||s.stop(`${o.config.path} created. Install ${r} extension manually.`);return}i||(t==="zed"?s.stop(`${o.config.path} created. Install the Biome extension: https://biomejs.dev/reference/zed/`):s.stop(`${o.config.path} created.`))},di=async(t,e=!1)=>{let i=h();if(e||i.start("Checking for Biome configuration..."),await m1.exists()){e||i.message("Biome configuration found, updating..."),await m1.update({frameworks:t}),e||i.stop("Biome configuration updated.");return}e||i.message("Biome configuration not found, creating..."),await m1.create({frameworks:t}),e||i.stop("Biome configuration created.")},pi=async(t,e=!1)=>{let i=h();if(e||i.start("Checking for ESLint configuration..."),await g1.exists()){e||i.message("ESLint configuration found, updating..."),await g1.update({frameworks:t}),e||i.stop("ESLint configuration updated.");return}e||i.message("ESLint configuration not found, creating..."),await g1.create({frameworks:t}),e||i.stop("ESLint configuration created.")},mi=async(t,e=!1)=>{let i=h();if(e||i.start("Checking for Oxlint configuration..."),await x1.exists()){e||i.message("Oxlint configuration found, updating..."),await x1.update({frameworks:t}),e||i.stop("Oxlint configuration updated.");return}e||i.message("Oxlint configuration not found, creating..."),await x1.create({frameworks:t}),e||i.stop("Oxlint configuration created.")},gi=async(t=!1)=>{let e=h();if(t||e.start("Checking for Prettier configuration..."),await v1.exists()){t||e.message("Prettier configuration found, updating..."),await v1.update(),t||e.stop("Prettier configuration updated.");return}t||e.message("Prettier configuration not found, creating..."),await v1.create(),t||e.stop("Prettier configuration created.")},ui=async(t=!1)=>{let e=h();if(t||e.start("Checking for Stylelint configuration..."),await y1.exists()){t||e.message("Stylelint configuration found, updating..."),await y1.update(),t||e.stop("Stylelint configuration updated.");return}t||e.message("Stylelint configuration not found, creating..."),await y1.create(),t||e.stop("Stylelint configuration created.")},hi=async(t=!1)=>{let e=h();if(t||e.start("Checking for oxfmt configuration..."),await h1.exists()){t||e.message("oxfmt configuration found, updating..."),await h1.update(),t||e.stop("oxfmt configuration updated.");return}t||e.message("oxfmt configuration not found, creating..."),await h1.create(),t||e.stop("oxfmt configuration created.")},wi=async(t,e=!0,i=!1,o=!1)=>{let n=h();if(i||(n.start("Initializing pre-commit hooks..."),n.message("Installing Husky...")),e?await I.install(t):await v({devDependencies:{husky:"latest"},scripts:{prepare:"husky"}}),i||n.message("Initializing Husky..."),I.init(t.name),await I.exists()){i||n.message("Pre-commit hook found, updating..."),await I.update(t.name,o),i||n.stop("Pre-commit hook updated.");return}i||n.message("Pre-commit hook not found, creating..."),await I.create(t.name,o),i||n.stop("Pre-commit hook created.")},xi=async(t,e=!0,i=!1)=>{let o=h();if(i||(o.start("Initializing lefthook..."),o.message("Installing lefthook...")),e?await G.install(t):await v({devDependencies:{lefthook:"latest"}}),await G.exists()){i||o.message("lefthook.yml found, updating..."),await G.update(t.name),i||o.stop("lefthook.yml updated.");return}i||o.message("lefthook.yml not found, creating..."),await G.create(t.name),i||o.stop("lefthook.yml created.")},vi=async(t,e=!0,i=!1)=>{let o=h();if(i||(o.start("Initializing lint-staged..."),o.message("Installing lint-staged...")),e?await M.install(t):await v({devDependencies:{"lint-staged":"latest"}}),await M.exists()){i||o.message("lint-staged found, updating..."),await M.update(t.name),i||o.stop("lint-staged updated.");return}i||o.message("lint-staged not found, creating..."),await M.create(t.name),i||o.stop("lint-staged created.")},yi=async(t,e=!1)=>{let i=h();if(e||i.start("Initializing pre-commit..."),await q.exists()){e||i.message(".pre-commit-config.yaml found, updating..."),await q.update(t),e||i.stop(".pre-commit-config.yaml updated.");return}e||i.message(".pre-commit-config.yaml not found, creating..."),await q.create(t),e||i.stop(".pre-commit-config.yaml created.")},ki=async(t,e,i,o,n=!1)=>{let s=h();n||s.start(`Checking for ${e}...`);let r=Bt(t,i,o);if(await r.exists()){n||s.message(`${e} found, updating...`),await r.update(),n||s.stop(`${e} updated.`);return}n||s.message(`${e} not found, creating...`),await r.create(),n||s.stop(`${e} created.`)},bi=async(t,e,i="biome",o=!1)=>{let n=h(),s=X.find(a=>a.id===t)?.name??t;o||n.start(`Checking for ${s} hooks...`);let r=$t(t,e,i);if(await r.exists()){o||n.message(`${s} hooks found, updating...`),await r.update(),o||n.stop(`${s} hooks updated.`);return}o||n.message(`${s} hooks not found, creating...`),await r.create(),o||n.stop(`${s} hooks created.`)},de=async t=>{let e=t??{},i=e.quiet??!1;i||ei(`Ultracite v${T1} Initialization`);try{let{pm:o}=e,n;if(o)n={name:o,command:o};else{let c=await ni(ti.cwd());if(!c)throw new Error("No package manager specified or detected");if(!i&&c.warnings)for(let u of c.warnings)e1.warn(u);i||e1.info(`Detected lockfile, using ${c.name}`),o=c.name,n=c}let s=e.linter;if(s===void 0)if(i||e.pm||e.editors||e.agents||e.hooks||e.integrations!==void 0||e.frameworks!==void 0)s="biome";else{let u=await ii({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(H(u)){W("Operation cancelled.");return}s=u}let r=e.frameworks;if(r===void 0)if(i||e.pm||e.editors||e.agents||e.hooks||e.integrations!==void 0)r=[];else{let u=await i1({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"}],required:!1});if(H(u)){W("Operation cancelled.");return}r=u}let a=e.editors;if(!a)if(i)a=[];else{let c=await i1({message:"Which editors do you want to configure (recommended)?",options:[{label:"VSCode / Cursor / Windsurf",value:"vscode"},{label:"Zed",value:"zed"}],required:!1});if(H(c)){W("Operation cancelled.");return}a=c}let f=e.agents,d=e.hooks,g=Object.fromEntries(D.map(c=>[c.id,c.name]));if(!f)if(i)f=[];else{let c=await i1({message:"Which agents do you want to enable (optional)?",options:Object.entries(g).map(([u,k1])=>({value:u,label:k1})),required:!1});if(H(c)){W("Operation cancelled.");return}f=c}let E=Object.fromEntries(X.map(c=>[c.id,c.name]));if(!d)if(i)d=[];else{let c=await i1({message:"Which agent hooks do you want to enable (optional)?",options:Object.entries(E).map(([u,k1])=>({value:u,label:k1})),required:!1});if(H(c)){W("Operation cancelled.");return}d=c}let x=e.integrations;if(x===void 0)if(i||e.pm||e.editors||e.agents||e.hooks)x=[];else{let u=await i1({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(H(u)){W("Operation cancelled.");return}x=u}await ci(n,s,!e.skipInstall,i,e["type-aware"],r),await li(i),s==="biome"&&await di(r,i),s==="eslint"&&(await pi(r,i),await gi(i),await ui(i)),s==="oxlint"&&(await mi(r,i),await hi(i));for(let c of a??[])await fi(c,s,i);for(let c of f??[])await ki(c,g[c],o,s,i);for(let c of d??[])await bi(c,o,s,i);if(x?.includes("husky")){let c=x?.includes("lint-staged")??!1;await wi(n,!e.skipInstall,i,c)}x?.includes("lefthook")&&await xi(n,!e.skipInstall,i),x?.includes("lint-staged")&&await vi(n,!e.skipInstall,i),x?.includes("pre-commit")&&await yi(o,i),i||(e1.success("Successfully initialized Ultracite!"),e1.info("You can also run `npx skills add haydenbleasel/ultracite` to install the Ultracite skill."))}catch(o){let n=o instanceof Error?o.message:"Unknown error";throw i||e1.error(`Failed to initialize Ultracite configuration: ${n}`),o}};var V=new zi;V.name("ultracite").version(k.version).description(k.description);V.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").option("--hooks <hooks...>","Hooks to enable").option("--frameworks <frameworks...>","Frameworks being used").option("--integrations <integrations...>","Integrations to enable").option("--type-aware","Enable type-aware linting (enables project/scanner rules)").option("--skip-install","Skip installing dependencies").option("--quiet","Suppress interactive prompts").action(async t=>{await de({pm:t.pm,linter:t.linter,editors:t.editors,agents:t.agents,hooks:t.hooks,frameworks:t.frameworks,integrations:t.integrations,"type-aware":t.typeAware,skipInstall:t.skipInstall,quiet:t.quiet??(process.env.CI==="true"||process.env.CI==="1")})});V.command("check").argument("[files...]","Files to check").description("Run linter without fixing files. Unknown options are passed to the underlying linter.").allowUnknownOption().action(async t=>{let e=process.argv.indexOf("check"),o=process.argv.slice(e+1).filter(s=>s.startsWith("-")),n=t.filter(s=>!s.startsWith("--"));await H1(n,o)});V.command("fix").argument("[files...]","Files to fix").description("Run linter and fix files. Unknown options are passed to the underlying linter.").allowUnknownOption().action(async t=>{let e=process.argv.indexOf("fix"),o=process.argv.slice(e+1).filter(s=>s.startsWith("-")),n=t.filter(s=>!s.startsWith("--"));await Q1(n,o)});V.command("doctor").description("Verify your Ultracite setup").action(async()=>{await X1()});process.env.TEST||V.parse();export{V as program};
280
+ `;await Lt(d1,n)}};import{readFile as h3,writeFile as Nt}from"fs/promises";import w3 from"deepmerge";import{parse as x3}from"jsonc-parser";var p1="./.oxlintrc.json",N=t=>`./node_modules/ultracite/config/oxlint/${t}/.oxlintrc.json`,Rt={$schema:"./node_modules/oxlint/configuration_schema.json",extends:[N("core")]},g1={create:async t=>{let e=[N("core")];if(t?.frameworks&&t.frameworks.length>0)for(let o of t.frameworks)e.push(N(o));let i={...Rt,extends:e};return await Nt(p1,JSON.stringify(i,null,2))},exists:async()=>await c(p1),update:async t=>{let e=await h3(p1,"utf8"),o=x3(e)||{},n=o.extends&&Array.isArray(o.extends)?o.extends:[],s=d=>n.some(h=>h===N(d)),r=[...n];if(s("core")||r.push(N("core")),t?.frameworks&&t.frameworks.length>0)for(let d of t.frameworks)s(d)||r.push(N(d));o.extends=r;let a={$schema:Rt.$schema},f=w3(o,a);await Nt(p1,JSON.stringify(f,null,2))}};import{readFile as v3,writeFile as Tt}from"fs/promises";var y3=["./.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"],Gt="./prettier.config.mjs",k3=async()=>{try{return"prettier"in JSON.parse(await v3("./package.json","utf8"))}catch{return!1}},b3=async()=>{if(await k3())return"./package.json";for(let t of y3)if(await c(t))return t;return null},Mt=()=>`export { default } from "ultracite/prettier";
281
+ `,u1={create:async()=>{let t=Mt();await Tt(Gt,t)},exists:async()=>await b3()!==null,update:async()=>{let t=Mt();await Tt(Gt,t)}};import{readFile as z3,writeFile as Jt}from"fs/promises";var C3=["./.stylelintrc.mjs","./stylelint.config.mjs","./.stylelintrc.cjs","./stylelint.config.cjs","./.stylelintrc.js","./stylelint.config.js","./.stylelintrc","./.stylelintrc.json","./.stylelintrc.yml","./.stylelintrc.yaml"],Wt="./stylelint.config.mjs",S3=async()=>{try{return"stylelint"in JSON.parse(await z3("./package.json","utf8"))}catch{return!1}},j3=async()=>{if(await S3())return"./package.json";for(let t of C3)if(await c(t))return t;return null},Ht=()=>`export { default } from "ultracite/stylelint";
282
+ `,h1={create:async()=>{let t=Ht();await Jt(Wt,t)},exists:async()=>await j3()!==null,update:async()=>{let t=Ht();await Jt(Wt,t)}};import{readFile as P3,writeFile as Vt}from"fs/promises";import{glob as O3}from"glob";import{applyEdits as A3,modify as I3,parse as F3}from"jsonc-parser";var Xt=async()=>{try{return await O3("**/tsconfig*.json",{absolute:!1,ignore:["**/node_modules/**","**/dist/**","**/build/**","**/.next/**"]})}catch{return[]}},B3=t=>{if(!t)return!1;let e=t.compilerOptions;return e?e.strict===!0||e.strictNullChecks===!0:!1},E3=async t=>{try{let e=await P3(t,"utf8"),i=F3(e);if(B3(i))return;if(i===void 0){await Vt(t,JSON.stringify({compilerOptions:{strictNullChecks:!0}},null,2));return}let n=I3(e,["compilerOptions","strictNullChecks"],!0,{formattingOptions:{insertSpaces:!0,tabSize:2}}),s=A3(e,n);await Vt(t,s)}catch(e){console.warn(`Failed to update ${t}:`,e)}},A1={exists:async()=>(await Xt()).length>0,update:async()=>{let t=await Xt();if(t.length===0){console.warn("No tsconfig.json files found in the project");return}await Promise.all(t.map(e=>E3(e)))}};var Qt=y.devDependencies["@biomejs/biome"],I1=y.version,N3={angular:["@angular-eslint/eslint-plugin@latest"],astro:["eslint-plugin-astro@latest"],jest:["eslint-plugin-jest@latest"],next:["@next/eslint-plugin-next@latest"],qwik:["eslint-plugin-qwik@latest"],react:["eslint-plugin-react@latest","eslint-plugin-react-hooks@latest","eslint-plugin-jsx-a11y@latest","@tanstack/eslint-plugin-query@latest"],remix:["eslint-plugin-remix@latest"],solid:["eslint-plugin-solid@latest"],svelte:["eslint-plugin-svelte@latest"],vitest:["@vitest/eslint-plugin@latest"],vue:["eslint-plugin-vue@latest"]},R3=(t,e)=>{for(let i of e){let o=N3[i];o&&t.push(...o)}},T3=(t,e)=>{let i={ultracite:I1};return t==="biome"&&(i["@biomejs/biome"]=Qt),t==="eslint"&&(i.eslint="latest",i.prettier="latest",i.stylelint="latest"),t==="oxlint"&&(i.oxlint="latest",i.oxfmt="latest",e&&(i["oxlint-tsgolint"]="latest")),i},G3=async(t,e="biome",i=!0,o=!1,n=!1,s=["react"])=>{let r=p();o||r.start("Installing dependencies...");let a=[`ultracite@${I1}`];if(e==="biome"&&a.push(`@biomejs/biome@${Qt}`),e==="eslint"&&(a.push("eslint@latest"),a.push("@typescript-eslint/eslint-plugin@latest","@typescript-eslint/parser@latest","eslint-config-prettier@latest","eslint-import-resolver-typescript@latest","eslint-plugin-compat@latest","eslint-plugin-cypress@latest","eslint-plugin-github@latest","eslint-plugin-html@latest","eslint-plugin-import-x@latest","eslint-plugin-n@latest","eslint-plugin-prettier@latest","eslint-plugin-promise@latest","eslint-plugin-sonarjs@latest","eslint-plugin-storybook@latest","eslint-plugin-unicorn@latest","eslint-plugin-unused-imports@latest","globals@latest"),R3(a,s),a.push("prettier@latest"),a.push("stylelint@latest")),e==="oxlint"&&(a.push("oxlint@latest"),a.push("oxfmt@latest"),n&&a.push("oxlint-tsgolint@latest")),i)for(let f of a)await L3(f,{corepack:!1,packageManager:t,silent:!0,workspace:await k()});else{let f=T3(e,n);await x({devDependencies:f})}await x({scripts:{check:"ultracite check",fix:"ultracite fix"}}),o||r.stop("Dependencies installed.")},M3=async(t=!1)=>{let e=p();if(t||e.start("Checking for tsconfig.json files..."),await A1.exists()){t||e.message("Found tsconfig.json files, updating with strictNullChecks..."),await A1.update(),t||e.stop("tsconfig.json files updated.");return}t||e.stop("No tsconfig.json files found, skipping.")},J3=async(t,e="biome",i=!1)=>{let o=_.find(r=>r.id===t);if(!o)throw new Error(`Editor "${t}" not found`);let n=bt(t,e),s=p();if(i||s.start(`Checking for ${o.config.path}...`),await n.exists()){i||s.message(`${o.config.path} found, updating...`),await n.update(),i||s.stop(`${o.config.path} updated.`);return}if(i||s.message(`${o.config.path} not found, creating...`),await n.create(),n.extension){let r=r1.find(a=>a.id===e)?.vscodeExtensionId;if(!r)throw new Error(`Linter extension not found for ${e}`);i||s.message(`Installing ${r} extension...`);try{if(n.extension(r).status===0){i||s.stop(`${o.config.path} created and ${r} extension installed.`);return}}catch{}i||s.stop(`${o.config.path} created. Install ${r} extension manually.`);return}i||(t==="zed"?s.stop(`${o.config.path} created. Install the Biome extension: https://biomejs.dev/reference/zed/`):s.stop(`${o.config.path} created.`))},W3=async(t,e=!1,i=!1)=>{let o=p();if(e||o.start("Checking for Biome configuration..."),await c1.exists()){e||o.message("Biome configuration found, updating..."),await c1.update({frameworks:t,typeAware:i}),e||o.stop("Biome configuration updated.");return}e||o.message("Biome configuration not found, creating..."),await c1.create({frameworks:t,typeAware:i}),e||o.stop("Biome configuration created.")},H3=async(t,e=!1)=>{let i=p();if(e||i.start("Checking for ESLint configuration..."),await f1.exists()){e||i.message("ESLint configuration found, updating..."),await f1.update({frameworks:t}),e||i.stop("ESLint configuration updated.");return}e||i.message("ESLint configuration not found, creating..."),await f1.create({frameworks:t}),e||i.stop("ESLint configuration created.")},V3=async(t,e=!1)=>{let i=p();if(e||i.start("Checking for Oxlint configuration..."),await g1.exists()){e||i.message("Oxlint configuration found, updating..."),await g1.update({frameworks:t}),e||i.stop("Oxlint configuration updated.");return}e||i.message("Oxlint configuration not found, creating..."),await g1.create({frameworks:t}),e||i.stop("Oxlint configuration created.")},X3=async(t=!1)=>{let e=p();if(t||e.start("Checking for Prettier configuration..."),await u1.exists()){t||e.message("Prettier configuration found, updating..."),await u1.update(),t||e.stop("Prettier configuration updated.");return}t||e.message("Prettier configuration not found, creating..."),await u1.create(),t||e.stop("Prettier configuration created.")},Q3=async(t=!1)=>{let e=p();if(t||e.start("Checking for Stylelint configuration..."),await h1.exists()){t||e.message("Stylelint configuration found, updating..."),await h1.update(),t||e.stop("Stylelint configuration updated.");return}t||e.message("Stylelint configuration not found, creating..."),await h1.create(),t||e.stop("Stylelint configuration created.")},K3=async(t=!1)=>{let e=p();if(t||e.start("Checking for oxfmt configuration..."),await m1.exists()){t||e.message("oxfmt configuration found, updating..."),await m1.update(),t||e.stop("oxfmt configuration updated.");return}t||e.message("oxfmt configuration not found, creating..."),await m1.create(),t||e.stop("oxfmt configuration created.")},Z3=async(t,e=!0,i=!1,o=!1)=>{let n=p();if(i||(n.start("Initializing pre-commit hooks..."),n.message("Installing Husky...")),await(e?D.install(t):x({devDependencies:{husky:"latest"},scripts:{prepare:"husky"}})),i||n.message("Initializing Husky..."),D.init(t.name),await D.exists()){i||n.message("Pre-commit hook found, updating..."),await D.update(t.name,o),i||n.stop("Pre-commit hook updated.");return}i||n.message("Pre-commit hook not found, creating..."),await D.create(t.name,o),i||n.stop("Pre-commit hook created.")},Y3=async(t,e=!0,i=!1)=>{let o=p();if(i||(o.start("Initializing lefthook..."),o.message("Installing lefthook...")),await(e?V.install(t):x({devDependencies:{lefthook:"latest"}})),await V.exists()){i||o.message("lefthook.yml found, updating..."),await V.update(t.name),i||o.stop("lefthook.yml updated.");return}i||o.message("lefthook.yml not found, creating..."),await V.create(t.name),i||o.stop("lefthook.yml created.")},q3=async(t,e=!0,i=!1)=>{let o=p();if(i||(o.start("Initializing lint-staged..."),o.message("Installing lint-staged...")),await(e?Q.install(t):x({devDependencies:{"lint-staged":"latest"}})),await Q.exists()){i||o.message("lint-staged found, updating..."),await Q.update(t.name),i||o.stop("lint-staged updated.");return}i||o.message("lint-staged not found, creating..."),await Q.create(t.name),i||o.stop("lint-staged created.")},ti=async(t,e=!1)=>{let i=p();if(e||i.start("Initializing pre-commit..."),await l1.exists()){e||i.message(".pre-commit-config.yaml found, updating..."),await l1.update(t),e||i.stop(".pre-commit-config.yaml updated.");return}e||i.message(".pre-commit-config.yaml not found, creating..."),await l1.create(t),e||i.stop(".pre-commit-config.yaml created.")},ei=async(t,e,i,o,n=!1)=>{let s=p();n||s.start(`Checking for ${e}...`);let r=kt(t,i,o);if(await r.exists()){n||s.message(`${e} found, updating...`),await r.update(),n||s.stop(`${e} updated.`);return}n||s.message(`${e} not found, creating...`),await r.create(),n||s.stop(`${e} created.`)},ii=async(t,e,i="biome",o=!1)=>{let n=p(),s=M.find(a=>a.id===t)?.name??t;o||n.start(`Checking for ${s} hooks...`);let r=zt(t,e,i);if(await r.exists()){o||n.message(`${s} hooks found, updating...`),await r.update(),o||n.stop(`${s} hooks updated.`);return}o||n.message(`${s} hooks not found, creating...`),await r.create(),o||n.stop(`${s} hooks created.`)},Kt=async t=>{let e=t??{},i=e.quiet??!1;i||$3(`Ultracite v${I1} Initialization`);try{let{pm:o}=e,n;if(o)n={command:o,name:o};else{let l=await D3(U3.cwd());if(!l)throw new Error("No package manager specified or detected");if(!i&&l.warnings)for(let g of l.warnings)Z.warn(g);i||Z.info(`Detected lockfile, using ${l.name}`),o=l.name,n=l}let{linter:s}=e;if(s===void 0)if(i||e.pm||e.editors||e.agents||e.hooks||e.integrations!==void 0||e.frameworks!==void 0)s="biome";else{let g=await _3({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(T(g)){R("Operation cancelled.");return}s=g}let{frameworks:r}=e;if(r===void 0)if(i||e.pm||e.editors||e.agents||e.hooks||e.integrations!==void 0)r=[];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(T(g)){R("Operation cancelled.");return}r=g}let a=e.editors;if(!a)if(i)a=[];else{let l=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(T(l)){R("Operation cancelled.");return}a=l}let{agents:f}=e,{hooks:d}=e,h=Object.fromEntries(U.map(l=>[l.id,l.name]));if(!f)if(i)f=[];else{let l=await Y({message:"Which agents do you want to enable (optional)?",options:Object.entries(h).map(([g,w1])=>({label:w1,value:g})),required:!1});if(T(l)){R("Operation cancelled.");return}f=l}let q=Object.fromEntries(M.map(l=>[l.id,l.name]));if(!d)if(i)d=[];else{let l=await Y({message:"Which agent hooks do you want to enable (optional)?",options:Object.entries(q).map(([g,w1])=>({label:w1,value:g})),required:!1});if(T(l)){R("Operation cancelled.");return}d=l}let{integrations:w}=e;if(w===void 0)if(i||e.pm||e.editors||e.agents||e.hooks)w=[];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(T(g)){R("Operation cancelled.");return}w=g}await G3(n,s,!e.skipInstall,i,e["type-aware"],r),await M3(i),s==="biome"&&await W3(r,i,e["type-aware"]),s==="eslint"&&(await H3(r,i),await X3(i),await Q3(i)),s==="oxlint"&&(await V3(r,i),await K3(i));for(let l of a??[])await J3(l,s,i);for(let l of f??[])await ei(l,h[l],o,s,i);for(let l of d??[])await ii(l,o,s,i);if(w?.includes("husky")){let l=w?.includes("lint-staged")??!1;await Z3(n,!e.skipInstall,i,l)}w?.includes("lefthook")&&await Y3(n,!e.skipInstall,i),w?.includes("lint-staged")&&await q3(n,!e.skipInstall,i),w?.includes("pre-commit")&&await ti(o,i),i||(Z.success("Successfully initialized Ultracite!"),Z.info("You can also run `npx skills add haydenbleasel/ultracite` to install the Ultracite skill."))}catch(o){let n=o instanceof Error?o.message:"Unknown error";throw i||Z.error(`Failed to initialize Ultracite configuration: ${n}`),o}};var G=new oi;G.name("ultracite").version(y.version).description(y.description);G.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").option("--hooks <hooks...>","Hooks to enable").option("--frameworks <frameworks...>","Frameworks being used").option("--integrations <integrations...>","Integrations to enable").option("--type-aware","Enable type-aware linting (enables project/scanner rules)").option("--skip-install","Skip installing dependencies").option("--quiet","Suppress interactive prompts").action(async t=>{await Kt({agents:t.agents,editors:t.editors,frameworks:t.frameworks,hooks:t.hooks,integrations:t.integrations,linter:t.linter,pm:t.pm,quiet:t.quiet??(process.env.CI==="true"||process.env.CI==="1"),skipInstall:t.skipInstall,"type-aware":t.typeAware})});G.command("check").argument("[files...]","Files to check").description("Run linter without fixing files. Unknown options are passed to the underlying linter.").allowUnknownOption().action(async t=>{let e=process.argv.indexOf("check"),o=process.argv.slice(e+1).filter(s=>s.startsWith("-")),n=t.filter(s=>!s.startsWith("--"));await U1(n,o)});G.command("fix").argument("[files...]","Files to fix").description("Run linter and fix files. Unknown options are passed to the underlying linter.").allowUnknownOption().action(async t=>{let e=process.argv.indexOf("fix"),o=process.argv.slice(e+1).filter(s=>s.startsWith("-")),n=t.filter(s=>!s.startsWith("--"));await L1(n,o)});G.command("doctor").description("Verify your Ultracite setup").action(async()=>{await _1()});process.env.TEST||G.parse();export{G as program};