ultracite 7.9.3 → 7.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/config/biome/core/biome.jsonc +0 -1
- package/config/biome/react/biome.jsonc +1 -0
- package/dist/index.js +82 -60
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -40,6 +40,7 @@ Common `init` flags for non-interactive / CI use:
|
|
|
40
40
|
| `--editors <editors...>` | Editors to configure (use `universal` for `.vscode/settings.json`). |
|
|
41
41
|
| `--agents <agents...>` | AI agents to enable (use `universal` for `AGENTS.md`). |
|
|
42
42
|
| `--frameworks <frameworks...>` | Frameworks in use, for framework-aware rules. |
|
|
43
|
+
| `--js-plugins <plugins...>` | Optional Oxlint JS plugins to enable (`eslint-plugin-github`, `eslint-plugin-sonarjs`, `oxlint-plugin-react-doctor`). |
|
|
43
44
|
| `--type-aware` | Enable type-aware linting. |
|
|
44
45
|
| `--install-skill` | Install the reusable Ultracite skill after setup. |
|
|
45
46
|
| `--skip-install` | Configure without installing dependencies. |
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as
|
|
3
|
-
`)},u0=/^[a-z][a-z0-9-]*$/u,L=(b)=>{if(!u0.test(b))throw Error(`Invalid framework name "${b}": must match ${u0}`);return b},p=["biome.json","biome.jsonc",".biome.json",".biome.jsonc"],P=["eslint.config.mjs","eslint.config.js","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts"],d0=[".eslintrc",".eslintrc.json",".eslintrc.js",".eslintrc.cjs",".eslintrc.yaml",".eslintrc.yml"],n=[".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"],i=[".stylelintrc.mjs","stylelint.config.mjs",".stylelintrc.cjs","stylelint.config.cjs",".stylelintrc.js","stylelint.config.js",".stylelintrc",".stylelintrc.json",".stylelintrc.yml",".stylelintrc.yaml"],g1=[".oxlintrc.json","oxlint.config.ts"],o0=["oxfmt.config.ts"],rb={"@angular/core":["angular"],"@builder.io/qwik":["qwik"],"@nestjs/core":["nestjs"],"@qwik.dev/core":["qwik"],"@remix-run/node":["remix"],"@remix-run/react":["react","remix"],"@tanstack/react-query":["react","tanstack"],"@tanstack/react-router":["react","tanstack"],"@tanstack/react-start":["react","tanstack"],astro:["astro"],jest:["jest"],next:["react","next"],nuxt:["vue"],react:["react"],"react-router":["react","remix"],"solid-js":["solid"],svelte:["svelte"],vitest:["vitest"],vue:["vue"]},D0=(b)=>{if(!b)return[];return[...Object.keys(b.dependencies??{}),...Object.keys(b.devDependencies??{}),...Object.keys(b.peerDependencies??{})]},lb=async(b)=>{let y=new Set,$=b?.workspaces;if(Array.isArray($))for(let G of $)y.add(G);else if($&&typeof $==="object"){let{packages:G}=$;if(Array.isArray(G)){for(let v of G)if(typeof v==="string")y.add(v)}}if(H(i1))try{let G=await Mb(i1,"utf-8"),v=fb.parse(G);if(Array.isArray(v?.packages)){for(let U of v.packages)if(typeof U==="string")y.add(U)}}catch{}return[...y]},x0=async()=>{let b=new Set;try{let y=await s(),$=new Set(D0(y)),G=await lb(y);if(G.length>0){let v=await cb(G.map((Q)=>`${Q.replace(/\/+$/u,"")}/package.json`),{absolute:!1,ignore:["**/node_modules/**"]}),U=await Promise.all(v.map((Q)=>s(Q)));for(let Q of U)for(let W of D0(Q))$.add(W)}for(let v of $){let U=rb[v];if(U)for(let Q of U)b.add(Q)}}catch{}return[...b]},t=(b=n1.cwd())=>{let y=b;while(!0){for(let G of p)if(H(o.join(y,G)))return"biome";for(let G of P)if(H(o.join(y,G)))return"eslint";for(let G of g1)if(H(o.join(y,G)))return"oxlint";let $=o.dirname(y);if($===y)break;y=$}return null};var Cb=(b,y)=>{let $=["check","--no-errors-on-unmatched",...y];if(b.length>0)$.push(...b);else $.push("./");let G=w("biome",$,{stdio:"inherit"});D("Biome",G)},sb=(b,y)=>{let $=[...y,...b.length>0?b:["."]],G=w("eslint",$,{stdio:"inherit"});D("ESLint",G)},nb=(b,y)=>{let $=["--check",...y,...b.length>0?b:["."]],G=w("prettier",$,{stdio:"inherit"});D("Prettier",G)},ib=(b,y)=>{let $=S1(b);if($.length===0)return;let G=[...y,"--allow-empty-input",...$],v=w("stylelint",G,{stdio:"inherit"});D("Stylelint",v)},tb=(b,y)=>{let $=[...y,...b.length>0?b:["."]],G=w("oxlint",$,{stdio:"inherit"});D("Oxlint",G)},gb=(b,y)=>{let $=["--check",...y,...b.length>0?b:["."]],G=w("oxfmt",$,{stdio:"inherit"});D("oxfmt",G)},N0=(b=[],y=[])=>{let $=t(),G=N1(b);if(!$)throw Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch($){case"eslint":{l([()=>nb(G,[]),()=>sb(G,y),()=>ib(G,[])]);break}case"oxlint":{l([()=>gb(G,[]),()=>tb(G,y)]);break}default:Cb(G,y)}};import{existsSync as F,readFileSync as F1}from"node:fs";import _ from"node:path";import m from"node:process";import{intro as ab,log as I,outro as R1,spinner as eb}from"@clack/prompts";import{parse as by}from"jsonc-parser";var U1="Biome configuration",Q1="ESLint configuration",a1="Prettier configuration",e1="Stylelint configuration",W1="Oxlint configuration",Z1="oxfmt configuration",z1="Ultracite dependency",b0="Conflicting tools",I1="Doctor complete",g=(b,y)=>{let $=w(b,["--version"],{encoding:"utf-8"});if($.status===0&&$.stdout)return{message:`${b} is installed (${String($.stdout).trim()})`,name:`${b} installation`,status:"pass"};return{message:`${b} is not installed${y?"":" (optional)"}`,name:`${b} installation`,status:y?"fail":"warn"}},yy=()=>{let b=null,y=null;for(let $ of p){let G=_.join(m.cwd(),$);if(F(G)){b=G,y=$;break}}if(!b)return{message:`No Biome config file found (expected one of: ${p.join(", ")})`,name:U1,status:"fail"};try{let $=F1(b,"utf-8"),G=by($);if(Array.isArray(G?.extends)&&G.extends.includes("ultracite/biome/core"))return{message:`${y} extends ultracite/biome/core`,name:U1,status:"pass"};return{message:`${y} exists but doesn't extend ultracite/biome/core`,name:U1,status:"warn"}}catch{return{message:`Could not parse ${y} file`,name:U1,status:"fail"}}},$y=()=>{let b=null;for(let y of P){let $=_.join(m.cwd(),y);if(F($)){b=$;break}}if(!b)return{message:"No eslint.config.* file found",name:Q1,status:"fail"};try{if(F1(b,"utf-8").includes("ultracite/eslint"))return{message:"eslint.config.* imports ultracite/eslint",name:Q1,status:"pass"};return{message:"eslint.config.* exists but doesn't import ultracite/eslint",name:Q1,status:"warn"}}catch{return{message:"Could not read eslint.config.* file",name:Q1,status:"fail"}}},Gy=()=>{for(let b of n)if(F(_.join(m.cwd(),b)))return{message:`Prettier configuration found (${b})`,name:a1,status:"pass"};return{message:"No Prettier configuration found",name:a1,status:"fail"}},vy=()=>{for(let b of i)if(F(_.join(m.cwd(),b)))return{message:`Stylelint configuration found (${b})`,name:e1,status:"pass"};return{message:"No Stylelint configuration found",name:e1,status:"warn"}},Uy=()=>{let b=_.join(m.cwd(),"oxlint.config.ts");if(!F(b))return{message:"No oxlint.config.ts file found",name:W1,status:"fail"};try{if(F1(b,"utf-8").includes("ultracite/oxlint/"))return{message:"oxlint.config.ts extends ultracite oxlint config",name:W1,status:"pass"};return{message:"oxlint.config.ts exists but doesn't extend ultracite config",name:W1,status:"warn"}}catch{return{message:"Could not read oxlint.config.ts file",name:W1,status:"fail"}}},Qy=()=>{let b=_.join(m.cwd(),"oxfmt.config.ts");if(!F(b))return{message:"No oxfmt.config.ts file found",name:Z1,status:"fail"};try{if(F1(b,"utf-8").includes("ultracite/oxfmt"))return{message:"oxfmt.config.ts extends ultracite oxfmt config",name:Z1,status:"pass"};return{message:"oxfmt.config.ts exists but doesn't extend ultracite config",name:Z1,status:"warn"}}catch{return{message:"Could not read oxfmt.config.ts file",name:Z1,status:"fail"}}},Wy=()=>{let b=_.join(m.cwd(),"package.json");if(!F(b))return{message:"No package.json found",name:z1,status:"warn"};let y=E(b);if(!y)return{message:"Could not parse package.json",name:z1,status:"warn"};let $=y.dependencies?.ultracite||y.devDependencies?.ultracite||y.peerDependencies?.ultracite;if($)return{message:`Ultracite is in package.json (${$})`,name:z1,status:"pass"};return{message:"Ultracite not found in package.json dependencies",name:z1,status:"warn"}},Zy=(b)=>{let y=[];if(b!=="eslint"){if([".prettierrc",".prettierrc.js",".prettierrc.cjs",".prettierrc.mjs",".prettierrc.json",".prettierrc.yaml",".prettierrc.yml","prettier.config.js","prettier.config.mjs","prettier.config.cjs"].some((v)=>F(_.join(m.cwd(),v))))y.push("Prettier")}if([".eslintrc",".eslintrc.js",".eslintrc.cjs",".eslintrc.mjs",".eslintrc.json",".eslintrc.yaml",".eslintrc.yml"].some((G)=>F(_.join(m.cwd(),G))))y.push("ESLint (legacy config)");if(y.length>0)return{message:`Found potentially conflicting tools: ${y.join(", ")}`,name:b0,status:"warn"};return{message:"No conflicting formatting/linting tools found",name:b0,status:"pass"}},zy=(b)=>{let y=[];switch(b){case"biome":{y.push({fn:()=>g("biome",!0),name:"Biome installation"},{fn:yy,name:U1});break}case"eslint":{y.push({fn:()=>g("eslint",!0),name:"ESLint installation"},{fn:$y,name:Q1},{fn:()=>g("prettier",!0),name:"Prettier installation"},{fn:Gy,name:a1},{fn:()=>g("stylelint",!1),name:"Stylelint installation"},{fn:vy,name:e1});break}case"oxlint":{y.push({fn:()=>g("oxlint",!0),name:"Oxlint installation"},{fn:Uy,name:W1},{fn:()=>g("oxfmt",!0),name:"oxfmt installation"},{fn:Qy,name:Z1});break}default:break}return y.push({fn:Wy,name:z1},{fn:()=>Zy(b),name:b0}),y},S0=()=>{ab(`Ultracite v${z.version} Doctor`);let b=t();if(!b)throw I.error("No linter configuration found. Run `ultracite init` to set up a linter."),R1(I1),Error("Doctor checks failed");I.info(`Detected linter: ${b}`);let y=eb();y.start("Running diagnostics...");let G=zy(b).map(({fn:W})=>W());y.stop("Diagnostics complete.");for(let W of G)if(W.status==="pass")I.success(W.message);else if(W.status==="warn")I.warn(W.message);else I.error(W.message);let v=G.filter((W)=>W.status==="pass").length,U=G.filter((W)=>W.status==="fail").length,Q=G.filter((W)=>W.status==="warn").length;if(I.info(`Summary: ${v} passed, ${Q} warnings, ${U} failed`),U>0)throw I.error("Some checks failed. Run 'ultracite init' to fix issues."),R1(I1),Error("Doctor checks failed");if(Q>0){I.warn("Some optional improvements available. Run 'ultracite init' to configure."),R1(I1);return}I.success("Everything looks good!"),R1(I1)};var Yy=(b,y)=>{let $=["check","--write","--no-errors-on-unmatched",...y];if(b.length>0)$.push(...b);else $.push("./");let G=w("biome",$,{stdio:"inherit"});D("Biome",G)},Hy=(b,y)=>{let $=["--fix",...y,...b.length>0?b:["."]],G=w("eslint",$,{stdio:"inherit"});D("ESLint",G)},Xy=(b,y)=>{let $=["--write",...y,...b.length>0?b:["."]],G=w("prettier",$,{stdio:"inherit"});D("Prettier",G)},By=(b,y)=>{let $=S1(b);if($.length===0)return;let G=["--fix",...y,"--allow-empty-input",...$],v=w("stylelint",G,{stdio:"inherit"});D("Stylelint",v)},Vy=(b,y)=>{let $=y.includes("--unsafe"),G=y.filter((Q)=>Q!=="--unsafe"),v=[$?"--fix-dangerously":"--fix",...G,...b.length>0?b:["."]],U=w("oxlint",v,{stdio:"inherit"});D("Oxlint",U)},jy=(b,y)=>{let $=["--write",...y,...b.length>0?b:["."]],G=w("oxfmt",$,{stdio:"inherit"});D("oxfmt",G)},L0=(b,y=[])=>{let $=t(),G=N1(b);if(!$)throw Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch($){case"eslint":{l([()=>Xy(G,[]),()=>Hy(G,y),()=>By(G,[])]);break}case"oxlint":{l([()=>jy(G,[]),()=>Vy(G,y)]);break}default:Yy(G,y)}};import E2 from"node:process";import{cancel as y1,intro as M2,isCancel as $1,log as D1,multiselect as d1,select as p2,spinner as J}from"@clack/prompts";import{addDevDependency as c2,detectPackageManager as f2}from"nypm";import{readFile as wy}from"node:fs/promises";import{dlxCommand as Ky}from"nypm";var y0=(b,y)=>`# Ultracite Code Standards
|
|
2
|
+
import{createRequire as hb}from"node:module";var cb=hb(import.meta.url);import z1 from"node:process";import{log as _$}from"@clack/prompts";import{Command as T$}from"commander";var z={name:"ultracite",version:"7.9.4",description:"The AI-ready formatter that helps you write and generate code faster.",keywords:["biome","fixer","formatter","linter","ultracite"],homepage:"https://www.ultracite.ai/",bugs:{url:"https://github.com/haydenbleasel/ultracite/issues"},license:"MIT",author:"Hayden Bleasel <hello@haydenbleasel.com>",repository:{type:"git",url:"git+https://github.com/haydenbleasel/ultracite.git"},bin:{ultracite:"dist/index.js"},files:["config","dist","README.md"],type:"module",exports:{"./biome/*":"./config/biome/*/biome.jsonc","./eslint/*":"./config/eslint/*/eslint.config.mjs","./oxlint/*":{types:"./config/oxlint/*/index.d.mts",default:"./config/oxlint/*/index.mjs"},"./oxfmt":{types:"./config/oxfmt/index.d.mts",default:"./config/oxfmt/index.mjs"},"./prettier":"./config/prettier/prettier.config.mjs","./stylelint":"./config/stylelint/stylelint.config.mjs"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},scripts:{prebuild:"bun run scripts/generate-dts.ts",build:"tsgo --noEmit && bun run build.ts",test:"bun test","test:coverage":"bun test --coverage",bench:"bun run benchmarks/cli.bench.ts",types:"tsgo --noEmit"},dependencies:{"@clack/prompts":"^1.5.1","@typescript-eslint/utils":"^8.62.1",commander:"^15.0.0","cross-spawn":"^7.0.6",deepmerge:"^4.3.1",glob:"^13.0.6","jsonc-parser":"^3.3.1",nypm:"^0.6.6",yaml:"^2.9.0",zod:"^4.4.3"},devDependencies:{"@angular-eslint/eslint-plugin":"^22.0.0","@biomejs/biome":"2.5.3","@darraghor/eslint-plugin-nestjs-typed":"^7.2.5","@eslint/js":"^10.0.0","@next/eslint-plugin-next":"^16.2.10","@tanstack/eslint-plugin-query":"^5.101.2","@tanstack/eslint-plugin-router":"^1.162.0","@tanstack/eslint-plugin-start":"^0.1.0","@types/bun":"^1.3.14","@types/cross-spawn":"^6.0.6","@types/node":"^25.9.2","@typescript-eslint/eslint-plugin":"^8.62.1","@typescript-eslint/parser":"^8.62.1","@vitest/eslint-plugin":"^1.6.21",eslint:"^10.0.0","eslint-config-prettier":"^10.1.8","eslint-import-resolver-typescript":"^4.4.5","eslint-plugin-astro":"^2.1.1","eslint-plugin-compat":"^7.0.2","eslint-plugin-cypress":"^6.4.2","eslint-plugin-github":"6.0.0","eslint-plugin-html":"^8.1.4","eslint-plugin-import-x":"^4.17.1","eslint-plugin-jest":"^29.15.4","eslint-plugin-jsdoc":"^63.0.11","eslint-plugin-jsx-a11y":"^6.10.2","eslint-plugin-n":"^18.2.1","eslint-plugin-prettier":"^5.5.6","eslint-plugin-promise":"^7.3.0","eslint-plugin-qwik":"^1.20.0","eslint-plugin-react":"^7.37.5","eslint-plugin-react-doctor":"^0.7.1","eslint-plugin-react-hooks":"^7.1.1","eslint-plugin-remix":"^1.1.1","eslint-plugin-solid":"^0.14.5","eslint-plugin-sonarjs":"^4.1.0","eslint-plugin-storybook":"^10.4.6","eslint-plugin-svelte":"^3.20.0","eslint-plugin-unicorn":"^70.0.0","eslint-plugin-unused-imports":"^4.4.1","eslint-plugin-vue":"^10.9.2",globals:"^17.7.0",oxlint:"^1.73.0","oxlint-plugin-react-doctor":"^0.7.1","prettier-plugin-astro":"^0.14.1","prettier-plugin-svelte":"^4.1.0","prettier-plugin-tailwindcss":"^0.8.0",storybook:"^10.4.6","stylelint-config-idiomatic-order":"^10.0.0","stylelint-config-standard":"^40.0.0","stylelint-prettier":"^5.0.3"},peerDependencies:{oxfmt:">=0.1.0",oxlint:"^1.0.0"},peerDependenciesMeta:{oxfmt:{optional:!0},oxlint:{optional:!0}},packageManager:"bun@1.3.14"};import{readFileSync as $2}from"node:fs";import u from"node:path";import _0 from"node:process";import{parse as y2}from"jsonc-parser";import{accessSync as lb,lstatSync as R0,mkdirSync as nb,realpathSync as m0}from"node:fs";import{readFile as rb,writeFile as sb}from"node:fs/promises";import L from"node:path";import a1 from"node:process";import{glob as ib}from"glob";import gb from"yaml";import{readFileSync as fb}from"node:fs";import{readFile as kb}from"node:fs/promises";import{parse as L0}from"jsonc-parser";import{z as X}from"zod";var Cb=X.looseObject({dependencies:X.record(X.string(),X.string()).optional(),devDependencies:X.record(X.string(),X.string()).optional(),"lint-staged":X.unknown().optional(),name:X.string().optional(),peerDependencies:X.record(X.string(),X.string()).optional(),prettier:X.unknown().optional(),scripts:X.record(X.string(),X.string()).optional(),stylelint:X.unknown().optional(),type:X.string().optional(),version:X.string().optional(),workspace:X.unknown().optional(),workspaces:X.union([X.array(X.string()),X.record(X.string(),X.unknown())]).optional()}),g=(b)=>{let $=L0(b),y=Cb.safeParse($);return y.success?y.data:void 0},h=(b="package.json")=>{try{let $=fb(b,"utf-8");return g($)}catch{return}},t=async(b="package.json")=>{try{let $=await kb(b,"utf-8");return g($)}catch{return}},N0=X.looseObject({extends:X.array(X.string()).optional()}),S0=X.looseObject({compilerOptions:X.looseObject({strict:X.boolean().optional(),strictNullChecks:X.boolean().optional()}).optional()}),I1=(b,$)=>{let y=L0(b),G=$.safeParse(y);return G.success?G.data:void 0};var e1="pnpm-workspace.yaml",V=(b)=>{try{return lb(b),!0}catch{return!1}},c=()=>{if(V(e1))return!0;let b=h();if(!b)return!1;return!!b.workspaces||!!b.workspace},R=(b)=>{let $=L.dirname(b);if($!=="."){let y=$.startsWith("./")?$.slice(2):$;nb(y,{recursive:!0})}},t1=(b,$)=>{let y=L.relative($,b);return y===""||!y.startsWith("..")&&!L.isAbsolute(y)},b0=(b)=>typeof m0==="function"?m0(b):L.resolve(b),tb=(b)=>{let $=b;while(!0)try{return b0($)}catch(y){if(y.code!=="ENOENT")throw y;let G=L.dirname($);if(G===$)return L.resolve($);$=G}},ab=(b)=>{let $=b0(a1.cwd()),y=L.resolve(a1.cwd(),b);if(!t1(y,$))throw Error(`Refusing to write outside project: ${b}`);let G=L.dirname(y),Q=tb(G);if(!t1(Q,$))throw Error(`Refusing to write through directory outside project: ${b}`);try{if((typeof R0==="function"?R0(y):void 0)?.isSymbolicLink())throw Error(`Refusing to write through symbolic link: ${b}`);let Z=b0(y);if(!t1(Z,$))throw Error(`Refusing to write outside project: ${b}`)}catch(W){if(W.code==="ENOENT")return;throw W}},v=async(b,$)=>{ab(b),R(b),await sb(b,$)},N=async({dependencies:b,devDependencies:$,scripts:y,type:G})=>{let Q=await t();if(!Q)throw Error("Failed to parse package.json: file is missing or invalid");let W={...Q};if(G)W.type=G;if(Q.devDependencies||$)W.devDependencies={...Q.devDependencies,...$};if(Q.dependencies||b)W.dependencies={...Q.dependencies,...b};if(Q.scripts||y)W.scripts={...Q.scripts,...y};await v("package.json",`${JSON.stringify(W,null,2)}
|
|
3
|
+
`)},I0=/^[a-z][a-z0-9-]*$/u,m=(b)=>{if(!I0.test(b))throw Error(`Invalid framework name "${b}": must match ${I0}`);return b},I=["biome.json","biome.jsonc",".biome.json",".biome.jsonc"],C=["eslint.config.mjs","eslint.config.js","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts"],F0=[".eslintrc",".eslintrc.json",".eslintrc.js",".eslintrc.cjs",".eslintrc.yaml",".eslintrc.yml"],a=[".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"],e=[".stylelintrc.mjs","stylelint.config.mjs",".stylelintrc.cjs","stylelint.config.cjs",".stylelintrc.js","stylelint.config.js",".stylelintrc",".stylelintrc.json",".stylelintrc.yml",".stylelintrc.yaml"],$0=[".oxlintrc.json","oxlint.config.ts"],O0=["oxfmt.config.ts"],eb={"@angular/core":["angular"],"@builder.io/qwik":["qwik"],"@nestjs/core":["nestjs"],"@qwik.dev/core":["qwik"],"@remix-run/node":["remix"],"@remix-run/react":["react","remix"],"@tanstack/react-query":["react","tanstack"],"@tanstack/react-router":["react","tanstack"],"@tanstack/react-start":["react","tanstack"],astro:["astro"],jest:["jest"],next:["react","next"],nuxt:["vue"],react:["react"],"react-router":["react","remix"],"solid-js":["solid"],svelte:["svelte"],vitest:["vitest"],vue:["vue"]},u0=(b)=>{if(!b)return[];return[...Object.keys(b.dependencies??{}),...Object.keys(b.devDependencies??{}),...Object.keys(b.peerDependencies??{})]},b2=async(b)=>{let $=new Set,y=b?.workspaces;if(Array.isArray(y))for(let G of y)$.add(G);else if(y&&typeof y==="object"){let{packages:G}=y;if(Array.isArray(G)){for(let Q of G)if(typeof Q==="string")$.add(Q)}}if(V(e1))try{let G=await rb(e1,"utf-8"),Q=gb.parse(G);if(Array.isArray(Q?.packages)){for(let W of Q.packages)if(typeof W==="string")$.add(W)}}catch{}return[...$]},o0=async()=>{let b=new Set;try{let $=await t(),y=new Set(u0($)),G=await b2($);if(G.length>0){let Q=await ib(G.map((Z)=>`${Z.replace(/\/+$/u,"")}/package.json`),{absolute:!1,ignore:["**/node_modules/**"]}),W=await Promise.all(Q.map((Z)=>t(Z)));for(let Z of W)for(let U of u0(Z))y.add(U)}for(let Q of y){let W=eb[Q];if(W)for(let Z of W)b.add(Z)}}catch{}return[...b]},b1=(b=a1.cwd())=>{let $=b;while(!0){for(let G of I)if(V(L.join($,G)))return"biome";for(let G of C)if(V(L.join($,G)))return"eslint";for(let G of $0)if(V(L.join($,G)))return"oxlint";let y=L.dirname($);if(y===$)break;$=y}return null};var T0="ultracite",u1="ultracite/biome/core",G2={biome:u1,eslint:"ultracite/eslint/core",oxlint:"ultracite/oxlint/core"},y0={exists:V,readFile:(b)=>$2(b,"utf-8")},q0=(b,$)=>{let y=b;while(!0){let G=$(y);if(G!==null)return G;let Q=u.dirname(y);if(Q===y)return null;y=Q}},Q2=(b,$)=>q0(b,(y)=>{let G=u.join(y,"node_modules",T0);return $.exists(u.join(G,"package.json"))?G:null}),W2=(b)=>{if(typeof b==="string")return b;let $=b.default;return typeof $==="string"?$:null},Z2=(b,$,y)=>{let G=W2($);if(!G)return null;if(!b.includes("*"))return b===y?G:null;let[Q,W]=b.split("*");if(!y.startsWith(Q)||!y.endsWith(W)||y.length<Q.length+W.length)return null;let Z=y.slice(Q.length,y.length-W.length);return G.replaceAll("*",Z)},E0=(b,$,y=y0)=>{let G=Q2($,y);if(!G)return null;let Q;try{Q=JSON.parse(y.readFile(u.join(G,"package.json")))?.exports??{}}catch{return null}let W=`.${b.slice(T0.length)}`;for(let[Z,U]of Object.entries(Q)){let H=Z2(Z,U,W);if(H){let B=u.join(G,H);return y.exists(B)?B:null}}return null},M0=(b,$=_0.cwd(),y=y0)=>E0(G2[b],$,y)!==null,U2=(b,$)=>q0(b,(y)=>{for(let G of I){let Q=u.join(y,G);if($.exists(Q))return Q}return null}),v2=(b,$)=>{try{let y=y2($.readFile(b));return Array.isArray(y?.extends)&&y.extends.includes(u1)}catch{return!1}},F1=(b=_0.cwd(),$=y0)=>{let y=U2(b,$);if(!y||!v2(y,$))return null;return E0(u1,u.dirname(y),$)?null:y};class l extends Error{name="UltraciteSetupError"}var O1=(b)=>[`${u.basename(b)} extends "${u1}", but Ultracite could not be resolved from ${u.dirname(b)}.`,"Biome loads that config from your project's node_modules, so Ultracite has to be installed there — running the CLI through npx/bunx doesn't install it.","Add it as a dev dependency (e.g. `npm install --save-dev ultracite`) and try again."].join(" ");import{existsSync as z2}from"node:fs";import Y2 from"node:path";var H2=(b,$,y)=>{let G=y?.indexOf(b)??-1;if(!y||G===-1)return $;return y.slice(G+1)},o1=(b)=>b.map(($)=>$.startsWith("-")?`./${$}`:$),G0="**/*.{css,scss,sass,less}",V2=[".css",".scss",".sass",".less"],X2=(b)=>{let $=b.toLowerCase();return V2.some((y)=>$.endsWith(y))},_1=(b)=>{if(b.length===0)return[G0];let $=[];for(let y of b){if(X2(y)){$.push(y);continue}if(Y2.extname(y)===""){let G=y.replace(/\/+$/u,"");$.push(G==="."||G===""?G0:`${G}/${G0}`)}}return $},Q0=({commandName:b,parsedArgs:$,pathExists:y=z2,rawArgs:G})=>{let Q=H2(b,$,G),W=Q.indexOf("--");if(W!==-1)return{files:Q.slice(W+1),passthrough:Q.slice(0,W)};let Z=[],U=[];for(let H of Q){if(H.startsWith("-")&&!y(H)){U.push(H);continue}Z.push(H)}return{files:Z,passthrough:U}};import{sync as B2}from"cross-spawn";class $1 extends Error{commandName;exitCode;name="LinterExitError";constructor(b,$){super(`${b} exited with code ${$}`);this.commandName=b,this.exitCode=$}}var A=(b,$,y)=>B2(b,$,{...y,shell:!1}),d=(b,$)=>{if($.error)throw Error(`Failed to run ${b}: ${$.error.message}`);if($.status===null)throw Error(`${b} was killed by signal ${$.signal??"unknown"}`);if($.status!==0)throw new $1(b,$.status)},y1=(b)=>{let $=null;for(let y of b)try{y()}catch(G){if(G instanceof $1){$??=G;continue}throw G}if($)throw new $1($.commandName,$.exitCode)};var K2=(b,$)=>{let y=F1();if(y)throw new l(O1(y));let G=["check","--no-errors-on-unmatched",...$];if(b.length>0)G.push(...b);else G.push("./");let Q=A("biome",G,{stdio:"inherit"});d("Biome",Q)},w2=(b,$)=>{let y=[...$,...b.length>0?b:["."]],G=A("eslint",y,{stdio:"inherit"});d("ESLint",G)},A2=(b,$)=>{let y=["--check",...$,...b.length>0?b:["."]],G=A("prettier",y,{stdio:"inherit"});d("Prettier",G)},J2=(b,$)=>{let y=_1(b);if(y.length===0)return;let G=[...$,"--allow-empty-input",...y],Q=A("stylelint",G,{stdio:"inherit"});d("Stylelint",Q)},j2=(b,$)=>{let y=[...$,...b.length>0?b:["."]],G=A("oxlint",y,{stdio:"inherit"});d("Oxlint",G)},D2=(b,$)=>{let y=["--check",...$,...b.length>0?b:["."]],G=A("oxfmt",y,{stdio:"inherit"});d("oxfmt",G)},p0=(b=[],$=[])=>{let y=b1(),G=o1(b);if(!y)throw Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(y){case"eslint":{y1([()=>A2(G,[]),()=>w2(G,$),()=>J2(G,[])]);break}case"oxlint":{y1([()=>D2(G,[]),()=>j2(G,$)]);break}default:K2(G,$)}};import{existsSync as O,readFileSync as E1}from"node:fs";import o from"node:path";import _ from"node:process";import{intro as d2,log as F,outro as T1,spinner as x2}from"@clack/prompts";import{parse as L2}from"jsonc-parser";var H1="Biome configuration",V1="ESLint configuration",W0="Prettier configuration",Z0="Stylelint configuration",X1="Oxlint configuration",B1="oxfmt configuration",Q1="Ultracite dependency",U0="Conflicting tools",q1="Doctor complete",G1=(b,$)=>{let y=A(b,["--version"],{encoding:"utf-8"});if(y.status===0&&y.stdout)return{message:`${b} is installed (${String(y.stdout).trim()})`,name:`${b} installation`,status:"pass"};return{message:`${b} is not installed${$?"":" (optional)"}`,name:`${b} installation`,status:$?"fail":"warn"}},N2=()=>{let b=null,$=null;for(let y of I){let G=o.join(_.cwd(),y);if(O(G)){b=G,$=y;break}}if(!b)return{message:`No Biome config file found (expected one of: ${I.join(", ")})`,name:H1,status:"fail"};try{let y=E1(b,"utf-8"),G=L2(y);if(Array.isArray(G?.extends)&&G.extends.includes("ultracite/biome/core"))return{message:`${$} extends ultracite/biome/core`,name:H1,status:"pass"};return{message:`${$} exists but doesn't extend ultracite/biome/core`,name:H1,status:"warn"}}catch{return{message:`Could not parse ${$} file`,name:H1,status:"fail"}}},S2=()=>{let b=null;for(let $ of C){let y=o.join(_.cwd(),$);if(O(y)){b=y;break}}if(!b)return{message:"No eslint.config.* file found",name:V1,status:"fail"};try{if(E1(b,"utf-8").includes("ultracite/eslint"))return{message:"eslint.config.* imports ultracite/eslint",name:V1,status:"pass"};return{message:"eslint.config.* exists but doesn't import ultracite/eslint",name:V1,status:"warn"}}catch{return{message:"Could not read eslint.config.* file",name:V1,status:"fail"}}},R2=()=>{for(let b of a)if(O(o.join(_.cwd(),b)))return{message:`Prettier configuration found (${b})`,name:W0,status:"pass"};return{message:"No Prettier configuration found",name:W0,status:"fail"}},m2=()=>{for(let b of e)if(O(o.join(_.cwd(),b)))return{message:`Stylelint configuration found (${b})`,name:Z0,status:"pass"};return{message:"No Stylelint configuration found",name:Z0,status:"warn"}},I2=()=>{let b=o.join(_.cwd(),"oxlint.config.ts");if(!O(b))return{message:"No oxlint.config.ts file found",name:X1,status:"fail"};try{if(E1(b,"utf-8").includes("ultracite/oxlint/"))return{message:"oxlint.config.ts extends ultracite oxlint config",name:X1,status:"pass"};return{message:"oxlint.config.ts exists but doesn't extend ultracite config",name:X1,status:"warn"}}catch{return{message:"Could not read oxlint.config.ts file",name:X1,status:"fail"}}},u2=()=>{let b=o.join(_.cwd(),"oxfmt.config.ts");if(!O(b))return{message:"No oxfmt.config.ts file found",name:B1,status:"fail"};try{if(E1(b,"utf-8").includes("ultracite/oxfmt"))return{message:"oxfmt.config.ts extends ultracite oxfmt config",name:B1,status:"pass"};return{message:"oxfmt.config.ts exists but doesn't extend ultracite config",name:B1,status:"warn"}}catch{return{message:"Could not read oxfmt.config.ts file",name:B1,status:"fail"}}},F2=(b)=>{let $=o.join(_.cwd(),"package.json");if(!O($))return{message:"No package.json found",name:Q1,status:"warn"};let y=h($);if(!y)return{message:"Could not parse package.json",name:Q1,status:"warn"};let G=y.dependencies?.ultracite||y.devDependencies?.ultracite||y.peerDependencies?.ultracite;if(!M0(b))return{message:G?`Ultracite is in package.json (${G}) but isn't installed — run your package manager's install`:"Ultracite is not installed in this project — install it as a dev dependency",name:Q1,status:"fail"};if(G)return{message:`Ultracite is installed (${G})`,name:Q1,status:"pass"};return{message:"Ultracite not found in package.json dependencies",name:Q1,status:"warn"}},O2=(b)=>{let $=[];if(b!=="eslint"){if([".prettierrc",".prettierrc.js",".prettierrc.cjs",".prettierrc.mjs",".prettierrc.json",".prettierrc.yaml",".prettierrc.yml","prettier.config.js","prettier.config.mjs","prettier.config.cjs"].some((Q)=>O(o.join(_.cwd(),Q))))$.push("Prettier")}if([".eslintrc",".eslintrc.js",".eslintrc.cjs",".eslintrc.mjs",".eslintrc.json",".eslintrc.yaml",".eslintrc.yml"].some((G)=>O(o.join(_.cwd(),G))))$.push("ESLint (legacy config)");if($.length>0)return{message:`Found potentially conflicting tools: ${$.join(", ")}`,name:U0,status:"warn"};return{message:"No conflicting formatting/linting tools found",name:U0,status:"pass"}},o2=(b)=>{let $=[];switch(b){case"biome":{$.push({fn:()=>G1("biome",!0),name:"Biome installation"},{fn:N2,name:H1});break}case"eslint":{$.push({fn:()=>G1("eslint",!0),name:"ESLint installation"},{fn:S2,name:V1},{fn:()=>G1("prettier",!0),name:"Prettier installation"},{fn:R2,name:W0},{fn:()=>G1("stylelint",!1),name:"Stylelint installation"},{fn:m2,name:Z0});break}case"oxlint":{$.push({fn:()=>G1("oxlint",!0),name:"Oxlint installation"},{fn:I2,name:X1},{fn:()=>G1("oxfmt",!0),name:"oxfmt installation"},{fn:u2,name:B1});break}default:break}return $.push({fn:()=>F2(b),name:Q1},{fn:()=>O2(b),name:U0}),$},h0=()=>{d2(`Ultracite v${z.version} Doctor`);let b=b1();if(!b)throw F.error("No linter configuration found. Run `ultracite init` to set up a linter."),T1(q1),Error("Doctor checks failed");F.info(`Detected linter: ${b}`);let $=x2();$.start("Running diagnostics...");let G=o2(b).map(({fn:U})=>U());$.stop("Diagnostics complete.");for(let U of G)if(U.status==="pass")F.success(U.message);else if(U.status==="warn")F.warn(U.message);else F.error(U.message);let Q=G.filter((U)=>U.status==="pass").length,W=G.filter((U)=>U.status==="fail").length,Z=G.filter((U)=>U.status==="warn").length;if(F.info(`Summary: ${Q} passed, ${Z} warnings, ${W} failed`),W>0)throw F.error("Some checks failed. Run 'ultracite init' to fix issues."),T1(q1),Error("Doctor checks failed");if(Z>0){F.warn("Some optional improvements available. Run 'ultracite init' to configure."),T1(q1);return}F.success("Everything looks good!"),T1(q1)};var _2=(b,$)=>{let y=F1();if(y)throw new l(O1(y));let G=["check","--write","--no-errors-on-unmatched",...$];if(b.length>0)G.push(...b);else G.push("./");let Q=A("biome",G,{stdio:"inherit"});d("Biome",Q)},T2=(b,$)=>{let y=["--fix",...$,...b.length>0?b:["."]],G=A("eslint",y,{stdio:"inherit"});d("ESLint",G)},q2=(b,$)=>{let y=["--write",...$,...b.length>0?b:["."]],G=A("prettier",y,{stdio:"inherit"});d("Prettier",G)},E2=(b,$)=>{let y=_1(b);if(y.length===0)return;let G=["--fix",...$,"--allow-empty-input",...y],Q=A("stylelint",G,{stdio:"inherit"});d("Stylelint",Q)},M2=(b,$)=>{let y=$.includes("--unsafe"),G=$.filter((Z)=>Z!=="--unsafe"),Q=[y?"--fix-dangerously":"--fix",...G,...b.length>0?b:["."]],W=A("oxlint",Q,{stdio:"inherit"});d("Oxlint",W)},p2=(b,$)=>{let y=["--write",...$,...b.length>0?b:["."]],G=A("oxfmt",y,{stdio:"inherit"});d("oxfmt",G)},c0=(b,$=[])=>{let y=b1(),G=o1(b);if(!y)throw Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(y){case"eslint":{y1([()=>q2(G,[]),()=>T2(G,$),()=>E2(G,[])]);break}case"oxlint":{y1([()=>p2(G,[]),()=>M2(G,$)]);break}default:_2(G,$)}};import U$ from"node:process";import{cancel as r,intro as v$,isCancel as s,log as R1,multiselect as v1,select as z$,spinner as D}from"@clack/prompts";import{addDevDependency as Y$,detectPackageManager as H$}from"nypm";import{readFile as h2}from"node:fs/promises";import{dlxCommand as c2}from"nypm";var v0=(b,$)=>`# Ultracite Code Standards
|
|
4
4
|
|
|
5
5
|
This project uses **Ultracite**, a zero-config preset that enforces strict code quality standards through automated formatting and linting.
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ This project uses **Ultracite**, a zero-config preset that enforces strict code
|
|
|
10
10
|
- **Check for issues**: \`${b} ultracite check\`
|
|
11
11
|
- **Diagnose setup**: \`${b} ultracite doctor\`
|
|
12
12
|
|
|
13
|
-
${
|
|
13
|
+
${$} (the underlying engine) provides robust linting and formatting. Most issues are automatically fixable.
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
@@ -109,11 +109,11 @@ Write code that is **accessible, performant, type-safe, and maintainable**. Focu
|
|
|
109
109
|
- Don't use \`.only\` or \`.skip\` in committed code
|
|
110
110
|
- Keep test suites reasonably flat - avoid excessive \`describe\` nesting
|
|
111
111
|
|
|
112
|
-
## When ${
|
|
112
|
+
## When ${$} Can't Help
|
|
113
113
|
|
|
114
|
-
${
|
|
114
|
+
${$}'s linter will catch most issues automatically. Focus your attention on:
|
|
115
115
|
|
|
116
|
-
1. **Business logic correctness** - ${
|
|
116
|
+
1. **Business logic correctness** - ${$} can't validate your algorithms
|
|
117
117
|
2. **Meaningful naming** - Use descriptive names for functions, variables, and types
|
|
118
118
|
3. **Architecture decisions** - Component structure, data flow, and API design
|
|
119
119
|
4. **Edge cases** - Handle boundary conditions and error states
|
|
@@ -122,20 +122,20 @@ ${y}'s linter will catch most issues automatically. Focus your attention on:
|
|
|
122
122
|
|
|
123
123
|
---
|
|
124
124
|
|
|
125
|
-
Most formatting and common issues are automatically fixed by ${
|
|
126
|
-
`;var
|
|
125
|
+
Most formatting and common issues are automatically fixed by ${$}. Run \`${b} ultracite fix\` before committing to ensure compliance.
|
|
126
|
+
`;var n=[{config:{appendMode:!0,path:".claude/CLAUDE.md"},hooks:{getContent:(b)=>({hooks:{PostToolUse:[{hooks:[{command:b,type:"command"}],matcher:"Write|Edit"}]}}),path:".claude/settings.json"},id:"claude",name:"Claude Code"},{config:{appendMode:!0,path:"AGENTS.md"},id:"codex",name:"Codex"},{config:{appendMode:!0,path:"AGENTS.md"},id:"jules",name:"Jules"},{config:{appendMode:!0,path:"replit.md"},id:"replit",name:"Replit Agent"},{config:{appendMode:!0,path:"AGENTS.md"},id:"devin",name:"Devin"},{config:{appendMode:!0,path:"AGENTS.md"},id:"lovable",name:"Lovable"},{config:{appendMode:!0,path:"AGENTS.md"},id:"zencoder",name:"Zencoder"},{config:{appendMode:!0,path:"AGENTS.md"},id:"ona",name:"Ona"},{config:{appendMode:!0,path:"AGENTS.md"},id:"openclaw",name:"OpenClaw"},{config:{appendMode:!0,path:"AGENTS.md"},id:"continue",name:"Continue"},{config:{appendMode:!0,path:"AGENTS.md"},id:"snowflake-cortex",name:"Snowflake Cortex"},{config:{appendMode:!0,path:"AGENTS.md"},id:"deepagents",name:"Deepagents"},{config:{appendMode:!0,path:"AGENTS.md"},id:"qoder",name:"Qoder"},{config:{appendMode:!0,path:"AGENTS.md"},id:"kimi-cli",name:"Kimi CLI"},{config:{appendMode:!0,path:"AGENTS.md"},id:"mcpjam",name:"MCPJam"},{config:{appendMode:!0,path:"AGENTS.md"},id:"mux",name:"Mux"},{config:{appendMode:!0,path:"AGENTS.md"},id:"pi",name:"Pi"},{config:{appendMode:!0,path:"AGENTS.md"},id:"adal",name:"AdaL"},{config:{appendMode:!0,path:"AGENTS.md"},hooks:{getContent:(b)=>({hooks:{PostToolUse:[{command:b,type:"command"}]}}),path:".github/hooks/ultracite.json"},id:"copilot",name:"GitHub Copilot"},{config:{appendMode:!0,path:"AGENTS.md"},id:"cline",name:"Cline"},{config:{appendMode:!0,path:"AGENTS.md"},id:"amp",name:"AMP"},{config:{path:"ultracite.md"},id:"aider",name:"Aider"},{config:{appendMode:!0,path:"AGENTS.md"},id:"firebase-studio",name:"Firebase Studio"},{config:{appendMode:!0,path:"AGENTS.md"},id:"open-hands",name:"OpenHands"},{config:{appendMode:!0,path:"GEMINI.md"},id:"gemini",name:"Gemini"},{config:{appendMode:!0,path:"AGENTS.md"},id:"junie",name:"Junie"},{config:{appendMode:!0,path:"AGENTS.md"},id:"augmentcode",name:"Augment Code"},{config:{appendMode:!0,path:"AGENTS.md"},id:"bob",name:"IBM Bob"},{config:{appendMode:!0,path:"AGENTS.md"},id:"kilo-code",name:"Kilo Code"},{config:{appendMode:!0,path:"AGENTS.md"},id:"goose",name:"Goose"},{config:{appendMode:!0,path:".roo/rules/ultracite.md"},id:"roo-code",name:"Roo Code"},{config:{appendMode:!0,path:"AGENTS.md"},id:"warp",name:"Warp"},{config:{appendMode:!0,path:"AGENTS.md"},id:"droid",name:"Droid"},{config:{appendMode:!0,path:"AGENTS.md"},id:"opencode",name:"OpenCode"},{config:{appendMode:!0,path:"AGENTS.md"},id:"crush",name:"Crush"},{config:{appendMode:!0,path:"AGENTS.md"},id:"qwen",name:"Qwen Code"},{config:{appendMode:!0,path:".amazonq/rules/ultracite.md"},id:"amazon-q-cli",name:"Amazon Q CLI"},{config:{path:"firebender.json"},id:"firebender",name:"Firebender"},{config:{appendMode:!0,path:"AGENTS.md"},id:"cursor-cli",name:"Cursor CLI"},{config:{appendMode:!0,path:"AGENTS.md"},id:"mistral-vibe",name:"Mistral Vibe"},{config:{appendMode:!0,path:"AGENTS.md"},id:"vercel",name:"Vercel Agent"}];var M1=[{id:"biome",name:"Biome",vscodeExtensionId:"biomejs.biome"},{id:"eslint",name:"ESLint + Prettier + Stylelint",vscodeExtensionId:"dbaeumer.vscode-eslint"},{id:"oxlint",name:"Oxlint + Oxfmt",vscodeExtensionId:"oxc.oxc-vscode"}];var P0=(b)=>b.replace(/ Code$/u,"").replace(/ Agent$/u,""),P2=(b,$)=>{if(b==="AGENTS.md"&&$.length>1){let G=$.slice(0,3),Q=$.length>G.length?", and more":"";return`Universal (creates ${b} for ${G.join(", ")}${Q})`}let[y]=$;return`${y} (creates ${b})`},f0=()=>{let b=new Map;for(let y of n){let G=b.get(y.config.path)??[];G.push(y),b.set(y.config.path,G)}return[...b.entries()].map(([y,G])=>{let[Q]=G,W=G.map((U)=>P0(U.name)),Z=y==="AGENTS.md"&&G.length>1;return{agentIds:G.map((U)=>U.id),displayName:Z?"Universal":P0(Q.name),id:Z?"universal":Q.id,path:y,promptLabel:P2(y,W),representativeAgentId:Q.id}}).toSorted((y,G)=>{if(y.path==="AGENTS.md")return-1;if(G.path==="AGENTS.md")return 1;return 0})},k0=(b,$,y)=>{let G=n.find((H)=>H.id===b);if(!G)throw Error(`Agent "${b}" not found`);let Q=M1.find((H)=>H.id===y);if(!Q)throw Error(`Provider "${y}" not found`);let W=c2($,""),Z=v0(W,Q.name),U=G.config.header?`${G.config.header}
|
|
127
127
|
|
|
128
|
-
${
|
|
128
|
+
${Z}`:Z;return{create:async()=>{R(G.config.path),await v(G.config.path,U)},exists:()=>V(G.config.path),update:async()=>{R(G.config.path);let H=V(G.config.path);if(!(G.config.appendMode&&H)){await v(G.config.path,U);return}let B=await h2(G.config.path,"utf-8");if(B.includes(Z.trim()))return;await v(G.config.path,`${B}
|
|
129
129
|
|
|
130
|
-
${
|
|
131
|
-
`)},exists:()=>
|
|
132
|
-
`);return}let
|
|
133
|
-
`)}}};var
|
|
134
|
-
`);return}let
|
|
135
|
-
`)}};return{create:async()=>{
|
|
136
|
-
`)},exists:()=>
|
|
130
|
+
${Z}`)}}};import W1 from"deepmerge";var p1={"editor.defaultFormatter":"esbenp.prettier-vscode","editor.formatOnPaste":!0,"editor.formatOnSave":!0,"emmet.showExpandedAbbreviation":"never","js/ts.tsdk.path":"node_modules/typescript/lib","js/ts.tsdk.promptToUseWorkspaceVersion":!0},f2="astro-build.astro-vscode",x="biomejs.biome",j="oxc.oxc-vscode",T="code --install-extension",q=".vscode/settings.json",k2={"[css]":{"editor.defaultFormatter":x},"[graphql]":{"editor.defaultFormatter":x},"[html]":{"editor.defaultFormatter":x},"[javascript]":{"editor.defaultFormatter":x},"[javascriptreact]":{"editor.defaultFormatter":x},"[json]":{"editor.defaultFormatter":x},"[jsonc]":{"editor.defaultFormatter":x},"[markdown]":{"editor.defaultFormatter":x},"[mdx]":{"editor.defaultFormatter":x},"[svelte]":{"editor.defaultFormatter":x},"[typescript]":{"editor.defaultFormatter":x},"[typescriptreact]":{"editor.defaultFormatter":x},"[vue]":{"editor.defaultFormatter":x},"[yaml]":{"editor.defaultFormatter":x},"editor.codeActionsOnSave":{"source.fixAll.biome":"explicit","source.organizeImports.biome":"explicit"}},C2={"[astro]":{"editor.defaultFormatter":f2},"[css]":{"editor.defaultFormatter":j},"[graphql]":{"editor.defaultFormatter":j},"[handlebars]":{"editor.defaultFormatter":j},"[html]":{"editor.defaultFormatter":j},"[javascript]":{"editor.defaultFormatter":j},"[javascriptreact]":{"editor.defaultFormatter":j},"[json]":{"editor.defaultFormatter":j},"[jsonc]":{"editor.defaultFormatter":j},"[less]":{"editor.defaultFormatter":j},"[markdown]":{"editor.defaultFormatter":j},"[scss]":{"editor.defaultFormatter":j},"[typescript]":{"editor.defaultFormatter":j},"[typescriptreact]":{"editor.defaultFormatter":j},"[vue-html]":{"editor.defaultFormatter":j},"[vue]":{"editor.defaultFormatter":j},"[yaml]":{"editor.defaultFormatter":j},"editor.codeActionsOnSave":{"source.fixAll.oxc":"explicit"}},l2={"editor.codeActionsOnSave":{"source.fixAll.eslint":"explicit","source.organizeImports":"explicit"}},E=(b="biome")=>{switch(b){case"biome":return W1(p1,k2);case"eslint":return W1(p1,l2);case"oxlint":return W1(p1,C2);default:return p1}},h1={format_on_save:"on",formatter:"language_server",lsp:{"typescript-language-server":{settings:{typescript:{preferences:{includePackageJsonAutoImports:"on"}}}}}},n2={languages:{JavaScript:{code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0},formatter:{language_server:{name:"biome"}}},TSX:{code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0},formatter:{language_server:{name:"biome"}}},TypeScript:{code_actions_on_format:{"source.fixAll.biome":!0,"source.organizeImports.biome":!0},formatter:{language_server:{name:"biome"}}}}},r2={languages:{JavaScript:{code_actions_on_format:{"source.fixAll.eslint":!0,"source.organizeImports.eslint":!0},formatter:{language_server:{name:"eslint"}}},TSX:{code_actions_on_format:{"source.fixAll.eslint":!0,"source.organizeImports.eslint":!0},formatter:{language_server:{name:"eslint"}}},TypeScript:{code_actions_on_format:{"source.fixAll.eslint":!0,"source.organizeImports.eslint":!0},formatter:{language_server:{name:"eslint"}}}}},s2={languages:{JavaScript:{code_actions_on_format:{"source.fixAll.oxc":!0,"source.organizeImports.oxc":!0},formatter:{language_server:{name:"oxfmt"}}},TSX:{code_actions_on_format:{"source.fixAll.oxc":!0,"source.organizeImports.oxc":!0},formatter:{language_server:{name:"oxfmt"}}},TypeScript:{code_actions_on_format:{"source.fixAll.oxc":!0,"source.organizeImports.oxc":!0},formatter:{language_server:{name:"oxfmt"}}}},lsp:{oxfmt:{initialization_options:{settings:{configPath:null,flags:{},"fmt.configPath":null,"fmt.experimental":!0,run:"onSave",typeAware:!1,unusedDisableDirectives:!1}}},oxlint:{initialization_options:{settings:{disableNestedConfig:!1,fixKind:"safe_fix",run:"onType",typeAware:!0,unusedDisableDirectives:"deny"}}}}},i2=(b="biome")=>{switch(b){case"biome":return W1(h1,n2);case"eslint":return W1(h1,r2);case"oxlint":return W1(h1,s2);default:return h1}},P=[{config:{extensionCommand:T,getContent:E,path:q},id:"vscode",name:"Visual Studio Code"},{config:{extensionCommand:T,getContent:E,path:q},hooks:{getContent:(b)=>({hooks:{afterFileEdit:[{command:b}]},version:1}),path:".cursor/hooks.json"},id:"cursor",name:"Cursor"},{config:{extensionCommand:T,getContent:E,path:q},hooks:{getContent:(b)=>({hooks:{post_write_code:[{command:b,show_output:!0}]}}),path:".windsurf/hooks.json"},id:"windsurf",name:"Windsurf"},{config:{extensionCommand:T,getContent:E,path:q},hooks:{getContent:(b)=>({hooks:{PostToolUse:[{hooks:[{command:b,timeout:20,type:"command"}],matcher:"Write|Edit"}]}}),path:".codebuddy/settings.json"},id:"codebuddy",name:"CodeBuddy"},{config:{extensionCommand:T,getContent:E,path:q},id:"antigravity",name:"Antigravity"},{config:{extensionCommand:T,getContent:E,path:q},id:"bob",name:"IBM Bob"},{config:{extensionCommand:T,getContent:E,path:q},id:"kiro",name:"Kiro"},{config:{extensionCommand:T,getContent:E,path:q},id:"trae",name:"Trae"},{config:{extensionCommand:T,getContent:E,path:q},id:"void",name:"Void"},{config:{getContent:i2,path:".zed/settings.json"},id:"zed",name:"Zed"}];var g2=(b)=>Boolean(b.hooks),t2=(b)=>Boolean(b.hooks),a2=()=>P.flatMap((b)=>g2(b)?[{hooks:b.hooks,id:b.id,name:b.name}]:[]),e2=()=>n.flatMap((b)=>t2(b)?[{hooks:b.hooks,id:b.id,name:b.name}]:[]),K1=[...a2(),...e2()];import{readFile as b4}from"node:fs/promises";import{sync as $4}from"cross-spawn";import y4 from"deepmerge";import{parse as G4}from"jsonc-parser";var C0=(b,$="biome")=>{let y=P.find((Q)=>Q.id===b);if(!y)throw Error(`Editor "${b}" not found`);let G=y.config.getContent($);return{create:async()=>{R(y.config.path),await v(y.config.path,`${JSON.stringify(G,null,2)}
|
|
131
|
+
`)},exists:()=>V(y.config.path),extension:y.config.extensionCommand?(Q)=>{let[W,...Z]=y.config.extensionCommand.split(" ");return $4(W,[...Z,Q],{stdio:"pipe"})}:void 0,update:async()=>{if(R(y.config.path),!V(y.config.path)){await v(y.config.path,`${JSON.stringify(G,null,2)}
|
|
132
|
+
`);return}let W=await b4(y.config.path,"utf-8"),U=G4(W)||{},H=y4(U,G);await v(y.config.path,`${JSON.stringify(H,null,2)}
|
|
133
|
+
`)}}};var Q4=(b,$)=>{if($.length>1){let G=$.slice(0,3),Q=$.length>G.length?", and more":"";return`Universal (creates ${b} for ${G.join(", ")}${Q})`}let[y]=$;return`${y} (creates ${b})`},l0=()=>{let b=new Map;for(let y of P){let G=b.get(y.config.path)??[];G.push(y),b.set(y.config.path,G)}return[...b.entries()].map(([y,G])=>{let[Q]=G,W=G.map((U)=>U.name),Z=G.length>1;return{displayName:Z?"Universal":Q.name,editorIds:G.map((U)=>U.id),id:Z?"universal":Q.id,path:y,promptLabel:Q4(y,W),representativeEditorId:Q.id}}).toSorted((y,G)=>{if(y.id==="universal")return-1;if(G.id==="universal")return 1;return 0})};import{readFile as Z4}from"node:fs/promises";import U4 from"deepmerge";import{parse as v4}from"jsonc-parser";import{runScriptCommand as z4}from"nypm";var n0=["npm","yarn","pnpm","bun","deno"],W4=(b)=>n0.includes(b),w1=(b)=>{if(W4(b))return b;throw Error(`Unsupported package manager "${b}". Supported package managers: ${n0.join(", ")}.`)},r0=(b)=>{let $=w1(b.name);return{...b,command:$,name:$}};var Y4=(b)=>typeof b==="object"&&b!==null&&!Array.isArray(b),H4=(b,$=[])=>{let y=w1(b),G=y==="npm"&&$.length>0?["--",...$]:$;return z4(y,"fix",{args:G})},s0=(b,$,y="biome")=>{let G=K1.find((B)=>B.id===b);if(!G)throw Error(`Hook integration "${b}" not found`);let W=H4($,y==="biome"?["--skip=correctness/noUnusedImports"]:[]),Z=G.hooks.getContent(W),U=(B)=>{let w=JSON.stringify(B);return w.includes("ultracite")||w.includes(W)},H=async()=>{if(!V(G.hooks.path)){await v(G.hooks.path,`${JSON.stringify(Z,null,2)}
|
|
134
|
+
`);return}let w=await Z4(G.hooks.path,"utf-8"),S=v4(w),J=Y4(S)?S:{};if(!U(J)){let M=U4(J,Z);await v(G.hooks.path,`${JSON.stringify(M,null,2)}
|
|
135
|
+
`)}};return{create:async()=>{R(G.hooks.path),await v(G.hooks.path,`${JSON.stringify(Z,null,2)}
|
|
136
|
+
`)},exists:()=>V(G.hooks.path),update:async()=>{R(G.hooks.path),await H()}}};import{mkdir as V4,readFile as X4}from"node:fs/promises";import{addDevDependency as B4,dlxCommand as A1}from"nypm";var i0=(b)=>`#!/bin/sh
|
|
137
137
|
${b}
|
|
138
|
-
`,
|
|
138
|
+
`,g0=(b)=>`#!/bin/sh
|
|
139
139
|
# Check if there are any staged files
|
|
140
140
|
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACMR)
|
|
141
141
|
if [ -z "$STAGED_FILES" ]; then
|
|
@@ -160,18 +160,18 @@ if [ $FORMAT_EXIT_CODE -ne 0 ]; then
|
|
|
160
160
|
fi
|
|
161
161
|
|
|
162
162
|
echo "✨ Files formatted by Ultracite"
|
|
163
|
-
`,
|
|
164
|
-
${b}${
|
|
165
|
-
`)},exists:()=>
|
|
166
|
-
`),
|
|
167
|
-
`),
|
|
168
|
-
`).replace(/^\n+/u,"").replace(/\n+$/u,""),
|
|
163
|
+
`,J1="./.husky/pre-commit",Y0="# ultracite",t0="# ultracite end",z0=(b)=>`${Y0}
|
|
164
|
+
${b}${t0}`,K4=(b,$)=>{let y=b.indexOf(t0,$+1);if(y!==-1)return y+1;let G=b.findIndex((Q,W)=>W>$&&Q.includes("Files formatted by Ultracite"));if(G!==-1)return G+1;return b.length},Z1={create:async(b,$=!1)=>{await V4(".husky",{recursive:!0});let y;if($){let G=A1(b,"lint-staged",{short:b==="npm"});y=i0(G)}else{let G=A1(b,"ultracite",{args:["fix"],short:b==="npm"});y=g0(G)}await v(J1,`${z0(y)}
|
|
165
|
+
`)},exists:()=>V(J1),init:(b)=>{let[$,...y]=A1(b,"husky",{args:["init"]}).split(" "),G=A($,y,{stdio:"pipe"});if(G.error||G.status!==null&&G.status!==0);},install:async(b)=>{await B4("husky",{corepack:!1,packageManager:b,silent:!0,workspace:c()&&b.name!=="npm"}),await N({scripts:{prepare:"husky"}})},update:async(b,$=!1)=>{let y=await X4(J1,"utf-8"),G;if($){let Q=A1(b,"lint-staged",{short:b==="npm"});G=i0(Q)}else{let Q=A1(b,"ultracite",{args:["fix"],short:b==="npm"});G=g0(Q)}if(y.includes(Y0)){let Q=y.split(`
|
|
166
|
+
`),W=Q.indexOf(Y0),Z=K4(Q,W),U=Q.slice(0,W).join(`
|
|
167
|
+
`),H=Q.slice(Z).join(`
|
|
168
|
+
`).replace(/^\n+/u,"").replace(/\n+$/u,""),B=[U,z0(G),H].filter((w)=>w!=="");await v(J1,`${B.join(`
|
|
169
169
|
`)}
|
|
170
|
-
`)}else{let
|
|
171
|
-
${
|
|
172
|
-
`)}}};import{execSync as
|
|
170
|
+
`)}else{let Q=y.replace(/\n+$/u,"");await v(J1,`${Q}
|
|
171
|
+
${z0(G)}
|
|
172
|
+
`)}}};import{execSync as w4}from"node:child_process";import{readFile as A4}from"node:fs/promises";import{addDevDependency as J4,dlxCommand as e0}from"nypm";var j4=/(?<preCommitJobs>pre-commit:\s*\n\s*jobs:\s*\n)/u,D4=/(?<preCommit>pre-commit:\s*\n)/u,bb=(b)=>e0(b,"ultracite",{args:["fix"],short:b==="npm"}),U1="./lefthook.yml",a0=(b)=>`pre-commit:
|
|
173
173
|
jobs:
|
|
174
|
-
- run: ${
|
|
174
|
+
- run: ${bb(b)}
|
|
175
175
|
glob:
|
|
176
176
|
- "**/*.js"
|
|
177
177
|
- "**/*.jsx"
|
|
@@ -181,7 +181,7 @@ ${$0(G)}
|
|
|
181
181
|
- "**/*.jsonc"
|
|
182
182
|
- "**/*.css"
|
|
183
183
|
stage_fixed: true
|
|
184
|
-
`,
|
|
184
|
+
`,j1={create:async(b)=>{let $=a0(b);await v(U1,$)},exists:()=>V(U1),install:async(b)=>{await J4("lefthook",{corepack:!1,packageManager:b,silent:!0,workspace:c()&&b.name!=="npm"}),await N({scripts:{prepare:"lefthook install"}});let $=e0(b.name,"lefthook",{args:["install"],short:b.name==="npm"});try{w4($,{stdio:"pipe"})}catch{}},update:async(b)=>{let $=await A4(U1,"utf-8"),y=bb(b),G=a0(b);if($.includes(y))return;if($.startsWith("# EXAMPLE USAGE:")){await v(U1,G);return}if($.includes("pre-commit:")){let W;if($.includes("jobs:")){let Z=` - run: ${y}
|
|
185
185
|
glob:
|
|
186
186
|
- "**/*.js"
|
|
187
187
|
- "**/*.jsx"
|
|
@@ -190,9 +190,9 @@ ${$0(G)}
|
|
|
190
190
|
- "**/*.json"
|
|
191
191
|
- "**/*.jsonc"
|
|
192
192
|
- "**/*.css"
|
|
193
|
-
stage_fixed: true`;
|
|
194
|
-
`)}else{let
|
|
195
|
-
- run: ${
|
|
193
|
+
stage_fixed: true`;W=$.replace(j4,`$<preCommitJobs>${Z}
|
|
194
|
+
`)}else{let Z=` jobs:
|
|
195
|
+
- run: ${y}
|
|
196
196
|
glob:
|
|
197
197
|
- "**/*.js"
|
|
198
198
|
- "**/*.jsx"
|
|
@@ -201,63 +201,85 @@ ${$0(G)}
|
|
|
201
201
|
- "**/*.json"
|
|
202
202
|
- "**/*.jsonc"
|
|
203
203
|
- "**/*.css"
|
|
204
|
-
stage_fixed: true`;
|
|
205
|
-
`)}await
|
|
206
|
-
${G}`)}};import{readFile as
|
|
207
|
-
`)},
|
|
208
|
-
`)},
|
|
209
|
-
`;await
|
|
210
|
-
`;await
|
|
211
|
-
`)},
|
|
212
|
-
`)},exists:async()=>{if(await
|
|
204
|
+
stage_fixed: true`;W=$.replace(D4,`$<preCommit>${Z}
|
|
205
|
+
`)}await v(U1,W)}else await v(U1,`${$}
|
|
206
|
+
${G}`)}};import{readFile as D1}from"node:fs/promises";import{pathToFileURL as Qb}from"node:url";import d1 from"deepmerge";import{parse as d4}from"jsonc-parser";import{addDevDependency as x4,dlxCommand as L4}from"nypm";import $b from"yaml";var c1="./package.json",f=(b)=>({"*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}":[L4(b,"ultracite",{args:["fix"],short:b==="npm"})]}),yb=["./.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"],x1=(b)=>JSON.stringify(b).includes("ultracite"),Gb=async()=>{try{let b=await D1(c1,"utf-8");return g(b)?.["lint-staged"]}catch{return}},N4=async()=>{try{let b=await D1(c1,"utf-8");return g(b)?.type==="module"}catch{return!1}},S4=async(b)=>{let $=await D1(c1,"utf-8"),y=g($);if(!y)return;if(x1(y["lint-staged"]))return;y["lint-staged"]=y["lint-staged"]?d1(y["lint-staged"],f(b)):f(b),await v(c1,`${JSON.stringify(y,null,2)}
|
|
207
|
+
`)},R4=async(b,$)=>{let y=await D1(b,"utf-8"),G=d4(y);if(!G)return;if(x1(G))return;let Q=d1(G,f($));await v(b,`${JSON.stringify(Q,null,2)}
|
|
208
|
+
`)},m4=(b)=>b.replaceAll(/^(?<key>[*?{[][^\n:]*):(?<rest>.*)$/gmu,($,y,G)=>`'${y}':${G}`),I4=async(b,$)=>{let y=await D1(b,"utf-8"),G=m4(y),Q;try{Q=$b.parse(G)}catch{return}if(!Q)return;if(x1(Q))return;let W=d1(Q,f($));await v(b,$b.stringify(W))},u4=async(b,$)=>{let Q=(await import(Qb(b).href)).default||{};if(x1(Q))return;let W=d1(Q,f($)),Z=`export default ${JSON.stringify(W,null,2)};
|
|
209
|
+
`;await v(b,Z)},F4=async(b,$)=>{let G=await import(`${Qb(b).href}?t=${Date.now()}`),Q=G.default||G;if(x1(Q))return;let W=d1(Q,f($)),Z=`module.exports = ${JSON.stringify(W,null,2)};
|
|
210
|
+
`;await v(b,Z)},H0=async(b)=>{await v(".lintstagedrc.json",`${JSON.stringify(f(b),null,2)}
|
|
211
|
+
`)},O4=async(b,$)=>{if(b.endsWith(".json")||b==="./.lintstagedrc"){await R4(b,$);return}if(b.endsWith(".yaml")||b.endsWith(".yml")){await I4(b,$);return}let y=await N4();if(b.endsWith(".mjs")||b.endsWith(".js")&&y){try{await u4(b,$)}catch{await H0($)}return}if(b.endsWith(".cjs")||b.endsWith(".js")&&!y)try{await F4(b,$)}catch{await H0($)}},L1={create:async(b)=>{await v(".lintstagedrc.json",`${JSON.stringify(f(b),null,2)}
|
|
212
|
+
`)},exists:async()=>{if(await Gb())return!0;return yb.some((b)=>V(b))},install:async(b)=>{await x4("lint-staged",{corepack:!1,packageManager:b,silent:!0,workspace:c()&&b.name!=="npm"})},update:async(b)=>{if(await Gb()){await S4(b);return}let $=yb.find((y)=>V(y));if(!$){await H0(b);return}await O4($,b)}};import{readFile as o4}from"node:fs/promises";import{dlxCommand as _4}from"nypm";var N1="./.pre-commit-config.yaml",T4=/^repos:\s*\n/mu,Wb=(b)=>_4(b,"ultracite",{args:["fix"],short:b==="npm"}),q4=(b)=>`repos:
|
|
213
213
|
- repo: local
|
|
214
214
|
hooks:
|
|
215
215
|
- id: ultracite
|
|
216
216
|
name: ultracite
|
|
217
|
-
entry: ${
|
|
217
|
+
entry: ${Wb(b)}
|
|
218
218
|
language: system
|
|
219
219
|
types_or: [javascript, jsx, ts, tsx, json, css]
|
|
220
220
|
pass_filenames: false
|
|
221
|
-
`,
|
|
221
|
+
`,P1={create:async(b)=>{let $=q4(b);await v(N1,$)},exists:()=>V(N1),update:async(b)=>{let $=await o4(N1,"utf-8"),y=Wb(b);if($.includes("id: ultracite"))return;let G=` - repo: local
|
|
222
222
|
hooks:
|
|
223
223
|
- id: ultracite
|
|
224
224
|
name: ultracite
|
|
225
|
-
entry: ${
|
|
225
|
+
entry: ${y}
|
|
226
226
|
language: system
|
|
227
227
|
types_or: [javascript, jsx, ts, tsx, json, css]
|
|
228
228
|
pass_filenames: false
|
|
229
|
-
`;if(
|
|
230
|
-
${G}`);await
|
|
229
|
+
`;if($.includes("repos:")){let Q=$.replace(T4,`repos:
|
|
230
|
+
${G}`);await v(N1,Q)}else await v(N1,`${$}
|
|
231
231
|
repos:
|
|
232
|
-
${G}`)}};import{readFile as
|
|
233
|
-
`)},exists:()=>{let b=
|
|
234
|
-
`)}};var
|
|
232
|
+
${G}`)}};import{readFile as E4}from"node:fs/promises";import M4 from"deepmerge";var X0="ultracite/biome/core",Zb={$schema:"./node_modules/@biomejs/biome/configuration_schema.json",extends:[X0]},p4=/^ultracite\/(?!biome\/)(?<rest>.+)$/u,V0=()=>{for(let b of I)if(V(`./${b}`))return`./${b}`;return"./biome.jsonc"},f1={create:(b)=>{let $=V0(),y=[X0];if(b?.typeAware)y.push("ultracite/biome/type-aware");if(b?.frameworks&&b.frameworks.length>0)for(let Q of b.frameworks){let W=m(Q);y.push(`ultracite/biome/${W}`)}let G={...Zb,extends:y};return v($,`${JSON.stringify(G,null,2)}
|
|
233
|
+
`)},exists:()=>{let b=V0();return V(b)},update:async(b)=>{let $=V0(),y=await E4($,"utf-8"),Q=I1(y,N0)||{},Z=(Q.extends??[]).map((J)=>{let M=p4.exec(J);return M?`ultracite/biome/${M[1]}`:J}),U=[...new Set(Z)],H=new Set(U),B=(J)=>{if(!H.has(J))H.add(J),U.push(J)};if(B(X0),b?.typeAware)B("ultracite/biome/type-aware");if(b?.frameworks&&b.frameworks.length>0)for(let J of b.frameworks)B(`ultracite/biome/${m(J)}`);Q.extends=U;let w={$schema:Zb.$schema},S=M4(Q,w);await v($,`${JSON.stringify(S,null,2)}
|
|
234
|
+
`)}};var h4=C.map((b)=>`./${b}`),Ub="./eslint.config.mjs",vb=()=>{for(let b of h4)if(V(b))return b;return null},zb=(b)=>{let $=['import core from "ultracite/eslint/core";'],y=["...core"];if(b?.frameworks&&b.frameworks.length>0)for(let G of b.frameworks){let Q=m(G);$.push(`import ${Q} from "ultracite/eslint/${Q}";`),y.push(`...${Q}`)}return`${$.join(`
|
|
235
235
|
`)}
|
|
236
236
|
|
|
237
237
|
export default [
|
|
238
|
-
${
|
|
238
|
+
${y.join(`,
|
|
239
239
|
`)},
|
|
240
240
|
];
|
|
241
|
-
`},
|
|
241
|
+
`},k1={create:async(b)=>{let $=zb(b);await v(Ub,$)},exists:()=>{return vb()!==null},update:async(b)=>{let $=zb(b);await v(vb()??Ub,$)}};var B0="./oxfmt.config.ts",Yb=`import { defineConfig } from "oxfmt";
|
|
242
242
|
import ultracite from "ultracite/oxfmt";
|
|
243
243
|
|
|
244
244
|
export default defineConfig({
|
|
245
245
|
...ultracite,
|
|
246
246
|
});
|
|
247
|
-
`,
|
|
248
|
-
|
|
249
|
-
|
|
247
|
+
`,C1={create:async()=>await v(B0,Yb),exists:()=>V(B0),update:async()=>await v(B0,Yb)};import{readFile as c4}from"node:fs/promises";var l1="./oxlint.config.ts";var Hb={"eslint-plugin-github":{name:"github",rulePrefix:"github"},"eslint-plugin-sonarjs":{name:"sonarjs",rulePrefix:"sonarjs"},"oxlint-plugin-react-doctor":{name:"react-doctor",rulePrefix:"react-doctor"}},S1=(b)=>`ultracite/oxlint/${b}`,Vb=(b)=>{return(b.split("/").pop()??b).replaceAll(/-(?<letter>[a-z])/gu,(y,G)=>G.toUpperCase())},P4=(b)=>{if(b.length===0)return"";let $=b.map((G)=>Hb[G].name),y=b.map((G)=>Hb[G].rulePrefix);return`
|
|
248
|
+
const selectedJsPluginNames = new Set(${JSON.stringify($)});
|
|
249
|
+
const selectedJsPluginRulePrefixes = new Set(${JSON.stringify(y)});
|
|
250
|
+
|
|
251
|
+
const selectedJsPlugins = {
|
|
252
|
+
...jsPlugins,
|
|
253
|
+
jsPlugins: jsPlugins.jsPlugins?.filter((plugin) =>
|
|
254
|
+
selectedJsPluginNames.has(plugin.name)
|
|
255
|
+
),
|
|
256
|
+
overrides: jsPlugins.overrides?.map((override) => ({
|
|
257
|
+
...override,
|
|
258
|
+
rules: Object.fromEntries(
|
|
259
|
+
Object.entries(override.rules ?? {}).filter(([ruleName]) =>
|
|
260
|
+
selectedJsPluginRulePrefixes.has(ruleName.split("/")[0] ?? ruleName)
|
|
261
|
+
)
|
|
262
|
+
),
|
|
263
|
+
})),
|
|
264
|
+
rules: Object.fromEntries(
|
|
265
|
+
Object.entries(jsPlugins.rules ?? {}).filter(([ruleName]) =>
|
|
266
|
+
selectedJsPluginRulePrefixes.has(ruleName.split("/")[0] ?? ruleName)
|
|
267
|
+
)
|
|
268
|
+
),
|
|
269
|
+
};
|
|
270
|
+
`},Xb=(b,$=[])=>{let y=$.length>0,G=['import { defineConfig } from "oxlint";',...b.map((W)=>`import ${Vb(W)} from "${W}";`),y?'import jsPlugins from "ultracite/oxlint/js-plugins";':""].filter(Boolean).join(`
|
|
271
|
+
`),Q=[...b.map((W)=>Vb(W)),...y?["selectedJsPlugins"]:[]].join(", ");return`${G}${P4($)}
|
|
250
272
|
export default defineConfig({
|
|
251
|
-
extends: [${
|
|
273
|
+
extends: [${Q}],
|
|
252
274
|
ignorePatterns: core.ignorePatterns,
|
|
253
275
|
});
|
|
254
|
-
`},
|
|
276
|
+
`},n1={create:async(b)=>{let $=[S1("core")];if(b?.frameworks&&b.frameworks.length>0)for(let y of b.frameworks){let G=m(y);$.push(S1(G))}return await v(l1,Xb($,b?.jsPlugins))},exists:()=>V(l1),update:async(b)=>{let $=await c4(l1,"utf-8"),y=[],G=$.matchAll(/import \w+ from ["'](?<source>[^"']+)["']/gu);for(let Z of G)if(Z[1].startsWith("ultracite/oxlint/"))y.push(Z[1].replace(/\/index\.[tj]s$/u,""));if(y.length===0){let Z=$.match(/extends:\s*\[(?<body>[\s\S]*?)\]/u);if(Z?.[1]){let U=Z[1].matchAll(/"(?<value>[^"]+)"/gu);for(let H of U){let B=H[1].replace(/^\.\/node_modules\/ultracite\/config\/oxlint\//u,"ultracite/oxlint/");y.push(B)}}}if(y.length===0&&$.includes("ultracite/oxlint"))console.warn("Warning: could not parse existing extends from oxlint.config.ts. The file will be regenerated.");let Q=(Z)=>y.some((U)=>U===S1(Z)),W=[...y];if(!Q("core"))W.push(S1("core"));if(b?.frameworks&&b.frameworks.length>0)for(let Z of b.frameworks){let U=m(Z);if(!Q(U))W.push(S1(U))}await v(l1,Xb(W,b?.jsPlugins))}};var w0="./package.json",f4=a.map((b)=>`./${b}`),K0="./prettier.config.mjs",k4=()=>{return h(w0)?.prettier!==void 0},Bb=()=>{if(k4())return w0;for(let b of f4)if(V(b))return b;return null},Kb={astro:"prettier-plugin-astro",svelte:"prettier-plugin-svelte"},wb=(b)=>{let $=[];if(b?.frameworks)for(let y of b.frameworks){let G=m(y);if(G in Kb)$.push(Kb[G])}return $.push("prettier-plugin-tailwindcss"),`import config from "ultracite/prettier";
|
|
255
277
|
|
|
256
278
|
export default {
|
|
257
279
|
...config,
|
|
258
|
-
plugins: [${
|
|
280
|
+
plugins: [${$.map((y)=>`"${y}"`).join(", ")}],
|
|
259
281
|
};
|
|
260
|
-
`},
|
|
261
|
-
`,
|
|
262
|
-
`);return}let
|
|
263
|
-
`),!0},C2=async(b,y=!1)=>{let $=J();if(!y)$.start("Checking for stale linter configuration...");let G=new Set;if(b!=="biome")for(let W of p)G.add(W);if(b!=="eslint"){for(let W of P)G.add(W);for(let W of n)G.add(W);for(let W of i)G.add(W)}for(let W of d0)G.add(W);if(b!=="oxlint"){for(let W of g1)G.add(W);for(let W of o0)G.add(W)}let[v,U]=await Promise.all([Promise.all([...G].map((W)=>r2(W))),l2(b)]),Q=v.some(Boolean)||U;if(!y)$.stop(Q?"Stale linter configuration migrated.":"No stale linter configuration found.")},s2=async(b,y="biome",$=!0,G=!1,v=!1,U=["react"])=>{let Q=J();if(!G)Q.start("Installing dependencies...");let W=[`ultracite@${V0}`];if(y==="biome")W.push(`@biomejs/biome@${Bb}`);if(y==="eslint")W.push(...Object.entries(wb(U)).map(([V,K])=>`${V}@${K}`));if(y==="oxlint"){if(W.push("oxlint@latest","oxfmt@latest"),v)W.push("oxlint-tsgolint@latest")}let X={check:"ultracite check",fix:"ultracite fix"};if($)await c2(W,{corepack:!1,packageManager:b,silent:!0,workspace:M()&&b.name!=="npm"}),await N({scripts:X});else{let V=P2(y,v,U);await N({devDependencies:V,scripts:X})}if(!G)Q.stop("Dependencies installed.")},n2=async(b=!1)=>{let y=J();if(!b)y.start("Checking for tsconfig.json files...");if(await X0.exists()){if(!b)y.message("Found tsconfig.json files, updating with strictNullChecks...");if(await X0.update(),!b)y.stop("tsconfig.json files updated.");return}if(!b)y.stop("No tsconfig.json files found, skipping.")},Kb=async(b,y="biome",$=!1)=>{let G=c.find((Q)=>Q.id===b);if(!G)throw Error(`Editor "${b}" not found`);let v=_0(b,y),U=J();if(!$)U.start(`Checking for ${G.config.path}...`);if(await v.exists()){if(!$)U.message(`${G.config.path} found, updating...`);if(await v.update(),!$)U.stop(`${G.config.path} updated.`);return}if(!$)U.message(`${G.config.path} not found, creating...`);if(await v.create(),v.extension){let Q=_1.find((W)=>W.id===y)?.vscodeExtensionId;if(!Q)throw Error(`Linter extension not found for ${y}`);if(!$)U.message(`Installing ${Q} extension...`);try{if(v.extension(Q).status===0){if(!$)U.stop(`${G.config.path} created and ${Q} extension installed.`);return}}catch{}if(!$)U.stop(`${G.config.path} created. Install ${Q} extension manually.`);return}if(!$)if(b==="zed")U.stop(`${G.config.path} created. Install the Biome extension: https://biomejs.dev/reference/zed/`);else U.stop(`${G.config.path} created.`)},i2=async(b,y=!1,$=!1)=>{let G=J();if(!y)G.start("Checking for Biome configuration...");if(await q1.exists()){if(!y)G.message("Biome configuration found, updating...");if(await q1.update({frameworks:b,typeAware:$}),!y)G.stop("Biome configuration updated.");return}if(!y)G.message("Biome configuration not found, creating...");if(await q1.create({frameworks:b,typeAware:$}),!y)G.stop("Biome configuration created.")},t2=async(b,y=!1)=>{let $=J();if(!y)$.start("Checking for ESLint configuration...");if(await E1.exists()){if(!y)$.message("ESLint configuration found, updating...");if(await E1.update({frameworks:b}),!y)$.stop("ESLint configuration updated.");return}if(!y)$.message("ESLint configuration not found, creating...");if(await E1.create({frameworks:b}),!y)$.stop("ESLint configuration created.")},g2=async(b,y=!1)=>{let $=J();if(!y)$.start("Checking for Oxlint configuration...");if(await c1.exists()){if(!y)$.message("Oxlint configuration found, updating...");if(await c1.update({frameworks:b}),!y)$.stop("Oxlint configuration updated.");return}if(!y)$.message("Oxlint configuration not found, creating...");if(await c1.create({frameworks:b}),!y)$.stop("Oxlint configuration created.")},a2=async(b,y=!1)=>{let $=J();if(!y)$.start("Checking for Prettier configuration...");if(await f1.exists()){if(!y)$.message("Prettier configuration found, updating...");if(await f1.update({frameworks:b}),!y)$.stop("Prettier configuration updated.");return}if(!y)$.message("Prettier configuration not found, creating...");if(await f1.create({frameworks:b}),!y)$.stop("Prettier configuration created.")},e2=async(b=!1)=>{let y=J();if(!b)y.start("Checking for Stylelint configuration...");if(await P1.exists()){if(!b)y.message("Stylelint configuration found, updating...");if(await P1.update(),!b)y.stop("Stylelint configuration updated.");return}if(!b)y.message("Stylelint configuration not found, creating...");if(await P1.create(),!b)y.stop("Stylelint configuration created.")},b$=async(b=!1)=>{let y=J();if(!b)y.start("Checking for oxfmt configuration...");if(await M1.exists()){if(!b)y.message("oxfmt configuration found, updating...");if(await M1.update(),!b)y.stop("oxfmt configuration updated.");return}if(!b)y.message("oxfmt configuration not found, creating...");if(await M1.create(),!b)y.stop("oxfmt configuration created.")},y$=async(b,y=!0,$=!1,G=!1)=>{let v=J();if(!$)v.start("Initializing pre-commit hooks..."),v.message("Installing Husky...");if(await(y?e.install(b):N({devDependencies:{husky:"latest"},scripts:{prepare:"husky"}})),!$)v.message("Initializing Husky...");if(e.init(b.name),await e.exists()){if(!$)v.message("Pre-commit hook found, updating...");if(await e.update(b.name,G),!$)v.stop("Pre-commit hook updated.");return}if(!$)v.message("Pre-commit hook not found, creating...");if(await e.create(b.name,G),!$)v.stop("Pre-commit hook created.")},$$=async(b,y=!0,$=!1)=>{let G=J();if(!$)G.start("Initializing lefthook..."),G.message("Installing lefthook...");if(await(y?V1.install(b):N({devDependencies:{lefthook:"latest"}})),await V1.exists()){if(!$)G.message("lefthook.yml found, updating...");if(await V1.update(b.name),!$)G.stop("lefthook.yml updated.");return}if(!$)G.message("lefthook.yml not found, creating...");if(await V1.create(b.name),!$)G.stop("lefthook.yml created.")},G$=async(b,y=!0,$=!1)=>{let G=J();if(!$)G.start("Initializing lint-staged..."),G.message("Installing lint-staged...");if(await(y?A1.install(b):N({devDependencies:{"lint-staged":"latest"}})),await A1.exists()){if(!$)G.message("lint-staged found, updating...");if(await A1.update(b.name),!$)G.stop("lint-staged updated.");return}if(!$)G.message("lint-staged not found, creating...");if(await A1.create(b.name),!$)G.stop("lint-staged created.")},v$=async(b,y=!1)=>{let $=J();if(!y)$.start("Initializing pre-commit...");if(await T1.exists()){if(!y)$.message(".pre-commit-config.yaml found, updating...");if(await T1.update(b),!y)$.stop(".pre-commit-config.yaml updated.");return}if(!y)$.message(".pre-commit-config.yaml not found, creating...");if(await T1.create(b),!y)$.stop(".pre-commit-config.yaml created.")},Ab=async(b,y,$,G,v=!1)=>{let U=J();if(!v)U.start(`Checking for ${y}...`);let Q=F0(b,$,G);if(await Q.exists()){if(!v)U.message(`${y} found, updating...`);if(await Q.update(),!v)U.stop(`${y} updated.`);return}if(!v)U.message(`${y} not found, creating...`);if(await Q.create(),!v)U.stop(`${y} created.`)},U$=async(b,y,$,G=!1)=>{let v=`${b.displayName} (${b.path})`;await Ab(b.representativeAgentId,v,y,$,G)},Q$=async(b,y="biome",$=!1)=>{await Kb(b.representativeEditorId,y,$)},W$=async(b,y,$="biome",G=!1)=>{let v=J(),U=Y1.find((W)=>W.id===b)?.name??b;if(!G)v.start(`Checking for ${U} hooks...`);let Q=T0(b,y,$);if(await Q.exists()){if(!G)v.message(`${U} hooks found, updating...`);if(await Q.update(),!G)v.stop(`${U} hooks updated.`);return}if(!G)v.message(`${U} hooks not found, creating...`);if(await Q.create(),!G)v.stop(`${U} hooks created.`)},Jb=async(b)=>{let y=b??{},$=y.quiet??!1;if(!$)M2(`Ultracite v${V0} Initialization`);try{let G,v;if(y.pm)G=H1(y.pm),v={command:G,name:G};else{let Y=await f2(E2.cwd());if(!Y)throw Error("No package manager specified or detected");if(!$&&Y.warnings)for(let j of Y.warnings)D1.warn(j);if(!$)D1.info(`Detected lockfile, using ${Y.name}`);v=O0(Y),G=v.name}let{linter:U}=y;if(U===void 0)if($||y.pm||y.editors||y.agents||y.hooks||y.integrations!==void 0||y.frameworks!==void 0)U="biome";else{let j=await p2({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($1(j)){y1(G1);return}U=j}let{frameworks:Q}=y;if(Q===void 0)if($||y.pm||y.editors||y.agents||y.hooks||y.integrations!==void 0)Q=[];else{let j=await x0(),x1=await d1({initialValues:j,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 / React Router (file-route conventions)",value:"remix"},{label:"TanStack (Query, Router, Start)",value:"tanstack"},{label:"Astro",value:"astro"},{label:"NestJS",value:"nestjs"},{label:"Jest",value:"jest"},{label:"Vitest / Bun",value:"vitest"}],required:!1});if($1(x1)){y1(G1);return}Q=x1}let W=y.editors,X=[],V=m0(),K=V.find((Y)=>Y.id==="universal");if(!W){if(!$){let Y=await d1({message:"Which editors do you want to configure (recommended)?",options:V.map((j)=>({label:j.promptLabel,value:j.id})),required:!1});if($1(Y)){y1(G1);return}X=V.filter((j)=>Y.includes(j.id))}W=[]}else if(W.includes("universal")&&K){X=[K];let Y=new Set(K.editorIds);W=W.filter((j)=>j!=="universal"&&!Y.has(j))}let{agents:x}=y,u=[],{hooks:R}=y,k1=I0(),r1=k1.find((Y)=>Y.id==="universal"),Db=Object.fromEntries(k.map((Y)=>[Y.id,Y.name]));if(!x)if($)x=[];else{let Y=await d1({message:"Which agent files do you want to add (optional)?",options:k1.map((j)=>({label:j.promptLabel,value:j.id})),required:!1});if($1(Y)){y1(G1);return}u=k1.filter((j)=>Y.includes(j.id))}else if(x.includes("universal")&&r1){u=[r1];let Y=new Set(r1.agentIds);x=x.filter((j)=>j!=="universal"&&!Y.has(j))}let db=Object.fromEntries(Y1.map((Y)=>[Y.id,Y.name]));if(!R)if($)R=[];else{let Y=await d1({message:"Which agent hooks do you want to enable (optional)?",options:Object.entries(db).map(([j,x1])=>({label:x1,value:j})),required:!1});if($1(Y)){y1(G1);return}R=Y}let{integrations:q}=y;if(q===void 0)if($||y.pm||y.editors||y.agents||y.hooks)q=[];else{let j=await d1({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:B0},{label:"pre-commit (Python framework)",value:"pre-commit"}],required:!1});if($1(j)){y1(G1);return}q=j}if(await s2(v,U,!y.skipInstall,$,y["type-aware"],Q),await n2($),await C2(U,$),U==="biome")await i2(Q,$,y["type-aware"]);if(U==="eslint")await t2(Q,$),await a2(Q,$),await e2($);if(U==="oxlint")await N({type:"module"}),await g2(Q,$),await b$($);if(await Promise.all(X.map((Y)=>Q$(Y,U,$))),await Promise.all((W??[]).map((Y)=>Kb(Y,U,$))),await Promise.all(u.map((Y)=>U$(Y,G,U,$))),await Promise.all((x??[]).map((Y)=>Ab(Y,Db[Y],G,U,$))),await Promise.all((R??[]).map((Y)=>W$(Y,G,U,$))),q?.includes("husky")){let Y=q?.includes(B0)??!1;await y$(v,!y.skipInstall,$,Y)}if(q?.includes("lefthook"))await $$(v,!y.skipInstall,$);if(q?.includes(B0))await G$(v,!y.skipInstall,$);if(q?.includes("pre-commit"))await v$(G,$);if(!$)D1.success("Successfully initialized Ultracite!");let ob=await zb({packageManager:G,quiet:$,shouldInstall:y.installSkill});if(!$&&!ob)D1.info(`You can install the Ultracite skill later with \`${Zb(G)}\`.`)}catch(G){let v=G instanceof Error?G.message:"Unknown error";if(!$)D1.error(`Failed to initialize Ultracite configuration: ${v}`);throw G}};var v1=new Z$,ub=(b)=>b.parent?.rawArgs;v1.name("ultracite").version(z.version,"-v, --version").description(z.description);v1.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 (use universal for .vscode/settings.json)").option("--agents <agents...>","Agents to enable (use universal for AGENTS.md)").option("--hooks <hooks...>","Hooks to enable").option("--frameworks <frameworks...>","Frameworks being used").option("--integrations <integrations...>","Integrations to enable").option("--install-skill","Install the reusable Ultracite skill after setup").option("--type-aware","Enable type-aware linting (enables project/scanner rules)").option("--skip-install","Skip installing dependencies").option("--quiet","Suppress interactive prompts").action(async(b)=>{await Jb({agents:b.agents,editors:b.editors,frameworks:b.frameworks,hooks:b.hooks,installSkill:b.installSkill,integrations:b.integrations,linter:b.linter,pm:b.pm,quiet:b.quiet??(o1.env.CI==="true"||o1.env.CI==="1"),skipInstall:b.skipInstall,"type-aware":b.typeAware})});v1.command("check").argument("[files...]","Files to check").description("Run linter without fixing files. Unknown options are passed to the underlying linter.").allowUnknownOption().action(async(b,y,$)=>{let{files:G,passthrough:v}=C1({commandName:"check",parsedArgs:b,rawArgs:ub($)});await N0(G,v)});v1.command("fix").argument("[files...]","Files to fix").description("Run linter and fix files. Unknown options are passed to the underlying linter.").allowUnknownOption().action(async(b,y,$)=>{let{files:G,passthrough:v}=C1({commandName:"fix",parsedArgs:b,rawArgs:ub($)});await L0(G,v)});v1.command("doctor").description("Verify your Ultracite setup").action(async()=>{await S0()});if(!o1.env.TEST)try{await v1.parseAsync()}catch(b){if(b instanceof r)o1.exit(b.exitCode);if(b instanceof Error&&b.message==="Doctor checks failed")o1.exit(1);throw b}export{v1 as program};
|
|
282
|
+
`},r1={create:async(b)=>{let $=wb(b);await v(K0,$)},exists:()=>{return Bb()!==null},update:async(b)=>{let $=wb(b),y=Bb();await v(y===w0?K0:y??K0,$)}};var J0="./package.json",C4=e.map((b)=>`./${b}`),A0="./stylelint.config.mjs",l4=()=>{return h(J0)?.stylelint!==void 0},Ab=()=>{if(l4())return J0;for(let b of C4)if(V(b))return b;return null},Jb=()=>`export { default } from "ultracite/stylelint";
|
|
283
|
+
`,s1={create:async()=>{let b=Jb();await v(A0,b)},exists:()=>{return Ab()!==null},update:async()=>{let b=Jb(),$=Ab();await v($===J0?A0:$??A0,b)}};import{isCancel as n4,select as r4,spinner as s4}from"@clack/prompts";import{dlxCommand as Db}from"nypm";var i4="haydenbleasel/ultracite",g4="ultracite",db=(b)=>Db(b,"skills",{args:["add",i4],short:b==="npm"}),t4=(b,$=!1)=>Db(b,"skills",{args:$?["list","-g","--json"]:["list","--json"],short:b==="npm"}),jb=(b,$=!1)=>{let y=t4(b,$),[G,...Q]=y.split(" "),W=A(G,Q,{encoding:"utf-8",stdio:"pipe"});if(W.error||W.status!==0||!W.stdout)return!1;try{return JSON.parse(typeof W.stdout==="string"?W.stdout:W.stdout.toString("utf-8")).some((U)=>U.name===g4)}catch{return!1}},a4=(b)=>jb(b)||jb(b,!0),e4=async()=>{let b=await r4({message:"Do you want to install the Ultracite skill?",options:[{label:"Yes, install it",value:"install"},{label:"No, I'll do it later",value:"skip"}]});return!n4(b)&&b==="install"},xb=(b)=>db(b),Lb=async({packageManager:b,quiet:$=!1,shouldInstall:y})=>{if(y===void 0&&!$&&a4(b))return!0;if(!(y??(!$&&await e4())))return!1;let Q=db(b),[W,...Z]=Q.split(" "),U=s4();if(!$)U.start("Installing the Ultracite skill...");let H=A(W,Z,{stdio:"pipe"}),B=!H.error&&H.status===0;if(!$)U.stop(B?"Ultracite skill installed.":"Couldn't install the Ultracite skill automatically.");return B};import{readFile as b$}from"node:fs/promises";import{log as $$}from"@clack/prompts";import{glob as y$}from"glob";import{applyEdits as G$,modify as Q$}from"jsonc-parser";var Nb=async()=>{try{return await y$("**/tsconfig*.json",{absolute:!1,ignore:["**/node_modules/**","**/dist/**","**/build/**","**/.next/**"]})}catch{return[]}},W$=(b)=>{if(!b?.compilerOptions)return!1;if(b.compilerOptions.strict===!0)return!0;return b.compilerOptions.strictNullChecks===!0},Z$=async(b)=>{try{let $=await b$(b,"utf-8"),y=I1($,S0);if(W$(y))return;if(y===void 0){await v(b,`${JSON.stringify({compilerOptions:{strictNullChecks:!0}},null,2)}
|
|
284
|
+
`);return}let Q=Q$($,["compilerOptions","strictNullChecks"],!0,{formattingOptions:{insertSpaces:!0,tabSize:2}}),W=G$($,Q);await v(b,W)}catch($){$$.warn(`Failed to update ${b}: ${$ instanceof Error?$.message:$}`)}},j0={exists:async()=>{return(await Nb()).length>0},update:async()=>{let b=await Nb();if(b.length===0)return;await Promise.all(b.map(($)=>Z$($)))}};var mb=z.devDependencies["@biomejs/biome"],x0=z.version,i="Operation cancelled.",D0="lint-staged",d0=["eslint-plugin-github","eslint-plugin-sonarjs","oxlint-plugin-react-doctor"],Ib={"eslint-plugin-github":z.devDependencies["eslint-plugin-github"],"eslint-plugin-sonarjs":z.devDependencies["eslint-plugin-sonarjs"],"oxlint-plugin-react-doctor":z.devDependencies["oxlint-plugin-react-doctor"]},V$=(b)=>{if(d0.includes(b))return b;throw Error(`Unsupported Oxlint JS plugin "${b}". Supported plugins: ${d0.join(", ")}`)},Sb="^10.0.0",ub={"@eslint/js":Sb,"@typescript-eslint/eslint-plugin":z.devDependencies["@typescript-eslint/eslint-plugin"],"@typescript-eslint/parser":z.devDependencies["@typescript-eslint/parser"],eslint:Sb,"eslint-config-prettier":z.devDependencies["eslint-config-prettier"],"eslint-import-resolver-typescript":z.devDependencies["eslint-import-resolver-typescript"],"eslint-plugin-compat":z.devDependencies["eslint-plugin-compat"],"eslint-plugin-cypress":z.devDependencies["eslint-plugin-cypress"],"eslint-plugin-github":z.devDependencies["eslint-plugin-github"],"eslint-plugin-html":z.devDependencies["eslint-plugin-html"],"eslint-plugin-import-x":z.devDependencies["eslint-plugin-import-x"],"eslint-plugin-jsdoc":z.devDependencies["eslint-plugin-jsdoc"],"eslint-plugin-n":z.devDependencies["eslint-plugin-n"],"eslint-plugin-prettier":z.devDependencies["eslint-plugin-prettier"],"eslint-plugin-promise":z.devDependencies["eslint-plugin-promise"],"eslint-plugin-sonarjs":z.devDependencies["eslint-plugin-sonarjs"],"eslint-plugin-storybook":z.devDependencies["eslint-plugin-storybook"],"eslint-plugin-unicorn":z.devDependencies["eslint-plugin-unicorn"],"eslint-plugin-unused-imports":z.devDependencies["eslint-plugin-unused-imports"],globals:z.devDependencies.globals,prettier:"latest","prettier-plugin-tailwindcss":z.devDependencies["prettier-plugin-tailwindcss"],storybook:z.devDependencies.storybook,stylelint:"latest","stylelint-config-idiomatic-order":z.devDependencies["stylelint-config-idiomatic-order"],"stylelint-config-standard":z.devDependencies["stylelint-config-standard"],"stylelint-prettier":z.devDependencies["stylelint-prettier"]},Fb={angular:{"@angular-eslint/eslint-plugin":"latest"},astro:{"eslint-plugin-astro":z.devDependencies["eslint-plugin-astro"],"prettier-plugin-astro":z.devDependencies["prettier-plugin-astro"]},jest:{"eslint-plugin-jest":z.devDependencies["eslint-plugin-jest"]},next:{"@next/eslint-plugin-next":z.devDependencies["@next/eslint-plugin-next"],"eslint-plugin-react-doctor":z.devDependencies["eslint-plugin-react-doctor"]},qwik:{"eslint-plugin-qwik":z.devDependencies["eslint-plugin-qwik"]},react:{"eslint-plugin-jsx-a11y":z.devDependencies["eslint-plugin-jsx-a11y"],"eslint-plugin-react":z.devDependencies["eslint-plugin-react"],"eslint-plugin-react-doctor":z.devDependencies["eslint-plugin-react-doctor"],"eslint-plugin-react-hooks":z.devDependencies["eslint-plugin-react-hooks"]},remix:{"eslint-plugin-remix":z.devDependencies["eslint-plugin-remix"]},solid:{"eslint-plugin-solid":z.devDependencies["eslint-plugin-solid"]},svelte:{"eslint-plugin-svelte":z.devDependencies["eslint-plugin-svelte"],"prettier-plugin-svelte":z.devDependencies["prettier-plugin-svelte"]},tanstack:{"@tanstack/eslint-plugin-query":z.devDependencies["@tanstack/eslint-plugin-query"],"@tanstack/eslint-plugin-router":z.devDependencies["@tanstack/eslint-plugin-router"],"@tanstack/eslint-plugin-start":z.devDependencies["@tanstack/eslint-plugin-start"],"eslint-plugin-react-doctor":z.devDependencies["eslint-plugin-react-doctor"]},vitest:{"@vitest/eslint-plugin":z.devDependencies["@vitest/eslint-plugin"]},vue:{"eslint-plugin-vue":z.devDependencies["eslint-plugin-vue"]}},Ob=(b)=>{let $={...ub};for(let y of b)Object.assign($,Fb[y]);return $},X$=(b,$,y,G=[])=>{let Q={ultracite:x0};if(b==="biome")Q["@biomejs/biome"]=mb;if(b==="eslint")Object.assign(Q,Ob(y));if(b==="oxlint"){if(Q.oxlint="latest",Q.oxfmt="latest",$)Q["oxlint-tsgolint"]="latest";for(let W of G)Q[W]=Ib[W]}return Q},B$=new Set([...Object.keys(ub),...Object.values(Fb).flatMap((b)=>Object.keys(b??{}))]),Rb={biome:new Set(["@biomejs/biome"]),eslint:B$,oxlint:new Set(["eslint-plugin-github","eslint-plugin-sonarjs","oxfmt","oxlint","oxlint-plugin-react-doctor","oxlint-tsgolint"])},K$=async(b)=>{let $=b.startsWith("./")?b:`./${b}`;if(!V($))return!1;let{rm:y}=await import("node:fs/promises");return await y($,{force:!0}),!0},w$=async(b)=>{let $=await t();if(!$)return!1;let y=new Set;for(let[W,Z]of Object.entries(Rb))if(W!==b)for(let U of Z)y.add(U);for(let W of Rb[b])y.delete(W);let G=!1,Q={...$};for(let W of["dependencies","devDependencies","peerDependencies"]){let Z=Q[W];if(!Z)continue;let U=Object.entries(Z),H=U.filter(([w])=>!y.has(w));if(H.length!==U.length)G=!0;let B=Object.fromEntries(H);Q[W]=B}if("prettier"in Q)delete Q.prettier,G=!0;if("stylelint"in Q)delete Q.stylelint,G=!0;if(!G)return!1;return await v("package.json",`${JSON.stringify(Q,null,2)}
|
|
285
|
+
`),!0},A$=async(b,$=!1)=>{let y=D();if(!$)y.start("Checking for stale linter configuration...");let G=new Set;if(b!=="biome")for(let U of I)G.add(U);if(b!=="eslint"){for(let U of C)G.add(U);for(let U of a)G.add(U);for(let U of e)G.add(U)}for(let U of F0)G.add(U);if(b!=="oxlint"){for(let U of $0)G.add(U);for(let U of O0)G.add(U)}let[Q,W]=await Promise.all([Promise.all([...G].map((U)=>K$(U))),w$(b)]),Z=Q.some(Boolean)||W;if(!$)y.stop(Z?"Stale linter configuration migrated.":"No stale linter configuration found.")},J$=async(b,$="biome",y=!0,G=!1,Q=!1,W=["react"],Z=[])=>{let U=D();if(!G)U.start("Installing dependencies...");let H=[`ultracite@${x0}`];if($==="biome")H.push(`@biomejs/biome@${mb}`);if($==="eslint")H.push(...Object.entries(Ob(W)).map(([w,S])=>`${w}@${S}`));if($==="oxlint"){if(H.push("oxlint@latest","oxfmt@latest"),Q)H.push("oxlint-tsgolint@latest");H.push(...Z.map((w)=>`${w}@${Ib[w]}`))}let B={check:"ultracite check",fix:"ultracite fix"};if(y)await Y$(H,{corepack:!1,packageManager:b,silent:!0,workspace:c()&&b.name!=="npm"}),await N({scripts:B});else{let w=X$($,Q,W,Z);await N({devDependencies:w,scripts:B})}if(!G)U.stop("Dependencies installed.")},j$=async(b=!1)=>{let $=D();if(!b)$.start("Checking for tsconfig.json files...");if(await j0.exists()){if(!b)$.message("Found tsconfig.json files, updating with strictNullChecks...");if(await j0.update(),!b)$.stop("tsconfig.json files updated.");return}if(!b)$.stop("No tsconfig.json files found, skipping.")},ob=async(b,$="biome",y=!1)=>{let G=P.find((Z)=>Z.id===b);if(!G)throw Error(`Editor "${b}" not found`);let Q=C0(b,$),W=D();if(!y)W.start(`Checking for ${G.config.path}...`);if(await Q.exists()){if(!y)W.message(`${G.config.path} found, updating...`);if(await Q.update(),!y)W.stop(`${G.config.path} updated.`);return}if(!y)W.message(`${G.config.path} not found, creating...`);if(await Q.create(),Q.extension){let Z=M1.find((U)=>U.id===$)?.vscodeExtensionId;if(!Z)throw Error(`Linter extension not found for ${$}`);if(!y)W.message(`Installing ${Z} extension...`);try{if(Q.extension(Z).status===0){if(!y)W.stop(`${G.config.path} created and ${Z} extension installed.`);return}}catch{}if(!y)W.stop(`${G.config.path} created. Install ${Z} extension manually.`);return}if(!y)if(b==="zed")W.stop(`${G.config.path} created. Install the Biome extension: https://biomejs.dev/reference/zed/`);else W.stop(`${G.config.path} created.`)},D$=async(b,$=!1,y=!1)=>{let G=D();if(!$)G.start("Checking for Biome configuration...");if(await f1.exists()){if(!$)G.message("Biome configuration found, updating...");if(await f1.update({frameworks:b,typeAware:y}),!$)G.stop("Biome configuration updated.");return}if(!$)G.message("Biome configuration not found, creating...");if(await f1.create({frameworks:b,typeAware:y}),!$)G.stop("Biome configuration created.")},d$=async(b,$=!1)=>{let y=D();if(!$)y.start("Checking for ESLint configuration...");if(await k1.exists()){if(!$)y.message("ESLint configuration found, updating...");if(await k1.update({frameworks:b}),!$)y.stop("ESLint configuration updated.");return}if(!$)y.message("ESLint configuration not found, creating...");if(await k1.create({frameworks:b}),!$)y.stop("ESLint configuration created.")},x$=async(b,$=!1,y=[])=>{let G=D();if(!$)G.start("Checking for Oxlint configuration...");if(await n1.exists()){if(!$)G.message("Oxlint configuration found, updating...");if(await n1.update({frameworks:b,jsPlugins:y}),!$)G.stop("Oxlint configuration updated.");return}if(!$)G.message("Oxlint configuration not found, creating...");if(await n1.create({frameworks:b,jsPlugins:y}),!$)G.stop("Oxlint configuration created.")},L$=async(b,$=!1)=>{let y=D();if(!$)y.start("Checking for Prettier configuration...");if(await r1.exists()){if(!$)y.message("Prettier configuration found, updating...");if(await r1.update({frameworks:b}),!$)y.stop("Prettier configuration updated.");return}if(!$)y.message("Prettier configuration not found, creating...");if(await r1.create({frameworks:b}),!$)y.stop("Prettier configuration created.")},N$=async(b=!1)=>{let $=D();if(!b)$.start("Checking for Stylelint configuration...");if(await s1.exists()){if(!b)$.message("Stylelint configuration found, updating...");if(await s1.update(),!b)$.stop("Stylelint configuration updated.");return}if(!b)$.message("Stylelint configuration not found, creating...");if(await s1.create(),!b)$.stop("Stylelint configuration created.")},S$=async(b=!1)=>{let $=D();if(!b)$.start("Checking for oxfmt configuration...");if(await C1.exists()){if(!b)$.message("oxfmt configuration found, updating...");if(await C1.update(),!b)$.stop("oxfmt configuration updated.");return}if(!b)$.message("oxfmt configuration not found, creating...");if(await C1.create(),!b)$.stop("oxfmt configuration created.")},R$=async(b,$=!0,y=!1,G=!1)=>{let Q=D();if(!y)Q.start("Initializing pre-commit hooks..."),Q.message("Installing Husky...");if(await($?Z1.install(b):N({devDependencies:{husky:"latest"},scripts:{prepare:"husky"}})),!y)Q.message("Initializing Husky...");if(Z1.init(b.name),await Z1.exists()){if(!y)Q.message("Pre-commit hook found, updating...");if(await Z1.update(b.name,G),!y)Q.stop("Pre-commit hook updated.");return}if(!y)Q.message("Pre-commit hook not found, creating...");if(await Z1.create(b.name,G),!y)Q.stop("Pre-commit hook created.")},m$=async(b,$=!0,y=!1)=>{let G=D();if(!y)G.start("Initializing lefthook..."),G.message("Installing lefthook...");if(await($?j1.install(b):N({devDependencies:{lefthook:"latest"}})),await j1.exists()){if(!y)G.message("lefthook.yml found, updating...");if(await j1.update(b.name),!y)G.stop("lefthook.yml updated.");return}if(!y)G.message("lefthook.yml not found, creating...");if(await j1.create(b.name),!y)G.stop("lefthook.yml created.")},I$=async(b,$=!0,y=!1)=>{let G=D();if(!y)G.start("Initializing lint-staged..."),G.message("Installing lint-staged...");if(await($?L1.install(b):N({devDependencies:{"lint-staged":"latest"}})),await L1.exists()){if(!y)G.message("lint-staged found, updating...");if(await L1.update(b.name),!y)G.stop("lint-staged updated.");return}if(!y)G.message("lint-staged not found, creating...");if(await L1.create(b.name),!y)G.stop("lint-staged created.")},u$=async(b,$=!1)=>{let y=D();if(!$)y.start("Initializing pre-commit...");if(await P1.exists()){if(!$)y.message(".pre-commit-config.yaml found, updating...");if(await P1.update(b),!$)y.stop(".pre-commit-config.yaml updated.");return}if(!$)y.message(".pre-commit-config.yaml not found, creating...");if(await P1.create(b),!$)y.stop(".pre-commit-config.yaml created.")},_b=async(b,$,y,G,Q=!1)=>{let W=D();if(!Q)W.start(`Checking for ${$}...`);let Z=k0(b,y,G);if(await Z.exists()){if(!Q)W.message(`${$} found, updating...`);if(await Z.update(),!Q)W.stop(`${$} updated.`);return}if(!Q)W.message(`${$} not found, creating...`);if(await Z.create(),!Q)W.stop(`${$} created.`)},F$=async(b,$,y,G=!1)=>{let Q=`${b.displayName} (${b.path})`;await _b(b.representativeAgentId,Q,$,y,G)},O$=async(b,$="biome",y=!1)=>{await ob(b.representativeEditorId,$,y)},o$=async(b,$,y="biome",G=!1)=>{let Q=D(),W=K1.find((U)=>U.id===b)?.name??b;if(!G)Q.start(`Checking for ${W} hooks...`);let Z=s0(b,$,y);if(await Z.exists()){if(!G)Q.message(`${W} hooks found, updating...`);if(await Z.update(),!G)Q.stop(`${W} hooks updated.`);return}if(!G)Q.message(`${W} hooks not found, creating...`);if(await Z.create(),!G)Q.stop(`${W} hooks created.`)},Tb=async(b)=>{let $=b??{},y=$.quiet??!1;if(!y)v$(`Ultracite v${x0} Initialization`);try{let G,Q;if($.pm)G=w1($.pm),Q={command:G,name:G};else{let Y=await H$(U$.cwd());if(!Y)throw Error("No package manager specified or detected");if(!y&&Y.warnings)for(let K of Y.warnings)R1.warn(K);if(!y)R1.info(`Detected lockfile, using ${Y.name}`);Q=r0(Y),G=Q.name}let{linter:W}=$;if(W===void 0)if(y||$.pm||$.editors||$.agents||$.hooks||$.integrations!==void 0||$.frameworks!==void 0)W="biome";else{let K=await z$({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(s(K)){r(i);return}W=K}let{frameworks:Z}=$;if(Z===void 0)if(y||$.pm||$.editors||$.agents||$.hooks||$.integrations!==void 0)Z=[];else{let K=await o0(),k=await v1({initialValues:K,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 / React Router (file-route conventions)",value:"remix"},{label:"TanStack (Query, Router, Start)",value:"tanstack"},{label:"Astro",value:"astro"},{label:"NestJS",value:"nestjs"},{label:"Jest",value:"jest"},{label:"Vitest / Bun",value:"vitest"}],required:!1});if(s(k)){r(i);return}Z=k}let U=($["js-plugins"]??[]).map(V$);if(W==="oxlint"&&$["js-plugins"]===void 0){if(!(y||$.pm||$.editors||$.agents||$.hooks||$.integrations!==void 0||$.frameworks!==void 0)){let K=await v1({message:"Which JS plugins would you like to add (optional)?",options:d0.map((k)=>({label:k,value:k})),required:!1});if(s(K)){r(i);return}U=K}}let H=$.editors,B=[],w=l0(),S=w.find((Y)=>Y.id==="universal");if(!H){if(!y){let Y=await v1({message:"Which editors do you want to configure (recommended)?",options:w.map((K)=>({label:K.promptLabel,value:K.id})),required:!1});if(s(Y)){r(i);return}B=w.filter((K)=>Y.includes(K.id))}H=[]}else if(H.includes("universal")&&S){B=[S];let Y=new Set(S.editorIds);H=H.filter((K)=>K!=="universal"&&!Y.has(K))}let{agents:J}=$,M=[],{hooks:m1}=$,i1=f0(),g1=i1.find((Y)=>Y.id==="universal"),Eb=Object.fromEntries(n.map((Y)=>[Y.id,Y.name]));if(!J)if(y)J=[];else{let Y=await v1({message:"Which agent files do you want to add (optional)?",options:i1.map((K)=>({label:K.promptLabel,value:K.id})),required:!1});if(s(Y)){r(i);return}M=i1.filter((K)=>Y.includes(K.id))}else if(J.includes("universal")&&g1){M=[g1];let Y=new Set(g1.agentIds);J=J.filter((K)=>K!=="universal"&&!Y.has(K))}let Mb=Object.fromEntries(K1.map((Y)=>[Y.id,Y.name]));if(!m1)if(y)m1=[];else{let Y=await v1({message:"Which agent hooks do you want to enable (optional)?",options:Object.entries(Mb).map(([K,k])=>({label:k,value:K})),required:!1});if(s(Y)){r(i);return}m1=Y}let{integrations:p}=$;if(p===void 0)if(y||$.pm||$.editors||$.agents||$.hooks)p=[];else{let K=await v1({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:D0},{label:"pre-commit (Python framework)",value:"pre-commit"}],required:!1});if(s(K)){r(i);return}p=K}if(await J$(Q,W,!$.skipInstall,y,$["type-aware"],Z,U),await j$(y),await A$(W,y),W==="biome")await D$(Z,y,$["type-aware"]);if(W==="eslint")await d$(Z,y),await L$(Z,y),await N$(y);if(W==="oxlint")await N({type:"module"}),await x$(Z,y,U),await S$(y);if(await Promise.all(B.map((Y)=>O$(Y,W,y))),await Promise.all((H??[]).map((Y)=>ob(Y,W,y))),await Promise.all(M.map((Y)=>F$(Y,G,W,y))),await Promise.all((J??[]).map((Y)=>_b(Y,Eb[Y],G,W,y))),await Promise.all((m1??[]).map((Y)=>o$(Y,G,W,y))),p?.includes("husky")){let Y=p?.includes(D0)??!1;await R$(Q,!$.skipInstall,y,Y)}if(p?.includes("lefthook"))await m$(Q,!$.skipInstall,y);if(p?.includes(D0))await I$(Q,!$.skipInstall,y);if(p?.includes("pre-commit"))await u$(G,y);if(!y)R1.success("Successfully initialized Ultracite!");let pb=await Lb({packageManager:G,quiet:y,shouldInstall:$.installSkill});if(!y&&!pb)R1.info(`You can install the Ultracite skill later with \`${xb(G)}\`.`)}catch(G){let Q=G instanceof Error?G.message:"Unknown error";if(!y)R1.error(`Failed to initialize Ultracite configuration: ${Q}`);throw G}};var Y1=new T$,qb=(b)=>b.parent?.rawArgs;Y1.name("ultracite").version(z.version,"-v, --version").description(z.description);Y1.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 (use universal for .vscode/settings.json)").option("--agents <agents...>","Agents to enable (use universal for AGENTS.md)").option("--hooks <hooks...>","Hooks to enable").option("--frameworks <frameworks...>","Frameworks being used").option("--integrations <integrations...>","Integrations to enable").option("--install-skill","Install the reusable Ultracite skill after setup").option("--js-plugins <plugins...>","Oxlint JS plugins to enable (eslint-plugin-github, eslint-plugin-sonarjs, oxlint-plugin-react-doctor)").option("--type-aware","Enable type-aware linting (enables project/scanner rules)").option("--skip-install","Skip installing dependencies").option("--quiet","Suppress interactive prompts").action(async(b)=>{await Tb({agents:b.agents,editors:b.editors,frameworks:b.frameworks,hooks:b.hooks,installSkill:b.installSkill,integrations:b.integrations,"js-plugins":b.jsPlugins,linter:b.linter,pm:b.pm,quiet:b.quiet??(z1.env.CI==="true"||z1.env.CI==="1"),skipInstall:b.skipInstall,"type-aware":b.typeAware})});Y1.command("check").argument("[files...]","Files to check").description("Run linter without fixing files. Unknown options are passed to the underlying linter.").allowUnknownOption().action(async(b,$,y)=>{let{files:G,passthrough:Q}=Q0({commandName:"check",parsedArgs:b,rawArgs:qb(y)});await p0(G,Q)});Y1.command("fix").argument("[files...]","Files to fix").description("Run linter and fix files. Unknown options are passed to the underlying linter.").allowUnknownOption().action(async(b,$,y)=>{let{files:G,passthrough:Q}=Q0({commandName:"fix",parsedArgs:b,rawArgs:qb(y)});await c0(G,Q)});Y1.command("doctor").description("Verify your Ultracite setup").action(async()=>{await h0()});if(!z1.env.TEST)try{await Y1.parseAsync()}catch(b){if(b instanceof $1)z1.exit(b.exitCode);if(b instanceof l)_$.error(b.message),z1.exit(1);if(b instanceof Error&&b.message==="Doctor checks failed")z1.exit(1);throw b}export{Y1 as program};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ultracite",
|
|
3
|
-
"version": "7.9.
|
|
3
|
+
"version": "7.9.4",
|
|
4
4
|
"description": "The AI-ready formatter that helps you write and generate code faster.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"biome",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@angular-eslint/eslint-plugin": "^22.0.0",
|
|
71
|
-
"@biomejs/biome": "2.5.
|
|
71
|
+
"@biomejs/biome": "2.5.3",
|
|
72
72
|
"@darraghor/eslint-plugin-nestjs-typed": "^7.2.5",
|
|
73
73
|
"@eslint/js": "^10.0.0",
|
|
74
74
|
"@next/eslint-plugin-next": "^16.2.10",
|