ultracite 7.8.3 → 7.8.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 CHANGED
@@ -22,28 +22,28 @@ The interactive setup guides you through choosing your formatter/linter, framewo
22
22
 
23
23
  ## Commands
24
24
 
25
- | Command | Description |
26
- | ---------------------------- | ---------------------------------------------------------------------------------------- |
27
- | `ultracite init` | Initialize Ultracite in the current directory (interactive by default). |
25
+ | Command | Description |
26
+ | --- | --- |
27
+ | `ultracite init` | Initialize Ultracite in the current directory (interactive by default). |
28
28
  | `ultracite check [files...]` | Lint without writing changes. Unknown flags are passed through to the underlying linter. |
29
- | `ultracite fix [files...]` | Lint and auto-fix. Unknown flags are passed through to the underlying linter. |
30
- | `ultracite doctor` | Verify your Ultracite setup and diagnose configuration issues. |
29
+ | `ultracite fix [files...]` | Lint and auto-fix. Unknown flags are passed through to the underlying linter. |
30
+ | `ultracite doctor` | Verify your Ultracite setup and diagnose configuration issues. |
31
31
 
32
32
  `check` and `fix` accept an optional list of files or globs; omit them to run against the whole project. Add `-v` / `--version` or `-h` / `--help` for CLI details.
33
33
 
34
34
  Common `init` flags for non-interactive / CI use:
35
35
 
36
- | Flag | Description |
37
- | ------------------------------ | ------------------------------------------------------------------- |
38
- | `--linter <linter>` | Toolchain to configure (Biome, ESLint, or Oxlint). |
39
- | `--pm <pm>` | Package manager to use. |
40
- | `--editors <editors...>` | Editors to configure (use `universal` for `.vscode/settings.json`). |
41
- | `--agents <agents...>` | AI agents to enable (use `universal` for `AGENTS.md`). |
42
- | `--frameworks <frameworks...>` | Frameworks in use, for framework-aware rules. |
43
- | `--type-aware` | Enable type-aware linting. |
44
- | `--install-skill` | Install the reusable Ultracite skill after setup. |
45
- | `--skip-install` | Configure without installing dependencies. |
46
- | `--quiet` | Suppress interactive prompts (auto-enabled in CI). |
36
+ | Flag | Description |
37
+ | --- | --- |
38
+ | `--linter <linter>` | Toolchain to configure (Biome, ESLint, or Oxlint). |
39
+ | `--pm <pm>` | Package manager to use. |
40
+ | `--editors <editors...>` | Editors to configure (use `universal` for `.vscode/settings.json`). |
41
+ | `--agents <agents...>` | AI agents to enable (use `universal` for `AGENTS.md`). |
42
+ | `--frameworks <frameworks...>` | Frameworks in use, for framework-aware rules. |
43
+ | `--type-aware` | Enable type-aware linting. |
44
+ | `--install-skill` | Install the reusable Ultracite skill after setup. |
45
+ | `--skip-install` | Configure without installing dependencies. |
46
+ | `--quiet` | Suppress interactive prompts (auto-enabled in CI). |
47
47
 
