ultracite 7.1.4 → 7.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/biome/astro/biome.jsonc +10 -0
- package/config/biome/core/biome.jsonc +4 -1
- package/config/biome/nestjs/biome.jsonc +20 -0
- package/config/biome/svelte/biome.jsonc +10 -0
- package/config/biome/vue/biome.jsonc +10 -0
- package/config/eslint/nestjs/eslint.config.mjs +3 -0
- package/config/oxlint/nestjs/.oxlintrc.json +4 -0
- package/dist/index.js +55 -55
- package/package.json +1 -1
|
@@ -7,6 +7,16 @@
|
|
|
7
7
|
"indentScriptAndStyle": true
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
|
+
// Disable organizeImports for Astro files — Biome's import organizer
|
|
11
|
+
// incorrectly removes all imports in template-based files when used with
|
|
12
|
+
// experimentalFullSupportEnabled. Upstream: https://github.com/biomejs/biome/issues/8596
|
|
13
|
+
"assist": {
|
|
14
|
+
"actions": {
|
|
15
|
+
"source": {
|
|
16
|
+
"organizeImports": "off"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
10
20
|
"overrides": [
|
|
11
21
|
{
|
|
12
22
|
"includes": ["**/*.astro"],
|
|
@@ -301,7 +301,10 @@
|
|
|
301
301
|
"useArrayLiterals": "error",
|
|
302
302
|
"useAsConstAssertion": "error",
|
|
303
303
|
"useAtIndex": "error",
|
|
304
|
-
"useBlockStatements":
|
|
304
|
+
"useBlockStatements": {
|
|
305
|
+
"fix": "safe",
|
|
306
|
+
"level": "error"
|
|
307
|
+
},
|
|
305
308
|
"useCollapsedElseIf": "error",
|
|
306
309
|
"useCollapsedIf": "error",
|
|
307
310
|
"useConsistentArrayType": "error",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": false,
|
|
3
|
+
"$schema": "../../../node_modules/@biomejs/biome/configuration_schema.json",
|
|
4
|
+
"linter": {
|
|
5
|
+
"rules": {
|
|
6
|
+
"complexity": {
|
|
7
|
+
// NestJS uses dependency injection via constructor parameter properties
|
|
8
|
+
"noUselessConstructor": "off",
|
|
9
|
+
// NestJS modules are decorator-driven classes that may appear static-only
|
|
10
|
+
"noStaticOnlyClass": "off"
|
|
11
|
+
},
|
|
12
|
+
"style": {
|
|
13
|
+
// NestJS relies on constructor parameter properties for DI
|
|
14
|
+
"noParameterProperties": "off",
|
|
15
|
+
// NestJS ecosystem commonly uses enums for roles, status codes, etc.
|
|
16
|
+
"noEnum": "off"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -7,6 +7,16 @@
|
|
|
7
7
|
"indentScriptAndStyle": true
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
|
+
// Disable organizeImports for Svelte files — Biome's import organizer
|
|
11
|
+
// incorrectly removes all imports in template-based files when used with
|
|
12
|
+
// experimentalFullSupportEnabled. Upstream: https://github.com/biomejs/biome/issues/8596
|
|
13
|
+
"assist": {
|
|
14
|
+
"actions": {
|
|
15
|
+
"source": {
|
|
16
|
+
"organizeImports": "off"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
10
20
|
"overrides": [
|
|
11
21
|
{
|
|
12
22
|
"includes": ["**/*.svelte"],
|
|
@@ -7,6 +7,16 @@
|
|
|
7
7
|
"indentScriptAndStyle": true
|
|
8
8
|
}
|
|
9
9
|
},
|
|
10
|
+
// Disable organizeImports for Vue files — Biome's import organizer
|
|
11
|
+
// incorrectly removes all imports in template-based files when used with
|
|
12
|
+
// experimentalFullSupportEnabled. Upstream: https://github.com/biomejs/biome/issues/8596
|
|
13
|
+
"assist": {
|
|
14
|
+
"actions": {
|
|
15
|
+
"source": {
|
|
16
|
+
"organizeImports": "off"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
10
20
|
"overrides": [
|
|
11
21
|
{
|
|
12
22
|
"includes": ["**/*.vue"],
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var C1=Object.defineProperty;var
|
|
2
|
+
var C1=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var ge=Object.getOwnPropertyNames;var ue=Object.prototype.hasOwnProperty;var S1=(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')}),J1=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 e1=(t,e)=>{for(var i in e)C1(t,i,{get:e[i],enumerable:!0})},he=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ge(e))!ue.call(t,n)&&n!==i&&C1(t,n,{get:()=>e[n],enumerable:!(o=pe(e,n))||o.enumerable});return t};var i1=t=>he(C1({},"__esModule",{value:!0}),t);import{access as xe,mkdir as ve,readFile as H1,writeFile as ye}from"fs/promises";import{dirname as W1,join as j1}from"path";import{parse as ke}from"jsonc-parser";var l,C,y,be,ze,u,b,Ce,Se,je,o1,m=B(()=>{"use strict";l=async t=>{try{return await xe(t),!0}catch{return!1}},C=async()=>{if(await l("pnpm-workspace.yaml"))return!0;try{let t=ke(await H1("package.json","utf-8"));return t?!!t.workspaces||!!t.workspace:!1}catch{return!1}},y=async({dependencies:t,devDependencies:e,scripts:i})=>{let o=await H1("package.json","utf8"),n=JSON.parse(o),r={...n};(n.devDependencies||e)&&(r.devDependencies={...n.devDependencies,...e}),(n.dependencies||t)&&(r.dependencies={...n.dependencies,...t}),(n.scripts||i)&&(r.scripts={...n.scripts,...i}),await ye("package.json",JSON.stringify(r,null,2))},be=/[ $(){}[\]&|;<>!"'`*?#~]/,ze=/'/g,u=t=>t.map(e=>be.test(e)?`'${e.replace(ze,"'\\''")}' `:e),b=async t=>{let e=W1(t);if(e!=="."){let i=e.startsWith("./")?e.slice(2):e;await ve(i,{recursive:!0})}},Ce=["biome.json","biome.jsonc"],Se=["eslint.config.mjs","eslint.config.js","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts"],je=".oxlintrc.json",o1=async()=>{let t=process.cwd();for(;;){for(let i of Ce)if(await l(j1(t,i)))return"biome";for(let i of Se)if(await l(j1(t,i)))return"eslint";if(await l(j1(t,je)))return"oxlint";let e=W1(t);if(e===t)break;t=e}return null}});var Nt={};e1(Nt,{husky:()=>E});import{execSync as i3}from"child_process";import{mkdir as o3,readFile as n3,writeFile as Lt}from"fs/promises";import{addDevDependency as s3,dlxCommand as F1}from"nypm";var Dt,m1,E,B1=B(()=>{"use strict";m();Dt=t=>`#!/bin/sh
|
|
3
3
|
# Exit on any error
|
|
4
4
|
set -e
|
|
5
5
|
|
|
@@ -67,51 +67,51 @@ if [ "$STAGED_HASH" != "$NEW_STAGED_HASH" ]; then
|
|
|
67
67
|
fi
|
|
68
68
|
|
|
69
69
|
exit $FORMAT_EXIT_CODE
|
|
70
|
-
`,m1="./.husky/pre-commit",E={exists:()=>l(m1),install:async t=>{await
|
|
71
|
-
${o}`)}}});var
|
|
70
|
+
`,m1="./.husky/pre-commit",E={exists:()=>l(m1),install:async t=>{await s3("husky",{packageManager:t,workspace:await C(),silent:!0,corepack:!1}),await y({scripts:{prepare:"husky"}})},init:t=>{let e=F1(t,"husky",{args:["init"]});try{i3(e,{stdio:"pipe"})}catch{}},create:async t=>{await o3(".husky",{recursive:!0});let e=F1(t,"ultracite",{args:["fix"],short:t==="npm"}),i=Dt(e);await Lt(m1,i)},update:async t=>{let e=await n3(m1,"utf-8"),i=F1(t,"ultracite",{args:["fix"],short:t==="npm"}),o=Dt(i);await Lt(m1,`${e}
|
|
71
|
+
${o}`)}}});var Mt={};e1(Mt,{lefthook:()=>M});import{execSync as r3}from"child_process";import{readFile as a3,writeFile as K}from"fs/promises";import{addDevDependency as c3,dlxCommand as Tt}from"nypm";var l3,d3,Gt,O,Rt,M,$1=B(()=>{"use strict";m();l3=/(pre-commit:\s*\n\s*jobs:\s*\n)/,d3=/(pre-commit:\s*\n)/,Gt=t=>Tt(t,"ultracite",{args:["fix"],short:t==="npm"}),O="./lefthook.yml",Rt=t=>`pre-commit:
|
|
72
72
|
jobs:
|
|
73
|
-
- run: ${
|
|
74
|
-
glob:
|
|
75
|
-
- "
|
|
76
|
-
- "
|
|
77
|
-
- "
|
|
78
|
-
- "
|
|
79
|
-
- "
|
|
80
|
-
- "
|
|
81
|
-
- "
|
|
73
|
+
- run: ${Gt(t)}
|
|
74
|
+
glob:
|
|
75
|
+
- "**/*.js"
|
|
76
|
+
- "**/*.jsx"
|
|
77
|
+
- "**/*.ts"
|
|
78
|
+
- "**/*.tsx"
|
|
79
|
+
- "**/*.json"
|
|
80
|
+
- "**/*.jsonc"
|
|
81
|
+
- "**/*.css"
|
|
82
82
|
stage_fixed: true
|
|
83
|
-
`,M={exists:()=>l(O),install:async t=>{await
|
|
84
|
-
glob:
|
|
85
|
-
- "
|
|
86
|
-
- "
|
|
87
|
-
- "
|
|
88
|
-
- "
|
|
89
|
-
- "
|
|
90
|
-
- "
|
|
91
|
-
- "
|
|
92
|
-
stage_fixed: true`,s=e.replace(
|
|
83
|
+
`,M={exists:()=>l(O),install:async t=>{await c3("lefthook",{packageManager:t,workspace:await C(),silent:!0,corepack:!1}),await y({scripts:{prepare:"lefthook install"}});let e=Tt(t,"lefthook",{args:["install"],short:t==="npm"});r3(e,{stdio:"pipe"})},create:async t=>{let e=Rt(t);await K(O,e)},update:async t=>{let e=await a3(O,"utf-8"),i=Gt(t),o=Rt(t);if(e.includes(i))return;if(e.startsWith("# EXAMPLE USAGE:")){await K(O,o);return}if(e.includes("pre-commit:"))if(e.includes("jobs:")){let r=` - run: ${i}
|
|
84
|
+
glob:
|
|
85
|
+
- "**/*.js"
|
|
86
|
+
- "**/*.jsx"
|
|
87
|
+
- "**/*.ts"
|
|
88
|
+
- "**/*.tsx"
|
|
89
|
+
- "**/*.json"
|
|
90
|
+
- "**/*.jsonc"
|
|
91
|
+
- "**/*.css"
|
|
92
|
+
stage_fixed: true`,s=e.replace(l3,`$1${r}
|
|
93
93
|
`);await K(O,s)}else{let r=` jobs:
|
|
94
94
|
- run: ${i}
|
|
95
|
-
glob:
|
|
96
|
-
- "
|
|
97
|
-
- "
|
|
98
|
-
- "
|
|
99
|
-
- "
|
|
100
|
-
- "
|
|
101
|
-
- "
|
|
102
|
-
- "
|
|
103
|
-
stage_fixed: true`,s=e.replace(
|
|
95
|
+
glob:
|
|
96
|
+
- "**/*.js"
|
|
97
|
+
- "**/*.jsx"
|
|
98
|
+
- "**/*.ts"
|
|
99
|
+
- "**/*.tsx"
|
|
100
|
+
- "**/*.json"
|
|
101
|
+
- "**/*.jsonc"
|
|
102
|
+
- "**/*.css"
|
|
103
|
+
stage_fixed: true`,s=e.replace(d3,`$1${r}
|
|
104
104
|
`);await K(O,s)}else await K(O,`${e}
|
|
105
|
-
${o}`)}}});var
|
|
105
|
+
${o}`)}}});var Ht={};e1(Ht,{preCommit:()=>Z});import{readFile as f3,writeFile as _1}from"fs/promises";import{dlxCommand as m3}from"nypm";var Y,p3,Jt,g3,Z,U1=B(()=>{"use strict";m();Y="./.pre-commit-config.yaml",p3=/^repos:\s*\n/m,Jt=t=>m3(t,"ultracite",{args:["fix"],short:t==="npm"}),g3=t=>`repos:
|
|
106
106
|
- repo: local
|
|
107
107
|
hooks:
|
|
108
108
|
- id: ultracite
|
|
109
109
|
name: ultracite
|
|
110
|
-
entry: ${
|
|
110
|
+
entry: ${Jt(t)}
|
|
111
111
|
language: system
|
|
112
112
|
types_or: [javascript, jsx, ts, tsx, json, css]
|
|
113
113
|
pass_filenames: false
|
|
114
|
-
`,Z={exists:()=>l(Y),create:async t=>{let e=
|
|
114
|
+
`,Z={exists:()=>l(Y),create:async t=>{let e=g3(t);await _1(Y,e)},update:async t=>{let e=await f3(Y,"utf-8"),i=Jt(t);if(e.includes("id: ultracite"))return;let o=` - repo: local
|
|
115
115
|
hooks:
|
|
116
116
|
- id: ultracite
|
|
117
117
|
name: ultracite
|
|
@@ -119,28 +119,28 @@ ${o}`)}}});var Mt={};e1(Mt,{preCommit:()=>Z});import{readFile as d3,writeFile as
|
|
|
119
119
|
language: system
|
|
120
120
|
types_or: [javascript, jsx, ts, tsx, json, css]
|
|
121
121
|
pass_filenames: false
|
|
122
|
-
`;if(e.includes("repos:")){let n=e.replace(
|
|
123
|
-
${o}`);await
|
|
122
|
+
`;if(e.includes("repos:")){let n=e.replace(p3,`repos:
|
|
123
|
+
${o}`);await _1(Y,n)}else await _1(Y,`${e}
|
|
124
124
|
repos:
|
|
125
|
-
${o}`)}}});var
|
|
126
|
-
`).filter(r=>r.trim()&&!r.trim().startsWith("#")),i={},o=null,n=[];for(let r of e){let s=
|
|
125
|
+
${o}`)}}});var u3,L1=B(()=>{u3=J1({"./husky.ts":()=>(B1(),i1(Nt)),"./lefthook.ts":()=>($1(),i1(Mt)),"./lint-staged.ts":()=>(D1(),i1(Wt)),"./pre-commit.ts":()=>(U1(),i1(Ht))})});var Wt={};e1(Wt,{lintStaged:()=>J});import{readFile as p1,writeFile as F}from"fs/promises";import{pathToFileURL as h3}from"url";import q from"deepmerge";import{parse as R1}from"jsonc-parser";import{addDevDependency as w3,dlxCommand as x3}from"nypm";var j,Vt,v3,y3,k3,b3,z3,C3,S3,j3,P3,N1,A3,J,D1=B(()=>{"use strict";m();L1();j=t=>({"*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}":[x3(t,"ultracite",{args:["fix"],short:t==="npm"})]}),Vt=["./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"],v3=(t,e,i,o)=>{let n=t.trim();if(n.includes(":")&&!n.startsWith("-")){i&&o.length>0&&(e[i]=o);let[r,...s]=n.split(":"),c=s.join(":").trim(),a=r.trim().replace(/['"]/g,"");return c&&c!==""?(c.startsWith("[")&&c.endsWith("]")?e[a]=c.slice(1,-1).split(",").map(f=>f.trim().replace(/['"]/g,"")):e[a]=c.replace(/['"]/g,""),{newCurrentKey:null,newCurrentArray:[]}):{newCurrentKey:a,newCurrentArray:[]}}if(n.startsWith("-")&&i){let r=[...o,n.slice(1).trim().replace(/['"]/g,"")];return{newCurrentKey:i,newCurrentArray:r}}return{newCurrentKey:i,newCurrentArray:o}},y3=t=>{let e=t.split(`
|
|
126
|
+
`).filter(r=>r.trim()&&!r.trim().startsWith("#")),i={},o=null,n=[];for(let r of e){let s=v3(r,i,o,n);o=s.newCurrentKey,n=s.newCurrentArray}return o&&n.length>0&&(i[o]=n),i},k3=t=>{let e="";for(let[i,o]of Object.entries(t))if(Array.isArray(o)){e+=`${i}:
|
|
127
127
|
`;for(let n of o)e+=` - '${n}'
|
|
128
128
|
`}else e+=`${i}: '${o}'
|
|
129
|
-
`;return e},
|
|
130
|
-
`;await F(t,s)},
|
|
131
|
-
`;await F(t,n)},D1=async t=>{await F(".lintstagedrc.json",JSON.stringify(j(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 D1(e)}return}if(t.endsWith(".cjs")||t.endsWith(".js")&&!i)try{await j3(t,e)}catch{await D1(e)}},J={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 C(),silent:!0,corepack:!1})},create:async t=>{await F(".lintstagedrc.json",JSON.stringify(j(t),null,2))},update:async t=>{let e=null;for(let i of Ht)if(await l(i)){e=i;break}if(!e){await D1(t);return}await P3(e,t)}}});import{Command as bi}from"commander";var z={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"7.1.4",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.3.13","@eslint/js":"^9.39.2","@next/eslint-plugin-next":"^16.1.4","@repo/data":"workspace:*","@tanstack/eslint-plugin-query":"^5.91.3","@types/node":"^25.0.10","@typescript-eslint/eslint-plugin":"^8.53.1","@typescript-eslint/parser":"^8.53.1","eslint-config-prettier":"^10.1.8","eslint-import-resolver-typescript":"^4.4.4","eslint-plugin-angular":"^5.0.0","eslint-plugin-astro":"^1.5.0","eslint-plugin-compat":"^6.1.0","eslint-plugin-cypress":"^5.2.1","eslint-plugin-github":"6.0.0","eslint-plugin-html":"^8.1.4","eslint-plugin-import":"^2.32.0","eslint-plugin-jest":"^29.12.1","eslint-plugin-jsx-a11y":"^6.10.2","eslint-plugin-n":"^17.23.2","eslint-plugin-prettier":"^5.5.5","eslint-plugin-promise":"^7.2.1","eslint-plugin-qwik":"^1.18.0","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":"^3.0.5","eslint-plugin-storybook":"^10.2.0","eslint-plugin-svelte":"^3.14.0","eslint-plugin-unicorn":"^62.0.0","eslint-plugin-unused-imports":"^4.3.0","eslint-plugin-vue":"^10.7.0",globals:"^17.1.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.41.0"},dependencies:{"@clack/prompts":"^1.0.0",commander:"^14.0.2",deepmerge:"^4.3.1",glob:"^13.0.0","jsonc-parser":"^3.3.1",nypm:"^0.6.4"},peerDependencies:{oxlint:"^1.0.0"},peerDependenciesMeta:{oxlint:{optional:!0}},packageManager:"bun@1.3.6"};m();import{spawnSync as $}from"child_process";import h from"process";import{detectPackageManager as _,dlxCommand as U}from"nypm";var je=async(t,e)=>{let i=["check","--no-errors-on-unmatched",...e];t.length>0?i.push(...u(t)):i.push("./");let n=(await _(h.cwd()))?.name||"npm",r=U(n,"@biomejs/biome",{args:i,short:n==="npm"}),s=$(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Biome: ${s.error.message}`);s.status!==0&&h.exit(s.status??1)},Pe=async(t,e)=>{let i=[...e,...t.length>0?u(t):["."]],n=(await _(h.cwd()))?.name||"npm",r=U(n,"eslint",{args:i,short:n==="npm"}),s=$(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run ESLint: ${s.error.message}`);s.status!==0&&h.exit(s.status??1)},Ae=async(t,e)=>{let i=["--check",...e,...t.length>0?u(t):["."]],n=(await _(h.cwd()))?.name||"npm",r=U(n,"prettier",{args:i,short:n==="npm"}),s=$(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Prettier: ${s.error.message}`);s.status!==0&&h.exit(s.status??1)},Ie=async(t,e)=>{let i=[...e,...t.length>0?u(t):["."]],n=(await _(h.cwd()))?.name||"npm",r=U(n,"stylelint",{args:i,short:n==="npm"}),s=$(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Stylelint: ${s.error.message}`);s.status!==0&&h.exit(s.status??1)},Ee=async(t,e)=>{let i=[...e,...t.length>0?u(t):["."]],n=(await _(h.cwd()))?.name||"npm",r=U(n,"oxlint",{args:i,short:n==="npm"}),s=$(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Oxlint: ${s.error.message}`);s.status!==0&&h.exit(s.status??1)},Oe=async(t,e)=>{let i=["--check",...e,...t.length>0?u(t):["."]],n=(await _(h.cwd()))?.name||"npm",r=U(n,"oxfmt",{args:i,short:n==="npm"}),s=$(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run oxfmt: ${s.error.message}`);s.status!==0&&h.exit(s.status??1)},H1=async(t=[],e=[])=>{let i=await o1();if(!i)throw new Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(i){case"eslint":{await Ae(t,[]),await Pe(t,e),await Ie(t,[]);break}case"oxlint":{await Oe(t,[]),await Ee(t,e);break}default:await je(t,e)}};import{spawnSync as P1}from"child_process";import{existsSync as P}from"fs";import{readFile as s1}from"fs/promises";import{join as A}from"path";import x from"process";import{intro as Fe,log as n1,outro as j1,spinner as Be}from"@clack/prompts";import{parse as W1}from"jsonc-parser";import{detectPackageManager as r1,dlxCommand as a1}from"nypm";var $e=[".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"],Ue=async()=>{let e=(await r1(x.cwd()))?.name||"npm",i=a1(e,"@biomejs/biome",{args:["--version"],short:e==="npm"}),o=P1(i,{shell:!0,encoding:"utf-8"});return o.status===0&&o.stdout?{name:"Biome installation",status:"pass",message:`Biome is installed (${o.stdout.trim()})`}:{name:"Biome installation",status:"fail",message:"Biome is not installed or not accessible"}},Le=async()=>{let e=(await r1(x.cwd()))?.name||"npm",i=a1(e,"eslint",{args:["--version"],short:e==="npm"}),o=P1(i,{shell:!0,encoding:"utf-8"});return o.status===0&&o.stdout?{name:"ESLint installation",status:"pass",message:`ESLint is installed (${o.stdout.trim()})`}:{name:"ESLint installation",status:"warn",message:"ESLint is not installed (optional)"}},De=async()=>{let e=(await r1(x.cwd()))?.name||"npm",i=a1(e,"oxlint",{args:["--version"],short:e==="npm"}),o=P1(i,{shell:!0,encoding:"utf-8"});return o.status===0&&o.stdout?{name:"Oxlint installation",status:"pass",message:`Oxlint is installed (${o.stdout.trim()})`}:{name:"Oxlint installation",status:"warn",message:"Oxlint is not installed (optional)"}},Ne=async()=>{let t=A(x.cwd(),"biome.json"),e=A(x.cwd(),"biome.jsonc"),i=null;if(P(t)?i=t:P(e)&&(i=e),!i)return{name:"Biome configuration",status:"warn",message:"No biome.json or biome.jsonc file found"};try{let o=await s1(i,"utf-8"),n=W1(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=A(x.cwd(),i);if(P(o)){e=o;break}}if(!e)return{name:"ESLint configuration",status:"warn",message:"No eslint.config.* file found (optional)"};try{return(await s1(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=A(x.cwd(),".oxlintrc.json");if(!P(t))return{name:"Oxlint configuration",status:"warn",message:"No .oxlintrc.json file found (optional)"};try{let e=await s1(t,"utf-8"),i=W1(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=A(x.cwd(),"package.json");if(!P(t))return{name:"Ultracite dependency",status:"warn",message:"No package.json found"};try{let e=JSON.parse(await s1(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=$e.some(o=>P(A(x.cwd(),o))),i=_e.filter(o=>!o.startsWith("eslint.config")).some(o=>P(A(x.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"}},S=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},V1=async()=>{Fe(`Ultracite v${z.version} Doctor`);let e=(await r1(x.cwd()))?.name||"npm",i=a1(e,"ultracite",{args:["init"],short:e==="npm"}),o=[];o.push(await S(Ue,"Biome installation")),o.push(await S(Le,"ESLint installation")),o.push(await S(De,"Oxlint installation")),o.push(await S(Ne,"Biome configuration")),o.push(await S(Re,"ESLint configuration")),o.push(await S(Ge,"Oxlint configuration")),o.push(await S(Me,"Ultracite dependency")),o.push(await S(Je,"conflicting tools"));let n=o.filter(c=>c.status==="pass").length,r=o.filter(c=>c.status==="fail").length,s=o.filter(c=>c.status==="warn").length;if(n1.info(`Summary: ${n} passed, ${s} warnings, ${r} failed`),r>0)throw n1.error(`Some checks failed. Run '${i}' to fix issues.`),j1("Doctor complete"),new Error("Doctor checks failed");if(s>0){n1.warn(`Some optional improvements available. Run '${i}' to configure.`),j1("Doctor complete");return}n1.success("Everything looks good!"),j1("Doctor complete")};m();import{spawnSync as L}from"child_process";import w from"process";import{detectPackageManager as D,dlxCommand as N}from"nypm";var He=async(t,e)=>{let i=["check","--write","--no-errors-on-unmatched",...e];t.length>0?i.push(...u(t)):i.push("./");let n=(await D(w.cwd()))?.name||"npm",r=N(n,"@biomejs/biome",{args:i,short:n==="npm"}),s=L(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Biome: ${s.error.message}`);s.status!==0&&w.exit(s.status??1)},We=async(t,e)=>{let i=["--fix",...e,...t.length>0?u(t):["."]],n=(await D(w.cwd()))?.name||"npm",r=N(n,"eslint",{args:i,short:n==="npm"}),s=L(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run ESLint: ${s.error.message}`);s.status!==0&&w.exit(s.status??1)},Ve=async(t,e)=>{let i=["--write",...e,...t.length>0?u(t):["."]],n=(await D(w.cwd()))?.name||"npm",r=N(n,"prettier",{args:i,short:n==="npm"}),s=L(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Prettier: ${s.error.message}`);s.status!==0&&w.exit(s.status??1)},Xe=async(t,e)=>{let i=["--fix",...e,...t.length>0?u(t):["."]],n=(await D(w.cwd()))?.name||"npm",r=N(n,"stylelint",{args:i,short:n==="npm"}),s=L(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Stylelint: ${s.error.message}`);s.status!==0&&w.exit(s.status??1)},Qe=async(t,e)=>{let i=e.includes("--unsafe"),o=e.filter(f=>f!=="--unsafe"),n=[i?"--fix-dangerously":"--fix",...o,...t.length>0?u(t):["."]],s=(await D(w.cwd()))?.name||"npm",c=N(s,"oxlint",{args:n,short:s==="npm"}),a=L(c,{stdio:"inherit",shell:!0});if(a.error)throw new Error(`Failed to run Oxlint: ${a.error.message}`);a.status!==0&&w.exit(a.status??1)},Ke=async(t,e)=>{let i=["--write",...e,...t.length>0?u(t):["."]],n=(await D(w.cwd()))?.name||"npm",r=N(n,"oxfmt",{args:i,short:n==="npm"}),s=L(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run oxfmt: ${s.error.message}`);s.status!==0&&w.exit(s.status??1)},X1=async(t,e=[])=>{let i=await o1();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 We(t,e),await Xe(t,[]);break}case"oxlint":{await Ke(t,[]),await Qe(t,e);break}default:await He(t,e)}};import ti from"process";import{cancel as W,intro as ei,isCancel as V,log as b1,multiselect as t1,select as ii,spinner as p}from"@clack/prompts";var Q1="./aider-K7JLZT2D.svg";var K1="./amazon-q-TSOJNPXB.svg";var Y1="./amp-EV4LVL5I.svg";var Z1="./augmentcode-Q62PVXKO.svg";var q1="./claude-6DLEHRDQ.svg";var tt="./cline-6HWKIYN7.svg";var et="./codex-NQZ5TJCL.svg";var it="./copilot-L2IY45R2.svg";var ot="./crush-LYLRDQGZ.svg";var c1="./cursor-GQNH5LCA.svg";var nt="./droid-266OHJBT.svg";var st="./firebase-studio-ILLWWYU7.svg";var rt="./firebender-UNO6LSZG.svg";var at="./gemini-OYS6V4BH.svg";var ct="./goose-XBIEVD4H.svg";var lt="./jules-HJPVWU73.svg";var dt="./junie-RUWBUV6N.svg";var ft="./kilo-code-4QYUYY2E.svg";var mt="./mistral-HQ63EC2B.svg";var pt="./open-hands-K5EYKO6T.svg";var gt="./opencode-K3274JKQ.svg";var ut="./qwen-N3D5CQYL.svg";var ht="./roo-code-CVLBTS7D.svg";var wt="./vercel-27VSITAQ.svg";var xt="./warp-OZKAAQRT.svg";var R=[{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:q1,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:et},{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:lt},{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:`---
|
|
129
|
+
`;return e},b3=async()=>{try{let t=R1(await p1("./package.json","utf-8"));return t?t.type==="module":!1}catch{return!1}},z3=async t=>{let e=R1(await p1("./package.json","utf-8"));e&&(e["lint-staged"]?e["lint-staged"]=q(e["lint-staged"],j(t)):e["lint-staged"]=j(t),await F("./package.json",JSON.stringify(e,null,2)))},C3=async(t,e)=>{let i=await p1(t,"utf-8"),o=R1(i);if(!o)return;let n=q(o,j(e));await F(t,JSON.stringify(n,null,2))},S3=async(t,e)=>{let i=await p1(t,"utf-8"),o=y3(i);if(!o)return;let n=q(o,j(e));await F(t,k3(n))},j3=async(t,e)=>{let n=(await import(h3(t).href)).default||{},r=q(n,j(e)),s=`export default ${JSON.stringify(r,null,2)};
|
|
130
|
+
`;await F(t,s)},P3=async(t,e)=>{delete S1.cache[S1.resolve(`./${t}`)];let i=u3(`./${t}`),o=q(i,j(e)),n=`module.exports = ${JSON.stringify(o,null,2)};
|
|
131
|
+
`;await F(t,n)},N1=async t=>{await F(".lintstagedrc.json",JSON.stringify(j(t),null,2))},A3=async(t,e)=>{if(t==="./package.json"){await z3(e);return}if(t.endsWith(".json")||t==="./.lintstagedrc"){await C3(t,e);return}if(t.endsWith(".yaml")||t.endsWith(".yml")){await S3(t,e);return}let i=await b3();if(t.endsWith(".mjs")||t.endsWith(".js")&&i){try{await j3(t,e)}catch{await N1(e)}return}if(t.endsWith(".cjs")||t.endsWith(".js")&&!i)try{await P3(t,e)}catch{await N1(e)}},J={exists:async()=>{for(let t of Vt)if(await l(t))return!0;return!1},install:async t=>{await w3("lint-staged",{packageManager:t,workspace:await C(),silent:!0,corepack:!1})},create:async t=>{await F(".lintstagedrc.json",JSON.stringify(j(t),null,2))},update:async t=>{let e=null;for(let i of Vt)if(await l(i)){e=i;break}if(!e){await N1(t);return}await A3(e,t)}}});import{Command as zi}from"commander";var z={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"7.1.5",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.3.13","@eslint/js":"^9.39.2","@next/eslint-plugin-next":"^16.1.4","@repo/data":"workspace:*","@tanstack/eslint-plugin-query":"^5.91.3","@types/node":"^25.0.10","@typescript-eslint/eslint-plugin":"^8.53.1","@typescript-eslint/parser":"^8.53.1","eslint-config-prettier":"^10.1.8","eslint-import-resolver-typescript":"^4.4.4","eslint-plugin-angular":"^5.0.0","eslint-plugin-astro":"^1.5.0","eslint-plugin-compat":"^6.1.0","eslint-plugin-cypress":"^5.2.1","eslint-plugin-github":"6.0.0","eslint-plugin-html":"^8.1.4","eslint-plugin-import":"^2.32.0","eslint-plugin-jest":"^29.12.1","eslint-plugin-jsx-a11y":"^6.10.2","eslint-plugin-n":"^17.23.2","eslint-plugin-prettier":"^5.5.5","eslint-plugin-promise":"^7.2.1","eslint-plugin-qwik":"^1.18.0","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":"^3.0.5","eslint-plugin-storybook":"^10.2.0","eslint-plugin-svelte":"^3.14.0","eslint-plugin-unicorn":"^62.0.0","eslint-plugin-unused-imports":"^4.3.0","eslint-plugin-vue":"^10.7.0",globals:"^17.1.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.41.0"},dependencies:{"@clack/prompts":"^1.0.0",commander:"^14.0.2",deepmerge:"^4.3.1",glob:"^13.0.0","jsonc-parser":"^3.3.1",nypm:"^0.6.4"},peerDependencies:{oxlint:"^1.0.0"},peerDependenciesMeta:{oxlint:{optional:!0}},packageManager:"bun@1.3.6"};m();import{spawnSync as $}from"child_process";import h from"process";import{detectPackageManager as _,dlxCommand as U}from"nypm";var Pe=async(t,e)=>{let i=["check","--no-errors-on-unmatched",...e];t.length>0?i.push(...u(t)):i.push("./");let n=(await _(h.cwd()))?.name||"npm",r=U(n,"@biomejs/biome",{args:i,short:n==="npm"}),s=$(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Biome: ${s.error.message}`);s.status!==0&&h.exit(s.status??1)},Ae=async(t,e)=>{let i=[...e,...t.length>0?u(t):["."]],n=(await _(h.cwd()))?.name||"npm",r=U(n,"eslint",{args:i,short:n==="npm"}),s=$(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run ESLint: ${s.error.message}`);s.status!==0&&h.exit(s.status??1)},Ie=async(t,e)=>{let i=["--check",...e,...t.length>0?u(t):["."]],n=(await _(h.cwd()))?.name||"npm",r=U(n,"prettier",{args:i,short:n==="npm"}),s=$(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Prettier: ${s.error.message}`);s.status!==0&&h.exit(s.status??1)},Ee=async(t,e)=>{let i=[...e,...t.length>0?u(t):["."]],n=(await _(h.cwd()))?.name||"npm",r=U(n,"stylelint",{args:i,short:n==="npm"}),s=$(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Stylelint: ${s.error.message}`);s.status!==0&&h.exit(s.status??1)},Oe=async(t,e)=>{let i=[...e,...t.length>0?u(t):["."]],n=(await _(h.cwd()))?.name||"npm",r=U(n,"oxlint",{args:i,short:n==="npm"}),s=$(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Oxlint: ${s.error.message}`);s.status!==0&&h.exit(s.status??1)},Fe=async(t,e)=>{let i=["--check",...e,...t.length>0?u(t):["."]],n=(await _(h.cwd()))?.name||"npm",r=U(n,"oxfmt",{args:i,short:n==="npm"}),s=$(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run oxfmt: ${s.error.message}`);s.status!==0&&h.exit(s.status??1)},V1=async(t=[],e=[])=>{let i=await o1();if(!i)throw new Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(i){case"eslint":{await Ie(t,[]),await Ae(t,e),await Ee(t,[]);break}case"oxlint":{await Fe(t,[]),await Oe(t,e);break}default:await Pe(t,e)}};import{spawnSync as A1}from"child_process";import{existsSync as P}from"fs";import{readFile as s1}from"fs/promises";import{join as A}from"path";import x from"process";import{intro as Be,log as n1,outro as P1,spinner as $e}from"@clack/prompts";import{parse as X1}from"jsonc-parser";import{detectPackageManager as r1,dlxCommand as a1}from"nypm";var _e=[".prettierrc",".prettierrc.js",".prettierrc.cjs",".prettierrc.mjs",".prettierrc.json",".prettierrc.yaml",".prettierrc.yml","prettier.config.js","prettier.config.mjs","prettier.config.cjs"],Ue=[".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"],Le=async()=>{let e=(await r1(x.cwd()))?.name||"npm",i=a1(e,"@biomejs/biome",{args:["--version"],short:e==="npm"}),o=A1(i,{shell:!0,encoding:"utf-8"});return o.status===0&&o.stdout?{name:"Biome installation",status:"pass",message:`Biome is installed (${o.stdout.trim()})`}:{name:"Biome installation",status:"fail",message:"Biome is not installed or not accessible"}},De=async()=>{let e=(await r1(x.cwd()))?.name||"npm",i=a1(e,"eslint",{args:["--version"],short:e==="npm"}),o=A1(i,{shell:!0,encoding:"utf-8"});return o.status===0&&o.stdout?{name:"ESLint installation",status:"pass",message:`ESLint is installed (${o.stdout.trim()})`}:{name:"ESLint installation",status:"warn",message:"ESLint is not installed (optional)"}},Ne=async()=>{let e=(await r1(x.cwd()))?.name||"npm",i=a1(e,"oxlint",{args:["--version"],short:e==="npm"}),o=A1(i,{shell:!0,encoding:"utf-8"});return o.status===0&&o.stdout?{name:"Oxlint installation",status:"pass",message:`Oxlint is installed (${o.stdout.trim()})`}:{name:"Oxlint installation",status:"warn",message:"Oxlint is not installed (optional)"}},Re=async()=>{let t=A(x.cwd(),"biome.json"),e=A(x.cwd(),"biome.jsonc"),i=null;if(P(t)?i=t:P(e)&&(i=e),!i)return{name:"Biome configuration",status:"warn",message:"No biome.json or biome.jsonc file found"};try{let o=await s1(i,"utf-8"),n=X1(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"}}},Te=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=A(x.cwd(),i);if(P(o)){e=o;break}}if(!e)return{name:"ESLint configuration",status:"warn",message:"No eslint.config.* file found (optional)"};try{return(await s1(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"}}},Ge=t=>`./node_modules/ultracite/config/oxlint/${t}/.oxlintrc.json`,Me=async()=>{let t=A(x.cwd(),".oxlintrc.json");if(!P(t))return{name:"Oxlint configuration",status:"warn",message:"No .oxlintrc.json file found (optional)"};try{let e=await s1(t,"utf-8"),i=X1(e);return Array.isArray(i?.extends)&&i.extends.includes(Ge("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"}}},Je=async()=>{let t=A(x.cwd(),"package.json");if(!P(t))return{name:"Ultracite dependency",status:"warn",message:"No package.json found"};try{let e=JSON.parse(await s1(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"}}},He=()=>{let t=_e.some(o=>P(A(x.cwd(),o))),i=Ue.filter(o=>!o.startsWith("eslint.config")).some(o=>P(A(x.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"}},S=async(t,e)=>{let i=$e();i.start(`Checking ${e}...`);let o=await t();return o.status==="pass"||o.status,i.stop(o.message),o},Q1=async()=>{Be(`Ultracite v${z.version} Doctor`);let e=(await r1(x.cwd()))?.name||"npm",i=a1(e,"ultracite",{args:["init"],short:e==="npm"}),o=[];o.push(await S(Le,"Biome installation")),o.push(await S(De,"ESLint installation")),o.push(await S(Ne,"Oxlint installation")),o.push(await S(Re,"Biome configuration")),o.push(await S(Te,"ESLint configuration")),o.push(await S(Me,"Oxlint configuration")),o.push(await S(Je,"Ultracite dependency")),o.push(await S(He,"conflicting tools"));let n=o.filter(c=>c.status==="pass").length,r=o.filter(c=>c.status==="fail").length,s=o.filter(c=>c.status==="warn").length;if(n1.info(`Summary: ${n} passed, ${s} warnings, ${r} failed`),r>0)throw n1.error(`Some checks failed. Run '${i}' to fix issues.`),P1("Doctor complete"),new Error("Doctor checks failed");if(s>0){n1.warn(`Some optional improvements available. Run '${i}' to configure.`),P1("Doctor complete");return}n1.success("Everything looks good!"),P1("Doctor complete")};m();import{spawnSync as L}from"child_process";import w from"process";import{detectPackageManager as D,dlxCommand as N}from"nypm";var We=async(t,e)=>{let i=["check","--write","--no-errors-on-unmatched",...e];t.length>0?i.push(...u(t)):i.push("./");let n=(await D(w.cwd()))?.name||"npm",r=N(n,"@biomejs/biome",{args:i,short:n==="npm"}),s=L(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Biome: ${s.error.message}`);s.status!==0&&w.exit(s.status??1)},Ve=async(t,e)=>{let i=["--fix",...e,...t.length>0?u(t):["."]],n=(await D(w.cwd()))?.name||"npm",r=N(n,"eslint",{args:i,short:n==="npm"}),s=L(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run ESLint: ${s.error.message}`);s.status!==0&&w.exit(s.status??1)},Xe=async(t,e)=>{let i=["--write",...e,...t.length>0?u(t):["."]],n=(await D(w.cwd()))?.name||"npm",r=N(n,"prettier",{args:i,short:n==="npm"}),s=L(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Prettier: ${s.error.message}`);s.status!==0&&w.exit(s.status??1)},Qe=async(t,e)=>{let i=["--fix",...e,...t.length>0?u(t):["."]],n=(await D(w.cwd()))?.name||"npm",r=N(n,"stylelint",{args:i,short:n==="npm"}),s=L(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Stylelint: ${s.error.message}`);s.status!==0&&w.exit(s.status??1)},Ke=async(t,e)=>{let i=e.includes("--unsafe"),o=e.filter(f=>f!=="--unsafe"),n=[i?"--fix-dangerously":"--fix",...o,...t.length>0?u(t):["."]],s=(await D(w.cwd()))?.name||"npm",c=N(s,"oxlint",{args:n,short:s==="npm"}),a=L(c,{stdio:"inherit",shell:!0});if(a.error)throw new Error(`Failed to run Oxlint: ${a.error.message}`);a.status!==0&&w.exit(a.status??1)},Ye=async(t,e)=>{let i=["--write",...e,...t.length>0?u(t):["."]],n=(await D(w.cwd()))?.name||"npm",r=N(n,"oxfmt",{args:i,short:n==="npm"}),s=L(r,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run oxfmt: ${s.error.message}`);s.status!==0&&w.exit(s.status??1)},K1=async(t,e=[])=>{let i=await o1();if(!i)throw new Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(i){case"eslint":{await Xe(t,[]),await Ve(t,e),await Qe(t,[]);break}case"oxlint":{await Ye(t,[]),await Ke(t,e);break}default:await We(t,e)}};import ei from"process";import{cancel as W,intro as ii,isCancel as V,log as b1,multiselect as t1,select as oi,spinner as p}from"@clack/prompts";var Y1="./aider-K7JLZT2D.svg";var Z1="./amazon-q-TSOJNPXB.svg";var q1="./amp-EV4LVL5I.svg";var tt="./augmentcode-Q62PVXKO.svg";var et="./claude-6DLEHRDQ.svg";var it="./cline-6HWKIYN7.svg";var ot="./codex-NQZ5TJCL.svg";var nt="./copilot-L2IY45R2.svg";var st="./crush-LYLRDQGZ.svg";var c1="./cursor-GQNH5LCA.svg";var rt="./droid-266OHJBT.svg";var at="./firebase-studio-ILLWWYU7.svg";var ct="./firebender-UNO6LSZG.svg";var lt="./gemini-OYS6V4BH.svg";var dt="./goose-XBIEVD4H.svg";var ft="./jules-HJPVWU73.svg";var mt="./junie-RUWBUV6N.svg";var pt="./kilo-code-4QYUYY2E.svg";var gt="./mistral-HQ63EC2B.svg";var ut="./open-hands-K5EYKO6T.svg";var ht="./opencode-K3274JKQ.svg";var wt="./qwen-N3D5CQYL.svg";var xt="./roo-code-CVLBTS7D.svg";var vt="./vercel-27VSITAQ.svg";var yt="./warp-OZKAAQRT.svg";var R=[{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:et,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:ot},{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:`---
|
|
132
132
|
applyTo: "**/*.{ts,tsx,js,jsx}"
|
|
133
|
-
---`},logo:
|
|
133
|
+
---`},logo:nt},{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:it},{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:"AGENT.md",appendMode:!0},logo:q1},{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:Y1},{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:at},{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:ut},{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:lt},{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:mt},{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:tt},{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:dt},{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:xt},{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:yt},{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:rt},{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:ht},{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:st},{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:wt},{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:ct},{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:gt},{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:vt}];import T from"deepmerge";var kt="./antigravity-JVONECNW.svg";var bt="./kiro-N2M256R6.svg";var zt="./trae-RXVCFBOF.svg";var Ct="./void-NYH3U3BB.svg";var St="./vscode-DEOUEB65.svg";var jt="./windsurf-5T7JOTST.svg";var Pt="./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"},E2={"[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"}},O2={"[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"}},I=(t="biome")=>{switch(t){case"biome":return T(l1,E2);case"eslint":return T(l1,F2);case"oxlint":return T(l1,O2);default:return l1}},d1={formatter:"language_server",format_on_save:"on",lsp:{"typescript-language-server":{settings:{typescript:{preferences:{includePackageJsonAutoImports:"on"}}}}}},B2={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}}}},$2={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}}}},_2={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}}}}},U2=(t="biome")=>{switch(t){case"biome":return T(d1,B2);case"eslint":return T(d1,$2);case"oxlint":return T(d1,_2);default:return d1}},G=[{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:St,config:{path:".vscode/settings.json",getContent:I,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:`---
|
|
134
134
|
description: Ultracite Rules - AI-Ready Formatter and Linter
|
|
135
135
|
globs: "**/*.{ts,tsx,js,jsx,json,jsonc,html,vue,svelte,astro,css,yaml,yml,graphql,gql,md,mdx,grit}"
|
|
136
136
|
alwaysApply: false
|
|
137
|
-
---`},hooks:{path:".cursor/hooks.json",getContent:t=>({version:1,hooks:{afterFileEdit:[{command:t}]}})},config:{path:".vscode/settings.json",getContent:I,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:
|
|
137
|
+
---`},hooks:{path:".cursor/hooks.json",getContent:t=>({version:1,hooks:{afterFileEdit:[{command:t}]}})},config:{path:".vscode/settings.json",getContent:I,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:jt,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:I,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:kt,config:{path:".vscode/settings.json",getContent:I,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:bt,rules:{path:".kiro/steering/ultracite.md"},config:{path:".vscode/settings.json",getContent:I,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:zt,rules:{path:".trae/rules/project_rules.md"},config:{path:".vscode/settings.json",getContent:I,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:Ct,config:{path:".vscode/settings.json",getContent:I,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:Pt,rules:{path:".rules",appendMode:!0},config:{path:".zed/settings.json",getContent:U2}}];var L2=t=>!!t.hooks,D2=t=>!!t.hooks,N2=()=>G.filter(L2).map(t=>({id:t.id,name:t.name,hooks:t.hooks})),R2=()=>R.filter(D2).map(t=>({id:t.id,name:t.name,hooks:t.hooks})),Q=[...N2(),...R2()];var At="./biome-TVLEY2T4.svg";var It="./eslint-7IULJKW7.svg";var Et="./oxlint-5IE3ABOZ.svg";var Ot="./prettier-O4V2FSEA.svg";var Ft="./stylelint-DEBSWZVS.svg";var f1=[{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:At,videos:["https://www.youtube.com/watch?v=lEkXbneUnWg","https://www.youtube.com/watch?v=b_F4LaycQcE"],configFiles:[{name:"biome.jsonc",lang:"json",code:t=>`{
|
|
138
138
|
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
|
|
139
139
|
"extends": [
|
|
140
140
|
${t.map(e=>`"ultracite/biome/${e}"`).join(`,
|
|
141
141
|
`)}
|
|
142
142
|
]
|
|
143
|
-
}`}],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:
|
|
143
|
+
}`}],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:It,additionalLogos:[Ot,Ft],configFiles:[{name:"eslint.config.mjs",lang:"javascript",code:t=>`import { defineConfig } from "eslint/config";
|
|
144
144
|
${t.map(e=>`import ${e} from "ultracite/eslint/${e}";`).join(`
|
|
145
145
|
`)}
|
|
146
146
|
|
|
@@ -151,7 +151,7 @@ export default defineConfig([
|
|
|
151
151
|
`)}
|
|
152
152
|
],
|
|
153
153
|
},
|
|
154
|
-
]);`},{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:
|
|
154
|
+
]);`},{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:Et,configFiles:[{name:".oxlintrc.json",lang:"json",code:t=>`{
|
|
155
155
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
156
156
|
"extends": [
|
|
157
157
|
${t.map(e=>`"./node_modules/ultracite/config/oxlint/${e}/.oxlintrc.json"`).join(`,
|
|
@@ -168,7 +168,7 @@ export default defineConfig([
|
|
|
168
168
|
"arrowParens": "always",
|
|
169
169
|
"proseWrap": "never",
|
|
170
170
|
"printWidth": 80,
|
|
171
|
-
}`}],vscodeExtensionId:"oxc.oxc-vscode"}];import{addDevDependency as
|
|
171
|
+
}`}],vscodeExtensionId:"oxc.oxc-vscode"}];import{addDevDependency as ni,detectPackageManager as si}from"nypm";import{readFile as W2,writeFile as I1}from"fs/promises";var Bt=(t,e)=>`# Ultracite Code Standards
|
|
172
172
|
|
|
173
173
|
This project uses **Ultracite**, a zero-config preset that enforces strict code quality standards through automated formatting and linting.
|
|
174
174
|
|
|
@@ -291,23 +291,23 @@ ${e}'s linter will catch most issues automatically. Focus your attention on:
|
|
|
291
291
|
---
|
|
292
292
|
|
|
293
293
|
Most formatting and common issues are automatically fixed by ${e}. Run \`${t} ultracite fix\` before committing to ensure compliance.
|
|
294
|
-
`;m();import{dlxCommand as
|
|
294
|
+
`;m();import{dlxCommand as V2}from"nypm";var $t=(t,e,i)=>{let o=R.find(a=>a.id===t);if(!o)throw new Error(`Agent "${t}" not found`);let n=f1.find(a=>a.id===i);if(!n)throw new Error(`Provider "${i}" not found`);let r=V2(e,""),s=Bt(r,n.name),c=o.config.header?`${o.config.header}
|
|
295
295
|
|
|
296
|
-
${s}`:s;return{exists:()=>l(o.config.path),create:async()=>{await b(o.config.path),await
|
|
296
|
+
${s}`:s;return{exists:()=>l(o.config.path),create:async()=>{await b(o.config.path),await I1(o.config.path,c)},update:async()=>{await b(o.config.path);let a=await l(o.config.path);if(!(o.config.appendMode&&a)){await I1(o.config.path,c);return}let f=await W2(o.config.path,"utf-8");f.includes(s.trim())||await I1(o.config.path,`${f}
|
|
297
297
|
|
|
298
|
-
${s}`)}}};import{spawnSync as
|
|
298
|
+
${s}`)}}};import{spawnSync as X2}from"child_process";import{readFile as Q2,writeFile as E1}from"fs/promises";m();import K2 from"deepmerge";import{parse as Y2}from"jsonc-parser";var _t=(t,e="biome")=>{let i=G.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 b(i.config.path),await E1(i.config.path,JSON.stringify(o,null,2))},update:async()=>{if(await b(i.config.path),!await l(i.config.path)){await E1(i.config.path,JSON.stringify(o,null,2));return}let r=await Q2(i.config.path,"utf-8"),c=Y2(r)||{},a=K2(c,o);await E1(i.config.path,JSON.stringify(a,null,2))},extension:i.config.extensionCommand?n=>X2(`${i.config.extensionCommand} ${n}`,{stdio:"pipe",shell:!0}):void 0}};import{readFile as Z2,writeFile as O1}from"fs/promises";m();import q2 from"deepmerge";import{parse as t3}from"jsonc-parser";import{dlxCommand as e3}from"nypm";var Ut=(t,e)=>{let i=Q.find(a=>a.id===t);if(!i)throw new Error(`Hook integration "${t}" not found`);let o=e3(e,"ultracite",{args:["fix"],short:e==="npm"}),n=i.hooks.getContent(o),r=a=>typeof a=="object"&&a!==null&&!Array.isArray(a),s=a=>JSON.stringify(a).includes("ultracite"),c=async()=>{if(!await l(i.hooks.path)){await O1(i.hooks.path,JSON.stringify(n,null,2));return}let f=await Z2(i.hooks.path,"utf-8"),k=t3(f),v=r(k)?k:{};if(!s(v)){let d=q2(v,n);await O1(i.hooks.path,JSON.stringify(d,null,2))}};return{exists:()=>l(i.hooks.path),create:async()=>{await b(i.hooks.path),await O1(i.hooks.path,JSON.stringify(n,null,2))},update:async()=>{await b(i.hooks.path),await c()}}};B1();$1();D1();U1();m();import{readFile as I3,writeFile as Xt}from"fs/promises";import E3 from"deepmerge";import{parse as O3}from"jsonc-parser";var Qt={$schema:"./node_modules/@biomejs/biome/configuration_schema.json",extends:["ultracite/biome/core"]},T1=async()=>await l("./biome.json")?"./biome.json":"./biome.jsonc",g1={exists:async()=>{let t=await T1();return l(t)},create:async t=>{let e=await T1(),i=["ultracite/biome/core"];if(t?.frameworks&&t.frameworks.length>0)for(let n of t.frameworks)i.push(`ultracite/biome/${n}`);let o={...Qt,extends:i};return Xt(e,JSON.stringify(o,null,2))},update:async t=>{let e=await T1(),i=await I3(e,"utf-8"),n=O3(i)||{},s=[...n.extends&&Array.isArray(n.extends)?n.extends:[]];if(s.includes("ultracite/biome/core")||s.push("ultracite/biome/core"),t?.frameworks&&t.frameworks.length>0)for(let f of t.frameworks){let k=`ultracite/biome/${f}`;s.includes(k)||s.push(k)}n.extends=s;let c={$schema:Qt.$schema},a=E3(n,c);await Xt(e,JSON.stringify(a,null,2))}};m();import{writeFile as Kt}from"fs/promises";var F3=["./eslint.config.mjs","./eslint.config.js","./eslint.config.cjs","./eslint.config.ts","./eslint.config.mts","./eslint.config.cts"],Yt="./eslint.config.mjs",B3=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(`
|
|
299
299
|
`)}
|
|
300
300
|
|
|
301
301
|
export default [
|
|
302
302
|
${i.join(`,
|
|
303
303
|
`)},
|
|
304
304
|
];
|
|
305
|
-
`},u1={exists:async()=>await
|
|
305
|
+
`},u1={exists:async()=>await B3()!==null,create:async t=>{let e=Zt(t);await Kt(Yt,e)},update:async t=>{let e=Zt(t);await Kt(Yt,e)}};m();import{readFile as $3,writeFile as qt}from"fs/promises";import _3 from"deepmerge";import{parse as U3}from"jsonc-parser";var h1="./.oxfmtrc.jsonc",te={$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"}},w1={exists:async()=>await l(h1),create:async()=>{let t=`// Ultracite oxfmt Configuration
|
|
306
306
|
// https://oxc.rs/docs/guide/usage/formatter/config-file-reference.html
|
|
307
|
-
${JSON.stringify(
|
|
308
|
-
`;return await
|
|
307
|
+
${JSON.stringify(te,null,2)}
|
|
308
|
+
`;return await qt(h1,t)},update:async()=>{let t=await $3(h1,"utf-8"),i=U3(t)||{},o=_3(i,te),n=`// Ultracite oxfmt Configuration
|
|
309
309
|
// https://oxc.rs/docs/guide/usage/formatter/config-file-reference.html
|
|
310
310
|
${JSON.stringify(o,null,2)}
|
|
311
|
-
`;await
|
|
312
|
-
`,y1={exists:async()=>await
|
|
313
|
-
`,k1={exists:async()=>await W3()!==null,create:async()=>{let t=re();await ne(se,t)},update:async()=>{let t=re();await ne(se,t)}};import{readFile as V3,writeFile as ae}from"fs/promises";import{glob as X3}from"glob";import{applyEdits as Q3,modify as K3,parse as Y3}from"jsonc-parser";var ce=async()=>{try{return await X3("**/tsconfig*.json",{ignore:["**/node_modules/**","**/dist/**","**/build/**","**/.next/**"],absolute:!1})}catch{return[]}},Z3=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=Y3(e);if(Z3(i))return;if(i===void 0){await ae(t,JSON.stringify({compilerOptions:{strictNullChecks:!0}},null,2));return}let n=K3(e,["compilerOptions","strictNullChecks"],!0,{formattingOptions:{tabSize:2,insertSpaces:!0}}),r=Q3(e,n);await ae(t,r)}catch(e){console.warn(`Failed to update ${t}:`,e)}},T1={exists:async()=>(await ce()).length>0,update:async()=>{let t=await ce();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 le=z.devDependencies["@biomejs/biome"],G1=z.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=async(t,e="biome",i=!0,o=!1,n=!1,r=["react"])=>{let s=p();o||s.start("Installing dependencies...");let c=[`ultracite@${G1}`];if(e==="biome"&&c.push(`@biomejs/biome@${le}`),e==="eslint"&&(c.push("eslint@latest"),c.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(c,r),c.push("prettier@latest"),c.push("stylelint@latest")),e==="oxlint"&&(c.push("oxlint@latest"),c.push("oxfmt@latest"),n&&c.push("oxlint-tsgolint@latest")),i)for(let a of c)await oi(a,{packageManager:t,workspace:await C(),silent:!0,corepack:!1});else{let a={ultracite:G1};e==="biome"&&(a["@biomejs/biome"]=le),e==="eslint"&&(a.eslint="latest",a.prettier="latest",a.stylelint="latest"),e==="oxlint"&&(a.oxlint="latest",a.oxfmt="latest",n&&(a["oxlint-tsgolint"]="latest")),await y({devDependencies:a})}await y({scripts:{check:"ultracite check",fix:"ultracite fix"}}),o||s.stop("Dependencies installed.")},ci=async(t=!1)=>{let e=p();if(t||e.start("Checking for tsconfig.json files..."),await T1.exists()){t||e.message("Found tsconfig.json files, updating with strictNullChecks..."),await T1.update(),t||e.stop("tsconfig.json files updated.");return}t||e.stop("No tsconfig.json files found, skipping.")},li=async(t,e="biome",i=!1)=>{let o=G.find(s=>s.id===t);if(!o)throw new Error(`Editor "${t}" not found`);let n=Bt(t,e),r=p();if(i||r.start(`Checking for ${o.config.path}...`),await n.exists()){i||r.message(`${o.config.path} found, updating...`),await n.update(),i||r.stop(`${o.config.path} updated.`);return}if(i||r.message(`${o.config.path} not found, creating...`),await n.create(),n.extension){let s=f1.find(c=>c.id===e)?.vscodeExtensionId;if(!s)throw new Error(`Linter extension not found for ${e}`);i||r.message(`Installing ${s} extension...`);try{if(n.extension(s).status===0){i||r.stop(`${o.config.path} created and ${s} extension installed.`);return}}catch{}i||r.stop(`${o.config.path} created. Install ${s} extension manually.`);return}i||(t==="zed"?r.stop(`${o.config.path} created. Install the Biome extension: https://biomejs.dev/reference/zed/`):r.stop(`${o.config.path} created.`))},di=async(t,e=!1)=>{let i=p();if(e||i.start("Checking for Biome configuration..."),await g1.exists()){e||i.message("Biome configuration found, updating..."),await g1.update({frameworks:t}),e||i.stop("Biome configuration updated.");return}e||i.message("Biome configuration not found, creating..."),await g1.create({frameworks:t}),e||i.stop("Biome configuration created.")},fi=async(t,e=!1)=>{let i=p();if(e||i.start("Checking for ESLint configuration..."),await u1.exists()){e||i.message("ESLint configuration found, updating..."),await u1.update({frameworks:t}),e||i.stop("ESLint configuration updated.");return}e||i.message("ESLint configuration not found, creating..."),await u1.create({frameworks:t}),e||i.stop("ESLint configuration created.")},mi=async(t,e=!1)=>{let i=p();if(e||i.start("Checking for Oxlint configuration..."),await v1.exists()){e||i.message("Oxlint configuration found, updating..."),await v1.update({frameworks:t}),e||i.stop("Oxlint configuration updated.");return}e||i.message("Oxlint configuration not found, creating..."),await v1.create({frameworks:t}),e||i.stop("Oxlint configuration created.")},pi=async(t=!1)=>{let e=p();if(t||e.start("Checking for Prettier configuration..."),await y1.exists()){t||e.message("Prettier configuration found, updating..."),await y1.update(),t||e.stop("Prettier configuration updated.");return}t||e.message("Prettier configuration not found, creating..."),await y1.create(),t||e.stop("Prettier configuration created.")},gi=async(t=!1)=>{let e=p();if(t||e.start("Checking for Stylelint configuration..."),await k1.exists()){t||e.message("Stylelint configuration found, updating..."),await k1.update(),t||e.stop("Stylelint configuration updated.");return}t||e.message("Stylelint configuration not found, creating..."),await k1.create(),t||e.stop("Stylelint configuration created.")},ui=async(t=!1)=>{let e=p();if(t||e.start("Checking for oxfmt configuration..."),await w1.exists()){t||e.message("oxfmt configuration found, updating..."),await w1.update(),t||e.stop("oxfmt configuration updated.");return}t||e.message("oxfmt configuration not found, creating..."),await w1.create(),t||e.stop("oxfmt configuration created.")},hi=async(t,e=!0,i=!1)=>{let o=p();if(i||(o.start("Initializing pre-commit hooks..."),o.message("Installing Husky...")),e?await E.install(t):await y({devDependencies:{husky:"latest"},scripts:{prepare:"husky"}}),i||o.message("Initializing Husky..."),E.init(t),await E.exists()){i||o.message("Pre-commit hook found, updating..."),await E.update(t),i||o.stop("Pre-commit hook updated.");return}i||o.message("Pre-commit hook not found, creating..."),await E.create(t),i||o.stop("Pre-commit hook created.")},wi=async(t,e=!0,i=!1)=>{let o=p();if(i||(o.start("Initializing lefthook..."),o.message("Installing lefthook...")),e?await M.install(t):await y({devDependencies:{lefthook:"latest"}}),await M.exists()){i||o.message("lefthook.yml found, updating..."),await M.update(t),i||o.stop("lefthook.yml updated.");return}i||o.message("lefthook.yml not found, creating..."),await M.create(t),i||o.stop("lefthook.yml created.")},xi=async(t,e=!0,i=!1)=>{let o=p();if(i||(o.start("Initializing lint-staged..."),o.message("Installing lint-staged...")),e?await J.install(t):await y({devDependencies:{"lint-staged":"latest"}}),await J.exists()){i||o.message("lint-staged found, updating..."),await J.update(t),i||o.stop("lint-staged updated.");return}i||o.message("lint-staged not found, creating..."),await J.create(t),i||o.stop("lint-staged created.")},vi=async(t,e=!1)=>{let i=p();if(e||i.start("Initializing pre-commit..."),await Z.exists()){e||i.message(".pre-commit-config.yaml found, updating..."),await Z.update(t),e||i.stop(".pre-commit-config.yaml updated.");return}e||i.message(".pre-commit-config.yaml not found, creating..."),await Z.create(t),e||i.stop(".pre-commit-config.yaml created.")},yi=async(t,e,i,o,n=!1)=>{let r=p();n||r.start(`Checking for ${e}...`);let s=Ft(t,i,o);if(await s.exists()){n||r.message(`${e} found, updating...`),await s.update(),n||r.stop(`${e} updated.`);return}n||r.message(`${e} not found, creating...`),await s.create(),n||r.stop(`${e} created.`)},ki=async(t,e,i=!1)=>{let o=p(),n=Q.find(s=>s.id===t)?.name??t;i||o.start(`Checking for ${n} hooks...`);let r=$t(t,e);if(await r.exists()){i||o.message(`${n} hooks found, updating...`),await r.update(),i||o.stop(`${n} hooks updated.`);return}i||o.message(`${n} hooks not found, creating...`),await r.create(),i||o.stop(`${n} hooks created.`)},de=async t=>{let e=t??{},i=e.quiet??!1;i||ei(`Ultracite v${G1} Initialization`);try{let{pm:o}=e;if(!o){let d=await ni(ti.cwd());if(!d)throw new Error("No package manager specified or detected");if(!i&&d.warnings)for(let g of d.warnings)b1.warn(g);i||b1.info(`Detected lockfile, using ${d.name}`),o=d.name}let n=e.linter;if(n===void 0)if(i||e.pm||e.editors||e.agents||e.hooks||e.integrations!==void 0||e.frameworks!==void 0)n="biome";else{let g=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(V(g)){W("Operation cancelled.");return}n=g}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 g=await t1({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"}],required:!1});if(V(g)){W("Operation cancelled.");return}r=g}let s=e.editors;if(!s)if(i)s=[];else{let d=await t1({message:"Which editors do you want to configure (recommended)?",options:[{label:"VSCode / Cursor / Windsurf",value:"vscode"},{label:"Zed",value:"zed"}],required:!1});if(V(d)){W("Operation cancelled.");return}s=d}let c=e.agents,a=e.hooks,f=Object.fromEntries(R.map(d=>[d.id,d.name]));if(!c)if(i)c=[];else{let d=await t1({message:"Which agents do you want to enable (optional)?",options:Object.entries(f).map(([g,z1])=>({value:g,label:z1})),required:!1});if(V(d)){W("Operation cancelled.");return}c=d}let k=Object.fromEntries(Q.map(d=>[d.id,d.name]));if(!a)if(i)a=[];else{let d=await t1({message:"Which agent hooks do you want to enable (optional)?",options:Object.entries(k).map(([g,z1])=>({value:g,label:z1})),required:!1});if(V(d)){W("Operation cancelled.");return}a=d}let v=e.integrations;if(v===void 0)if(i||e.pm||e.editors||e.agents||e.hooks)v=[];else{let g=await t1({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(V(g)){W("Operation cancelled.");return}v=g}await ai(o,n,!e.skipInstall,i,n==="oxlint"&&e["type-aware"],r),await ci(i),n==="biome"&&await di(r,i),n==="eslint"&&(await fi(r,i),await pi(i),await gi(i)),n==="oxlint"&&(await mi(r,i),await ui(i));for(let d of s??[])await li(d,n,i);for(let d of c??[])await yi(d,f[d],o,n,i);for(let d of a??[])await ki(d,o,i);v?.includes("husky")&&await hi(o,!e.skipInstall,i),v?.includes("lefthook")&&await wi(o,!e.skipInstall,i),v?.includes("lint-staged")&&await xi(o,!e.skipInstall,i),v?.includes("pre-commit")&&await vi(o,i),i||b1.success("Successfully initialized Ultracite! Make sure to check out ultracite.ai/cloud for our pro version.")}catch(o){let n=o instanceof Error?o.message:"Unknown error";throw i||b1.error(`Failed to initialize Ultracite configuration: ${n}`),o}};var X=new bi;X.name("ultracite").version(z.version).description(z.description);X.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 (oxlint only)").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")})});X.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(r=>r.startsWith("-")),n=t.filter(r=>!r.startsWith("--"));await H1(n,o)});X.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(r=>r.startsWith("-")),n=t.filter(r=>!r.startsWith("--"));await X1(n,o)});X.command("doctor").description("Verify your Ultracite setup").action(async()=>{await V1()});process.env.TEST||X.parse();export{X as program};
|
|
311
|
+
`;await qt(h1,n)}};m();import{readFile as L3,writeFile as ee}from"fs/promises";import D3 from"deepmerge";import{parse as N3}from"jsonc-parser";var x1="./.oxlintrc.json",H=t=>`./node_modules/ultracite/config/oxlint/${t}/.oxlintrc.json`,ie={$schema:"./node_modules/oxlint/configuration_schema.json",extends:[H("core")]},v1={exists:async()=>await l(x1),create:async t=>{let e=[H("core")];if(t?.frameworks&&t.frameworks.length>0)for(let o of t.frameworks)e.push(H(o));let i={...ie,extends:e};return await ee(x1,JSON.stringify(i,null,2))},update:async t=>{let e=await L3(x1,"utf-8"),o=N3(e)||{},n=o.extends&&Array.isArray(o.extends)?o.extends:[],r=f=>n.some(k=>k===H(f)),s=[...n];if(r("core")||s.push(H("core")),t?.frameworks&&t.frameworks.length>0)for(let f of t.frameworks)r(f)||s.push(H(f));o.extends=s;let c={$schema:ie.$schema},a=D3(o,c);await ee(x1,JSON.stringify(a,null,2))}};m();import{readFile as R3,writeFile as oe}from"fs/promises";var T3=["./.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"],ne="./prettier.config.mjs",G3=async()=>{try{return"prettier"in JSON.parse(await R3("./package.json","utf-8"))}catch{return!1}},M3=async()=>{if(await G3())return"./package.json";for(let t of T3)if(await l(t))return t;return null},se=()=>`export { default } from "ultracite/prettier";
|
|
312
|
+
`,y1={exists:async()=>await M3()!==null,create:async()=>{let t=se();await oe(ne,t)},update:async()=>{let t=se();await oe(ne,t)}};m();import{readFile as J3,writeFile as re}from"fs/promises";var H3=["./.stylelintrc.mjs","./stylelint.config.mjs","./.stylelintrc.cjs","./stylelint.config.cjs","./.stylelintrc.js","./stylelint.config.js","./.stylelintrc","./.stylelintrc.json","./.stylelintrc.yml","./.stylelintrc.yaml"],ae="./stylelint.config.mjs",W3=async()=>{try{return"stylelint"in JSON.parse(await J3("./package.json","utf-8"))}catch{return!1}},V3=async()=>{if(await W3())return"./package.json";for(let t of H3)if(await l(t))return t;return null},ce=()=>`export { default } from "ultracite/stylelint";
|
|
313
|
+
`,k1={exists:async()=>await V3()!==null,create:async()=>{let t=ce();await re(ae,t)},update:async()=>{let t=ce();await re(ae,t)}};import{readFile as X3,writeFile as le}from"fs/promises";import{glob as Q3}from"glob";import{applyEdits as K3,modify as Y3,parse as Z3}from"jsonc-parser";var de=async()=>{try{return await Q3("**/tsconfig*.json",{ignore:["**/node_modules/**","**/dist/**","**/build/**","**/.next/**"],absolute:!1})}catch{return[]}},q3=t=>{if(!t)return!1;let e=t.compilerOptions;return e?e.strict===!0||e.strictNullChecks===!0:!1},ti=async t=>{try{let e=await X3(t,"utf-8"),i=Z3(e);if(q3(i))return;if(i===void 0){await le(t,JSON.stringify({compilerOptions:{strictNullChecks:!0}},null,2));return}let n=Y3(e,["compilerOptions","strictNullChecks"],!0,{formattingOptions:{tabSize:2,insertSpaces:!0}}),r=K3(e,n);await le(t,r)}catch(e){console.warn(`Failed to update ${t}:`,e)}},G1={exists:async()=>(await de()).length>0,update:async()=>{let t=await de();if(t.length===0){console.warn("No tsconfig.json files found in the project");return}await Promise.all(t.map(e=>ti(e)))}};m();var fe=z.devDependencies["@biomejs/biome"],M1=z.version,ri={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"]},ai=(t,e)=>{for(let i of e){let o=ri[i];o&&t.push(...o)}},ci=async(t,e="biome",i=!0,o=!1,n=!1,r=["react"])=>{let s=p();o||s.start("Installing dependencies...");let c=[`ultracite@${M1}`];if(e==="biome"&&c.push(`@biomejs/biome@${fe}`),e==="eslint"&&(c.push("eslint@latest"),c.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"),ai(c,r),c.push("prettier@latest"),c.push("stylelint@latest")),e==="oxlint"&&(c.push("oxlint@latest"),c.push("oxfmt@latest"),n&&c.push("oxlint-tsgolint@latest")),i)for(let a of c)await ni(a,{packageManager:t,workspace:await C(),silent:!0,corepack:!1});else{let a={ultracite:M1};e==="biome"&&(a["@biomejs/biome"]=fe),e==="eslint"&&(a.eslint="latest",a.prettier="latest",a.stylelint="latest"),e==="oxlint"&&(a.oxlint="latest",a.oxfmt="latest",n&&(a["oxlint-tsgolint"]="latest")),await y({devDependencies:a})}await y({scripts:{check:"ultracite check",fix:"ultracite fix"}}),o||s.stop("Dependencies installed.")},li=async(t=!1)=>{let e=p();if(t||e.start("Checking for tsconfig.json files..."),await G1.exists()){t||e.message("Found tsconfig.json files, updating with strictNullChecks..."),await G1.update(),t||e.stop("tsconfig.json files updated.");return}t||e.stop("No tsconfig.json files found, skipping.")},di=async(t,e="biome",i=!1)=>{let o=G.find(s=>s.id===t);if(!o)throw new Error(`Editor "${t}" not found`);let n=_t(t,e),r=p();if(i||r.start(`Checking for ${o.config.path}...`),await n.exists()){i||r.message(`${o.config.path} found, updating...`),await n.update(),i||r.stop(`${o.config.path} updated.`);return}if(i||r.message(`${o.config.path} not found, creating...`),await n.create(),n.extension){let s=f1.find(c=>c.id===e)?.vscodeExtensionId;if(!s)throw new Error(`Linter extension not found for ${e}`);i||r.message(`Installing ${s} extension...`);try{if(n.extension(s).status===0){i||r.stop(`${o.config.path} created and ${s} extension installed.`);return}}catch{}i||r.stop(`${o.config.path} created. Install ${s} extension manually.`);return}i||(t==="zed"?r.stop(`${o.config.path} created. Install the Biome extension: https://biomejs.dev/reference/zed/`):r.stop(`${o.config.path} created.`))},fi=async(t,e=!1)=>{let i=p();if(e||i.start("Checking for Biome configuration..."),await g1.exists()){e||i.message("Biome configuration found, updating..."),await g1.update({frameworks:t}),e||i.stop("Biome configuration updated.");return}e||i.message("Biome configuration not found, creating..."),await g1.create({frameworks:t}),e||i.stop("Biome configuration created.")},mi=async(t,e=!1)=>{let i=p();if(e||i.start("Checking for ESLint configuration..."),await u1.exists()){e||i.message("ESLint configuration found, updating..."),await u1.update({frameworks:t}),e||i.stop("ESLint configuration updated.");return}e||i.message("ESLint configuration not found, creating..."),await u1.create({frameworks:t}),e||i.stop("ESLint configuration created.")},pi=async(t,e=!1)=>{let i=p();if(e||i.start("Checking for Oxlint configuration..."),await v1.exists()){e||i.message("Oxlint configuration found, updating..."),await v1.update({frameworks:t}),e||i.stop("Oxlint configuration updated.");return}e||i.message("Oxlint configuration not found, creating..."),await v1.create({frameworks:t}),e||i.stop("Oxlint configuration created.")},gi=async(t=!1)=>{let e=p();if(t||e.start("Checking for Prettier configuration..."),await y1.exists()){t||e.message("Prettier configuration found, updating..."),await y1.update(),t||e.stop("Prettier configuration updated.");return}t||e.message("Prettier configuration not found, creating..."),await y1.create(),t||e.stop("Prettier configuration created.")},ui=async(t=!1)=>{let e=p();if(t||e.start("Checking for Stylelint configuration..."),await k1.exists()){t||e.message("Stylelint configuration found, updating..."),await k1.update(),t||e.stop("Stylelint configuration updated.");return}t||e.message("Stylelint configuration not found, creating..."),await k1.create(),t||e.stop("Stylelint configuration created.")},hi=async(t=!1)=>{let e=p();if(t||e.start("Checking for oxfmt configuration..."),await w1.exists()){t||e.message("oxfmt configuration found, updating..."),await w1.update(),t||e.stop("oxfmt configuration updated.");return}t||e.message("oxfmt configuration not found, creating..."),await w1.create(),t||e.stop("oxfmt configuration created.")},wi=async(t,e=!0,i=!1)=>{let o=p();if(i||(o.start("Initializing pre-commit hooks..."),o.message("Installing Husky...")),e?await E.install(t):await y({devDependencies:{husky:"latest"},scripts:{prepare:"husky"}}),i||o.message("Initializing Husky..."),E.init(t),await E.exists()){i||o.message("Pre-commit hook found, updating..."),await E.update(t),i||o.stop("Pre-commit hook updated.");return}i||o.message("Pre-commit hook not found, creating..."),await E.create(t),i||o.stop("Pre-commit hook created.")},xi=async(t,e=!0,i=!1)=>{let o=p();if(i||(o.start("Initializing lefthook..."),o.message("Installing lefthook...")),e?await M.install(t):await y({devDependencies:{lefthook:"latest"}}),await M.exists()){i||o.message("lefthook.yml found, updating..."),await M.update(t),i||o.stop("lefthook.yml updated.");return}i||o.message("lefthook.yml not found, creating..."),await M.create(t),i||o.stop("lefthook.yml created.")},vi=async(t,e=!0,i=!1)=>{let o=p();if(i||(o.start("Initializing lint-staged..."),o.message("Installing lint-staged...")),e?await J.install(t):await y({devDependencies:{"lint-staged":"latest"}}),await J.exists()){i||o.message("lint-staged found, updating..."),await J.update(t),i||o.stop("lint-staged updated.");return}i||o.message("lint-staged not found, creating..."),await J.create(t),i||o.stop("lint-staged created.")},yi=async(t,e=!1)=>{let i=p();if(e||i.start("Initializing pre-commit..."),await Z.exists()){e||i.message(".pre-commit-config.yaml found, updating..."),await Z.update(t),e||i.stop(".pre-commit-config.yaml updated.");return}e||i.message(".pre-commit-config.yaml not found, creating..."),await Z.create(t),e||i.stop(".pre-commit-config.yaml created.")},ki=async(t,e,i,o,n=!1)=>{let r=p();n||r.start(`Checking for ${e}...`);let s=$t(t,i,o);if(await s.exists()){n||r.message(`${e} found, updating...`),await s.update(),n||r.stop(`${e} updated.`);return}n||r.message(`${e} not found, creating...`),await s.create(),n||r.stop(`${e} created.`)},bi=async(t,e,i=!1)=>{let o=p(),n=Q.find(s=>s.id===t)?.name??t;i||o.start(`Checking for ${n} hooks...`);let r=Ut(t,e);if(await r.exists()){i||o.message(`${n} hooks found, updating...`),await r.update(),i||o.stop(`${n} hooks updated.`);return}i||o.message(`${n} hooks not found, creating...`),await r.create(),i||o.stop(`${n} hooks created.`)},me=async t=>{let e=t??{},i=e.quiet??!1;i||ii(`Ultracite v${M1} Initialization`);try{let{pm:o}=e;if(!o){let d=await si(ei.cwd());if(!d)throw new Error("No package manager specified or detected");if(!i&&d.warnings)for(let g of d.warnings)b1.warn(g);i||b1.info(`Detected lockfile, using ${d.name}`),o=d.name}let n=e.linter;if(n===void 0)if(i||e.pm||e.editors||e.agents||e.hooks||e.integrations!==void 0||e.frameworks!==void 0)n="biome";else{let g=await oi({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(V(g)){W("Operation cancelled.");return}n=g}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 g=await t1({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(V(g)){W("Operation cancelled.");return}r=g}let s=e.editors;if(!s)if(i)s=[];else{let d=await t1({message:"Which editors do you want to configure (recommended)?",options:[{label:"VSCode / Cursor / Windsurf",value:"vscode"},{label:"Zed",value:"zed"}],required:!1});if(V(d)){W("Operation cancelled.");return}s=d}let c=e.agents,a=e.hooks,f=Object.fromEntries(R.map(d=>[d.id,d.name]));if(!c)if(i)c=[];else{let d=await t1({message:"Which agents do you want to enable (optional)?",options:Object.entries(f).map(([g,z1])=>({value:g,label:z1})),required:!1});if(V(d)){W("Operation cancelled.");return}c=d}let k=Object.fromEntries(Q.map(d=>[d.id,d.name]));if(!a)if(i)a=[];else{let d=await t1({message:"Which agent hooks do you want to enable (optional)?",options:Object.entries(k).map(([g,z1])=>({value:g,label:z1})),required:!1});if(V(d)){W("Operation cancelled.");return}a=d}let v=e.integrations;if(v===void 0)if(i||e.pm||e.editors||e.agents||e.hooks)v=[];else{let g=await t1({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(V(g)){W("Operation cancelled.");return}v=g}await ci(o,n,!e.skipInstall,i,n==="oxlint"&&e["type-aware"],r),await li(i),n==="biome"&&await fi(r,i),n==="eslint"&&(await mi(r,i),await gi(i),await ui(i)),n==="oxlint"&&(await pi(r,i),await hi(i));for(let d of s??[])await di(d,n,i);for(let d of c??[])await ki(d,f[d],o,n,i);for(let d of a??[])await bi(d,o,i);v?.includes("husky")&&await wi(o,!e.skipInstall,i),v?.includes("lefthook")&&await xi(o,!e.skipInstall,i),v?.includes("lint-staged")&&await vi(o,!e.skipInstall,i),v?.includes("pre-commit")&&await yi(o,i),i||b1.success("Successfully initialized Ultracite! Make sure to check out ultracite.ai/cloud for our pro version.")}catch(o){let n=o instanceof Error?o.message:"Unknown error";throw i||b1.error(`Failed to initialize Ultracite configuration: ${n}`),o}};var X=new zi;X.name("ultracite").version(z.version).description(z.description);X.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 (oxlint only)").option("--skip-install","Skip installing dependencies").option("--quiet","Suppress interactive prompts").action(async t=>{await me({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")})});X.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(r=>r.startsWith("-")),n=t.filter(r=>!r.startsWith("--"));await V1(n,o)});X.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(r=>r.startsWith("-")),n=t.filter(r=>!r.startsWith("--"));await K1(n,o)});X.command("doctor").description("Verify your Ultracite setup").action(async()=>{await Q1()});process.env.TEST||X.parse();export{X as program};
|