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