48
48
  See the [CLI reference](https://docs.ultracite.ai/) for the full, current list of options.
49
49
 
@@ -22,6 +22,8 @@
22
22
  "!!**/.turbo",
23
23
  "!!**/.vercel",
24
24
  "!!**/.netlify",
25
+ "!!**/.wrangler",
26
+ "!!**/.wrangler-dry-run",
25
27
  "!!**/.docusaurus",
26
28
  "!!**/.cache",
27
29
  "!!**/.parcel-cache",
@@ -42,6 +44,7 @@
42
44
  "!!**/schema.d.ts",
43
45
  "!!**/schema.graphql.d.ts",
44
46
  "!!**/*.d.ts.map",
47
+ "!!**/.yarn",
45
48
  "!!**/coverage",
46
49
  "!!**/.nyc_output",
47
50
  "!!**/.expo",
@@ -10,6 +10,7 @@ export default defineConfig({
10
10
  ignorePatterns,
11
11
  jsxSingleQuote: false,
12
12
  printWidth: 80,
13
+ proseWrap: "never",
13
14
  quoteProps: "as-needed",
14
15
  semi: true,
15
16
  singleQuote: false,
@@ -20,6 +20,8 @@ export const ignorePatterns = [
20
20
  "**/.turbo",
21
21
  "**/.vercel",
22
22
  "**/.netlify",
23
+ "**/.wrangler",
24
+ "**/.wrangler-dry-run",
23
25
  "**/.docusaurus",
24
26
  "**/.cache",
25
27
  "**/.parcel-cache",
@@ -42,6 +44,7 @@ export const ignorePatterns = [
42
44
  "**/schema.d.ts",
43
45
  "**/schema.graphql.d.ts",
44
46
  "**/*.d.ts.map",
47
+ "**/.yarn",
45
48
 
46
49
  // ── Test coverage ─────────────────────────────────────────────────
47
50
  "**/coverage",
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import pe from"node:process";import{Command as Bs}from"commander";var u={name:"ultracite",version:"7.8.3",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",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.4.16","@darraghor/eslint-plugin-nestjs-typed":"^7.2.4","@eslint/js":"^10.0.1","@next/eslint-plugin-next":"^16.2.7","@repo/data":"workspace:*","@tanstack/eslint-plugin-query":"^5.101.0","@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.60.1","@typescript-eslint/parser":"^8.60.1","@vitest/eslint-plugin":"^1.6.19","eslint-config-prettier":"^10.1.8","eslint-import-resolver-typescript":"^4.4.5","eslint-plugin-astro":"^1.7.0","eslint-plugin-compat":"^7.0.2","eslint-plugin-cypress":"^6.4.1","eslint-plugin-github":"6.0.0","eslint-plugin-html":"^8.1.4","eslint-plugin-import-x":"^4.16.2","eslint-plugin-jest":"^29.15.2","eslint-plugin-jsx-a11y":"^6.10.2","eslint-plugin-n":"^18.0.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-hooks":"^7.1.1","eslint-plugin-remix":"^1.1.1","eslint-plugin-solid":"^0.14.5","eslint-plugin-sonarjs":"^4.0.3","eslint-plugin-storybook":"^10.4.2","eslint-plugin-svelte":"^3.19.0","eslint-plugin-unicorn":"^64.0.0","eslint-plugin-unused-imports":"^4.4.1","eslint-plugin-vue":"^10.9.2",globals:"^17.6.0",oxlint:"^1.68.0","prettier-plugin-astro":"^0.14.1","prettier-plugin-svelte":"^4.1.0","prettier-plugin-tailwindcss":"^0.8.0","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{existsSync as _t}from"node:fs";import Mt from"node:path";var Pt=(e,o,t)=>{let i=t?.indexOf(e)??-1;if(!t||i===-1)return o;return t.slice(i+1)},me=(e)=>e.map((o)=>o.startsWith("-")?`./${o}`:o),je="**/*.{css,scss,sass,less}",qt=[".css",".scss",".sass",".less"],ei=(e)=>{let o=e.toLowerCase();return qt.some((t)=>o.endsWith(t))},he=(e)=>{if(e.length===0)return[je];let o=[];for(let t of e){if(ei(t)){o.push(t);continue}if(Mt.extname(t)===""){let i=t.replace(/\/+$/u,"");o.push(i==="."||i===""?je:`${i}/${je}`)}}return o},Re=({commandName:e,parsedArgs:o,pathExists:t=_t,rawArgs:i})=>{let n=Pt(e,o,i),a=n.indexOf("--");if(a!==-1)return{files:n.slice(a+1),passthrough:n.slice(0,a)};let d=[],l=[];for(let f of n){if(f.startsWith("-")&&!t(f)){l.push(f);continue}d.push(f)}return{files:d,passthrough:l}};import{sync as oi}from"cross-spawn";class O extends Error{commandName;exitCode;name="LinterExitError";constructor(e,o){super(`${e} exited with code ${o}`);this.commandName=e,this.exitCode=o}}var y=(e,o,t)=>oi(e,o,{...t,shell:!1}),A=(e,o)=>{if(o.error)throw Error(`Failed to run ${e}: ${o.error.message}`);if(o.status===null)throw Error(`${e} was killed by signal ${o.signal??"unknown"}`);if(o.status!==0)throw new O(e,o.status)},z=(e)=>{let o=null;for(let t of e)try{t()}catch(i){if(i instanceof O){o??=i;continue}throw i}if(o)throw new O(o.commandName,o.exitCode)};import{accessSync as si,lstatSync as _e,mkdirSync as ri,realpathSync as Me}from"node:fs";import{readFile as ai,writeFile as di}from"node:fs/promises";import U from"node:path";import Ke from"node:process";import{glob as li}from"glob";import ci from"yaml";import{readFileSync as ti}from"node:fs";import{readFile as ii}from"node:fs/promises";import{parse as Xe}from"jsonc-parser";import{z as h}from"zod";var ni=h.looseObject({dependencies:h.record(h.string(),h.string()).optional(),devDependencies:h.record(h.string(),h.string()).optional(),"lint-staged":h.unknown().optional(),name:h.string().optional(),peerDependencies:h.record(h.string(),h.string()).optional(),prettier:h.unknown().optional(),scripts:h.record(h.string(),h.string()).optional(),stylelint:h.unknown().optional(),type:h.string().optional(),version:h.string().optional(),workspace:h.unknown().optional(),workspaces:h.union([h.array(h.string()),h.record(h.string(),h.unknown())]).optional()}),Q=(e)=>{let o=Xe(e),t=ni.safeParse(o);return t.success?t.data:void 0},B=(e="package.json")=>{try{let o=ti(e,"utf-8");return Q(o)}catch{return}},fe=async(e="package.json")=>{try{let o=await ii(e,"utf-8");return Q(o)}catch{return}},Fe=h.looseObject({extends:h.array(h.string()).optional()}),Ye=h.looseObject({compilerOptions:h.looseObject({strict:h.boolean().optional(),strictNullChecks:h.boolean().optional()}).optional()}),we=(e,o)=>{let t=Xe(e),i=o.safeParse(t);return i.success?i.data:void 0};var m=(e)=>{try{return si(e),!0}catch{return!1}},j=()=>{if(m("pnpm-workspace.yaml"))return!0;let e=B();if(!e)return!1;return!!e.workspaces||!!e.workspace},x=(e)=>{let o=U.dirname(e);if(o!=="."){let t=o.startsWith("./")?o.slice(2):o;ri(t,{recursive:!0})}},He=(e,o)=>{let t=U.relative(o,e);return t===""||!t.startsWith("..")&&!U.isAbsolute(t)},We=(e)=>typeof Me==="function"?Me(e):U.resolve(e),pi=(e)=>{let o=e;while(!0)try{return We(o)}catch(t){if(t.code!=="ENOENT")throw t;let i=U.dirname(o);if(i===o)return U.resolve(o);o=i}},ui=(e)=>{let o=We(Ke.cwd()),t=U.resolve(Ke.cwd(),e);if(!He(t,o))throw Error(`Refusing to write outside project: ${e}`);let i=U.dirname(t),n=pi(i);if(!He(n,o))throw Error(`Refusing to write through directory outside project: ${e}`);try{if((typeof _e==="function"?_e(t):void 0)?.isSymbolicLink())throw Error(`Refusing to write through symbolic link: ${e}`);let d=We(t);if(!He(d,o))throw Error(`Refusing to write outside project: ${e}`)}catch(a){if(a.code==="ENOENT")return;throw a}},c=async(e,o)=>{ui(e),x(e),await di(e,o)},G=async({dependencies:e,devDependencies:o,scripts:t,type:i})=>{let n=await fe();if(!n)throw Error("Failed to parse package.json: file is missing or invalid");let a={...n};if(i)a.type=i;if(n.devDependencies||o)a.devDependencies={...n.devDependencies,...o};if(n.dependencies||e)a.dependencies={...n.dependencies,...e};if(n.scripts||t)a.scripts={...n.scripts,...t};await c("package.json",`${JSON.stringify(a,null,2)}
2
+ import pe from"node:process";import{Command as Bs}from"commander";var u={name:"ultracite",version:"7.8.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",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.4.16","@darraghor/eslint-plugin-nestjs-typed":"^7.2.4","@eslint/js":"^10.0.1","@next/eslint-plugin-next":"^16.2.7","@repo/data":"workspace:*","@tanstack/eslint-plugin-query":"^5.101.0","@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.60.1","@typescript-eslint/parser":"^8.60.1","@vitest/eslint-plugin":"^1.6.19","eslint-config-prettier":"^10.1.8","eslint-import-resolver-typescript":"^4.4.5","eslint-plugin-astro":"^1.7.0","eslint-plugin-compat":"^7.0.2","eslint-plugin-cypress":"^6.4.1","eslint-plugin-github":"6.0.0","eslint-plugin-html":"^8.1.4","eslint-plugin-import-x":"^4.16.2","eslint-plugin-jest":"^29.15.2","eslint-plugin-jsx-a11y":"^6.10.2","eslint-plugin-n":"^18.0.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-hooks":"^7.1.1","eslint-plugin-remix":"^1.1.1","eslint-plugin-solid":"^0.14.5","eslint-plugin-sonarjs":"^4.0.3","eslint-plugin-storybook":"^10.4.2","eslint-plugin-svelte":"^3.19.0","eslint-plugin-unicorn":"^64.0.0","eslint-plugin-unused-imports":"^4.4.1","eslint-plugin-vue":"^10.9.2",globals:"^17.6.0",oxlint:"^1.68.0","prettier-plugin-astro":"^0.14.1","prettier-plugin-svelte":"^4.1.0","prettier-plugin-tailwindcss":"^0.8.0","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{existsSync as _t}from"node:fs";import Mt from"node:path";var Pt=(e,o,t)=>{let i=t?.indexOf(e)??-1;if(!t||i===-1)return o;return t.slice(i+1)},me=(e)=>e.map((o)=>o.startsWith("-")?`./${o}`:o),je="**/*.{css,scss,sass,less}",qt=[".css",".scss",".sass",".less"],ei=(e)=>{let o=e.toLowerCase();return qt.some((t)=>o.endsWith(t))},he=(e)=>{if(e.length===0)return[je];let o=[];for(let t of e){if(ei(t)){o.push(t);continue}if(Mt.extname(t)===""){let i=t.replace(/\/+$/u,"");o.push(i==="."||i===""?je:`${i}/${je}`)}}return o},Re=({commandName:e,parsedArgs:o,pathExists:t=_t,rawArgs:i})=>{let n=Pt(e,o,i),a=n.indexOf("--");if(a!==-1)return{files:n.slice(a+1),passthrough:n.slice(0,a)};let d=[],l=[];for(let f of n){if(f.startsWith("-")&&!t(f)){l.push(f);continue}d.push(f)}return{files:d,passthrough:l}};import{sync as oi}from"cross-spawn";class O extends Error{commandName;exitCode;name="LinterExitError";constructor(e,o){super(`${e} exited with code ${o}`);this.commandName=e,this.exitCode=o}}var y=(e,o,t)=>oi(e,o,{...t,shell:!1}),A=(e,o)=>{if(o.error)throw Error(`Failed to run ${e}: ${o.error.message}`);if(o.status===null)throw Error(`${e} was killed by signal ${o.signal??"unknown"}`);if(o.status!==0)throw new O(e,o.status)},z=(e)=>{let o=null;for(let t of e)try{t()}catch(i){if(i instanceof O){o??=i;continue}throw i}if(o)throw new O(o.commandName,o.exitCode)};import{accessSync as si,lstatSync as _e,mkdirSync as ri,realpathSync as Me}from"node:fs";import{readFile as ai,writeFile as di}from"node:fs/promises";import U from"node:path";import Ke from"node:process";import{glob as li}from"glob";import ci from"yaml";import{readFileSync as ti}from"node:fs";import{readFile as ii}from"node:fs/promises";import{parse as Xe}from"jsonc-parser";import{z as h}from"zod";var ni=h.looseObject({dependencies:h.record(h.string(),h.string()).optional(),devDependencies:h.record(h.string(),h.string()).optional(),"lint-staged":h.unknown().optional(),name:h.string().optional(),peerDependencies:h.record(h.string(),h.string()).optional(),prettier:h.unknown().optional(),scripts:h.record(h.string(),h.string()).optional(),stylelint:h.unknown().optional(),type:h.string().optional(),version:h.string().optional(),workspace:h.unknown().optional(),workspaces:h.union([h.array(h.string()),h.record(h.string(),h.unknown())]).optional()}),Q=(e)=>{let o=Xe(e),t=ni.safeParse(o);return t.success?t.data:void 0},B=(e="package.json")=>{try{let o=ti(e,"utf-8");return Q(o)}catch{return}},fe=async(e="package.json")=>{try{let o=await ii(e,"utf-8");return Q(o)}catch{return}},Fe=h.looseObject({extends:h.array(h.string()).optional()}),Ye=h.looseObject({compilerOptions:h.looseObject({strict:h.boolean().optional(),strictNullChecks:h.boolean().optional()}).optional()}),we=(e,o)=>{let t=Xe(e),i=o.safeParse(t);return i.success?i.data:void 0};var m=(e)=>{try{return si(e),!0}catch{return!1}},j=()=>{if(m("pnpm-workspace.yaml"))return!0;let e=B();if(!e)return!1;return!!e.workspaces||!!e.workspace},x=(e)=>{let o=U.dirname(e);if(o!=="."){let t=o.startsWith("./")?o.slice(2):o;ri(t,{recursive:!0})}},He=(e,o)=>{let t=U.relative(o,e);return t===""||!t.startsWith("..")&&!U.isAbsolute(t)},We=(e)=>typeof Me==="function"?Me(e):U.resolve(e),pi=(e)=>{let o=e;while(!0)try{return We(o)}catch(t){if(t.code!=="ENOENT")throw t;let i=U.dirname(o);if(i===o)return U.resolve(o);o=i}},ui=(e)=>{let o=We(Ke.cwd()),t=U.resolve(Ke.cwd(),e);if(!He(t,o))throw Error(`Refusing to write outside project: ${e}`);let i=U.dirname(t),n=pi(i);if(!He(n,o))throw Error(`Refusing to write through directory outside project: ${e}`);try{if((typeof _e==="function"?_e(t):void 0)?.isSymbolicLink())throw Error(`Refusing to write through symbolic link: ${e}`);let d=We(t);if(!He(d,o))throw Error(`Refusing to write outside project: ${e}`)}catch(a){if(a.code==="ENOENT")return;throw a}},c=async(e,o)=>{ui(e),x(e),await di(e,o)},G=async({dependencies:e,devDependencies:o,scripts:t,type:i})=>{let n=await fe();if(!n)throw Error("Failed to parse package.json: file is missing or invalid");let a={...n};if(i)a.type=i;if(n.devDependencies||o)a.devDependencies={...n.devDependencies,...o};if(n.dependencies||e)a.dependencies={...n.dependencies,...e};if(n.scripts||t)a.scripts={...n.scripts,...t};await c("package.json",`${JSON.stringify(a,null,2)}
3
3
  `)},Pe=/^[a-z][a-z0-9-]*$/u,T=(e)=>{if(!Pe.test(e))throw Error(`Invalid framework name "${e}": must match ${Pe}`);return e},V=["biome.json","biome.jsonc",".biome.json",".biome.jsonc"],mi=["eslint.config.mjs","eslint.config.js","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts"],hi=[".oxlintrc.json","oxlint.config.ts"],fi={"@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"]},qe=(e)=>{if(!e)return[];return[...Object.keys(e.dependencies??{}),...Object.keys(e.devDependencies??{}),...Object.keys(e.peerDependencies??{})]},wi=async(e)=>{let o=new Set,t=e?.workspaces;if(Array.isArray(t))for(let i of t)o.add(i);else if(t&&typeof t==="object"){let{packages:i}=t;if(Array.isArray(i)){for(let n of i)if(typeof n==="string")o.add(n)}}if(m("pnpm-workspace.yaml"))try{let i=await ai("pnpm-workspace.yaml","utf-8"),n=ci.parse(i);if(Array.isArray(n?.packages)){for(let a of n.packages)if(typeof a==="string")o.add(a)}}catch{}return[...o]},eo=async()=>{let e=new Set;try{let o=await fe(),t=new Set(qe(o)),i=await wi(o);if(i.length>0){let n=await li(i.map((d)=>`${d.replace(/\/+$/u,"")}/package.json`),{absolute:!1,ignore:["**/node_modules/**"]}),a=await Promise.all(n.map((d)=>fe(d)));for(let d of a)for(let l of qe(d))t.add(l)}for(let n of t){let a=fi[n];if(a)for(let d of a)e.add(d)}}catch{}return[...e]},Z=(e=Ke.cwd())=>{let o=e;while(!0){for(let i of V)if(m(U.join(o,i)))return"biome";for(let i of mi)if(m(U.join(o,i)))return"eslint";for(let i of hi)if(m(U.join(o,i)))return"oxlint";let t=U.dirname(o);if(t===o)break;o=t}return null};var gi=(e,o)=>{let t=["check","--no-errors-on-unmatched",...o];if(e.length>0)t.push(...e);else t.push("./");let i=y("biome",t,{stdio:"inherit"});A("Biome",i)},yi=(e,o)=>{let t=[...o,...e.length>0?e:["."]],i=y("eslint",t,{stdio:"inherit"});A("ESLint",i)},bi=(e,o)=>{let t=["--check",...o,...e.length>0?e:["."]],i=y("prettier",t,{stdio:"inherit"});A("Prettier",i)},vi=(e,o)=>{let t=he(e);if(t.length===0)return;let i=[...o,"--allow-empty-input",...t],n=y("stylelint",i,{stdio:"inherit"});A("Stylelint",n)},Ai=(e,o)=>{let t=[...o,...e.length>0?e:["."]],i=y("oxlint",t,{stdio:"inherit"});A("Oxlint",i)},Si=(e,o)=>{let t=["--check",...o,...e.length>0?e:["."]],i=y("oxfmt",t,{stdio:"inherit"});A("oxfmt",i)},oo=(e=[],o=[])=>{let t=Z(),i=me(e);if(!t)throw Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(t){case"eslint":{z([()=>bi(i,[]),()=>yi(i,o),()=>vi(i,[])]);break}case"oxlint":{z([()=>Si(i,[]),()=>Ai(i,o)]);break}default:gi(i,o)}};import{existsSync as E,readFileSync as ye}from"node:fs";import I from"node:path";import L from"node:process";import{intro as Ui,log as k,outro as ge,spinner as Gi}from"@clack/prompts";import{parse as xi}from"jsonc-parser";var J=(e,o)=>{let t=y(e,["--version"],{encoding:"utf-8"});if(t.status===0&&t.stdout)return{message:`${e} is installed (${String(t.stdout).trim()})`,name:`${e} installation`,status:"pass"};return{message:`${e} is not installed${o?"":" (optional)"}`,name:`${e} installation`,status:o?"fail":"warn"}},Ti=()=>{let e=null,o=null;for(let t of V){let i=I.join(L.cwd(),t);if(E(i)){e=i,o=t;break}}if(!e)return{message:`No Biome config file found (expected one of: ${V.join(", ")})`,name:"Biome configuration",status:"fail"};try{let t=ye(e,"utf-8"),i=xi(t);if(Array.isArray(i?.extends)&&i.extends.includes("ultracite/biome/core"))return{message:`${o} extends ultracite/biome/core`,name:"Biome configuration",status:"pass"};return{message:`${o} exists but doesn't extend ultracite/biome/core`,name:"Biome configuration",status:"warn"}}catch{return{message:`Could not parse ${o} file`,name:"Biome configuration",status:"fail"}}},Ci=()=>{let e=["eslint.config.mjs","eslint.config.js","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts"],o=null;for(let t of e){let i=I.join(L.cwd(),t);if(E(i)){o=i;break}}if(!o)return{message:"No eslint.config.* file found",name:"ESLint configuration",status:"fail"};try{if(ye(o,"utf-8").includes("ultracite/eslint"))return{message:"eslint.config.* imports ultracite/eslint",name:"ESLint configuration",status:"pass"};return{message:"eslint.config.* exists but doesn't import ultracite/eslint",name:"ESLint configuration",status:"warn"}}catch{return{message:"Could not read eslint.config.* file",name:"ESLint configuration",status:"fail"}}},ki=()=>{let e=["prettier.config.mjs","prettier.config.js","prettier.config.cjs","prettier.config.ts",".prettierrc",".prettierrc.json",".prettierrc.mjs",".prettierrc.cjs",".prettierrc.js",".prettierrc.yml",".prettierrc.yaml"];for(let o of e)if(E(I.join(L.cwd(),o)))return{message:`Prettier configuration found (${o})`,name:"Prettier configuration",status:"pass"};return{message:"No Prettier configuration found",name:"Prettier configuration",status:"fail"}},Ei=()=>{let e=["stylelint.config.mjs","stylelint.config.js","stylelint.config.cjs",".stylelintrc",".stylelintrc.json",".stylelintrc.mjs",".stylelintrc.js",".stylelintrc.yml",".stylelintrc.yaml"];for(let o of e)if(E(I.join(L.cwd(),o)))return{message:`Stylelint configuration found (${o})`,name:"Stylelint configuration",status:"pass"};return{message:"No Stylelint configuration found",name:"Stylelint configuration",status:"warn"}},Ii=()=>{let e=I.join(L.cwd(),"oxlint.config.ts");if(!E(e))return{message:"No oxlint.config.ts file found",name:"Oxlint configuration",status:"fail"};try{if(ye(e,"utf-8").includes("ultracite/oxlint/"))return{message:"oxlint.config.ts extends ultracite oxlint config",name:"Oxlint configuration",status:"pass"};return{message:"oxlint.config.ts exists but doesn't extend ultracite config",name:"Oxlint configuration",status:"warn"}}catch{return{message:"Could not read oxlint.config.ts file",name:"Oxlint configuration",status:"fail"}}},Li=()=>{let e=I.join(L.cwd(),"oxfmt.config.ts");if(!E(e))return{message:"No oxfmt.config.ts file found",name:"oxfmt configuration",status:"fail"};try{if(ye(e,"utf-8").includes("ultracite/oxfmt"))return{message:"oxfmt.config.ts extends ultracite oxfmt config",name:"oxfmt configuration",status:"pass"};return{message:"oxfmt.config.ts exists but doesn't extend ultracite config",name:"oxfmt configuration",status:"warn"}}catch{return{message:"Could not read oxfmt.config.ts file",name:"oxfmt configuration",status:"fail"}}},Ni=()=>{let e=I.join(L.cwd(),"package.json");if(!E(e))return{message:"No package.json found",name:"Ultracite dependency",status:"warn"};let o=B(e);if(!o)return{message:"Could not parse package.json",name:"Ultracite dependency",status:"warn"};let t=o.dependencies?.ultracite||o.devDependencies?.ultracite||o.peerDependencies?.ultracite;if(t)return{message:`Ultracite is in package.json (${t})`,name:"Ultracite dependency",status:"pass"};return{message:"Ultracite not found in package.json dependencies",name:"Ultracite dependency",status:"warn"}},Di=(e)=>{let o=[];if(e!=="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((n)=>E(I.join(L.cwd(),n))))o.push("Prettier")}if([".eslintrc",".eslintrc.js",".eslintrc.cjs",".eslintrc.mjs",".eslintrc.json",".eslintrc.yaml",".eslintrc.yml"].some((i)=>E(I.join(L.cwd(),i))))o.push("ESLint (legacy config)");if(o.length>0)return{message:`Found potentially conflicting tools: ${o.join(", ")}`,name:"Conflicting tools",status:"warn"};return{message:"No conflicting formatting/linting tools found",name:"Conflicting tools",status:"pass"}},Bi=(e)=>{let o=[];switch(e){case"biome":{o.push({fn:()=>J("biome",!0),name:"Biome installation"},{fn:Ti,name:"Biome configuration"});break}case"eslint":{o.push({fn:()=>J("eslint",!0),name:"ESLint installation"},{fn:Ci,name:"ESLint configuration"},{fn:()=>J("prettier",!0),name:"Prettier installation"},{fn:ki,name:"Prettier configuration"},{fn:()=>J("stylelint",!1),name:"Stylelint installation"},{fn:Ei,name:"Stylelint configuration"});break}case"oxlint":{o.push({fn:()=>J("oxlint",!0),name:"Oxlint installation"},{fn:Ii,name:"Oxlint configuration"},{fn:()=>J("oxfmt",!0),name:"oxfmt installation"},{fn:Li,name:"oxfmt configuration"});break}default:break}return o.push({fn:Ni,name:"Ultracite dependency"},{fn:()=>Di(e),name:"Conflicting tools"}),o},to=()=>{Ui(`Ultracite v${u.version} Doctor`);let e=Z();if(!e)throw k.error("No linter configuration found. Run `ultracite init` to set up a linter."),ge("Doctor complete"),Error("Doctor checks failed");k.info(`Detected linter: ${e}`);let o=Gi();o.start("Running diagnostics...");let i=Bi(e).map(({fn:l})=>l());o.stop("Diagnostics complete.");for(let l of i)if(l.status==="pass")k.success(l.message);else if(l.status==="warn")k.warn(l.message);else k.error(l.message);let n=i.filter((l)=>l.status==="pass").length,a=i.filter((l)=>l.status==="fail").length,d=i.filter((l)=>l.status==="warn").length;if(k.info(`Summary: ${n} passed, ${d} warnings, ${a} failed`),a>0)throw k.error("Some checks failed. Run 'ultracite init' to fix issues."),ge("Doctor complete"),Error("Doctor checks failed");if(d>0){k.warn("Some optional improvements available. Run 'ultracite init' to configure."),ge("Doctor complete");return}k.success("Everything looks good!"),ge("Doctor complete")};var ji=(e,o)=>{let t=["check","--write","--no-errors-on-unmatched",...o];if(e.length>0)t.push(...e);else t.push("./");let i=y("biome",t,{stdio:"inherit"});A("Biome",i)},Ri=(e,o)=>{let t=["--fix",...o,...e.length>0?e:["."]],i=y("eslint",t,{stdio:"inherit"});A("ESLint",i)},Hi=(e,o)=>{let t=["--write",...o,...e.length>0?e:["."]],i=y("prettier",t,{stdio:"inherit"});A("Prettier",i)},Ki=(e,o)=>{let t=he(e);if(t.length===0)return;let i=["--fix",...o,"--allow-empty-input",...t],n=y("stylelint",i,{stdio:"inherit"});A("Stylelint",n)},Wi=(e,o)=>{let t=o.includes("--unsafe"),i=o.filter((d)=>d!=="--unsafe"),n=[t?"--fix-dangerously":"--fix",...i,...e.length>0?e:["."]],a=y("oxlint",n,{stdio:"inherit"});A("Oxlint",a)},$i=(e,o)=>{let t=["--write",...o,...e.length>0?e:["."]],i=y("oxfmt",t,{stdio:"inherit"});A("oxfmt",i)},io=(e,o=[])=>{let t=Z(),i=me(e);if(!t)throw Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(t){case"eslint":{z([()=>Hi(i,[]),()=>Ri(i,o),()=>Ki(i,[])]);break}case"oxlint":{z([()=>$i(i,[]),()=>Wi(i,o)]);break}default:ji(i,o)}};import ps from"node:process";import{cancel as Y,intro as us,isCancel as _,log as le,multiselect as ce,select as ms,spinner as v}from"@clack/prompts";var no="";var so="";var ro="";var ao="";var lo="";var be="";var co="";var po="";var uo="";var mo="";var ho="";var fo="";var wo="";var ve="";var go="";var yo="";var bo="";var vo="";var Ao="";var So="";var Uo="";var Go="";var xo="";var To="";var Co="";var ko="";var Eo="";var Io="";var Lo="";var No="";var Do="";var Bo="";var jo="";var Ro="";var Ho="";var Ko="";var Wo="";var $o="";var Oo="";var zo="";var Qo="";var Ae=(e,o)=>`# 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultracite",
3
- "version": "7.8.3",
3
+ "version": "7.8.4",
4
4
  "description": "The AI-ready formatter that helps you write and generate code faster.",
5
5
  "keywords": [
6
6
  "biome",