ultracite 7.0.1 → 7.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -62
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Ultracite
|
|
2
2
|
|
|
3
|
-
**A
|
|
3
|
+
**A production-grade, zero-configuration preset for ESLint, Biome, and Oxlint.**
|
|
4
4
|
|
|
5
|
-
Ultracite is
|
|
5
|
+
Ultracite is designed to help you and your AI models write consistent and type-safe code without the hassle of configuration. Choose your preferred toolchain and get started in seconds.
|
|
6
6
|
|
|
7
7
|
<div>
|
|
8
8
|
<img src="https://img.shields.io/npm/dy/ultracite" alt="" />
|
|
@@ -12,80 +12,38 @@ Ultracite is a highly opinionated preset for [Biome](https://biomejs.dev), desig
|
|
|
12
12
|
|
|
13
13
|
## Quick Start
|
|
14
14
|
|
|
15
|
-
Install and initialize Ultracite in your project:
|
|
16
|
-
|
|
17
15
|
```sh
|
|
18
16
|
npx ultracite init
|
|
19
17
|
```
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
## Key Features
|
|
24
|
-
|
|
25
|
-
### ⚡ **Subsecond Performance**
|
|
26
|
-
Built in Rust for instant code analysis and processing. On-save checks feel seamless without interrupting your workflow.
|
|
27
|
-
|
|
28
|
-
### 🎯 **Zero-Config by Design**
|
|
29
|
-
Preconfigured rules optimized for Next.js, React, and TypeScript projects with sensible defaults. Customize when needed, but it works perfectly out of the box.
|
|
30
|
-
|
|
31
|
-
### 🛡️ **Maximum Type Safety**
|
|
32
|
-
Enforces strict type checking and best practices by default, catching type errors and preventing unsafe code patterns before they become problems.
|
|
33
|
-
|
|
34
|
-
### 🏗️ **Monorepo Ready**
|
|
35
|
-
Unified toolchain configuration across all packages and apps, eliminating thousands of lines of duplicate config files while maintaining consistency.
|
|
36
|
-
|
|
37
|
-
### 🤖 **AI-Friendly**
|
|
38
|
-
Ensures consistent code style and quality across all team members and AI models, eliminating debates over formatting and reducing code review friction. Supports Copilot, Cursor, Windsurf, Zed, Claude Code, and Codex.
|
|
39
|
-
|
|
40
|
-
### 🔧 **Intuitive and Robust**
|
|
41
|
-
Automatically reformats code and fixes lint issues on save, with clear error reporting for issues that need manual attention.
|
|
42
|
-
|
|
43
|
-
## How It Works
|
|
44
|
-
|
|
45
|
-
Once set up, Ultracite runs mostly in the background:
|
|
19
|
+
The interactive setup will guide you through selecting your formatter/linter, framework, editor, and AI agents.
|
|
46
20
|
|
|
47
|
-
|
|
48
|
-
- **Lint fixes** applied automatically when possible
|
|
49
|
-
- **Type safety** enforced with strict rules
|
|
50
|
-
- **Import organization** and cleanup
|
|
51
|
-
- **Accessibility improvements** built-in
|
|
21
|
+
## Supported Tools
|
|
52
22
|
|
|
53
|
-
|
|
23
|
+
- **Biome** — All-in-one formatting and linting
|
|
24
|
+
- **ESLint + Prettier + Stylelint** — Most mature ecosystem with the largest plugin support
|
|
25
|
+
- **Oxlint + Oxfmt** — 50-100x faster than ESLint, part of the Oxc ecosystem
|
|
54
26
|
|
|
55
|
-
##
|
|
27
|
+
## Key Features
|
|
56
28
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
npx ultracite fix
|
|
29
|
+
### ⚡ Subsecond Performance
|
|
30
|
+
Built on Rust-based tools for instant code analysis. On-save checks feel seamless without interrupting your workflow.
|
|
60
31
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
```
|
|
32
|
+
### 🎯 Zero-Config by Design
|
|
33
|
+
Hundreds of preconfigured rules optimized for JavaScript and TypeScript projects. Customize when needed, but it works perfectly out of the box.
|
|
64
34
|
|
|
65
|
-
|
|
35
|
+
### 🤖 AI-Ready
|
|
36
|
+
Generate rules for 20+ AI agents including Claude Code, GitHub Copilot, Cursor, Gemini, and more. Ensures consistent code style across all team members and AI models.
|
|
66
37
|
|
|
67
|
-
|
|
38
|
+
### 🏗️ Monorepo Ready
|
|
39
|
+
Unified toolchain configuration across all packages and apps, eliminating duplicate config files while maintaining consistency.
|
|
68
40
|
|
|
69
|
-
|
|
70
|
-
bun test
|
|
71
|
-
```
|
|
41
|
+
## Ultracite Cloud
|
|
72
42
|
|
|
73
|
-
|
|
43
|
+
Automated linting and AI-powered fixes for your repositories. Connect your repos and let Ultracite automatically review pull requests, run scheduled lint checks, and fix issues with Claude.
|
|
74
44
|
|
|
75
|
-
|
|
76
|
-
bun test:coverage
|
|
77
|
-
```
|
|
45
|
+
Learn more at [ultracite.ai/cloud](https://www.ultracite.ai/cloud)
|
|
78
46
|
|
|
79
47
|
---
|
|
80
48
|
|
|
81
|
-
Read the [docs](https://
|
|
82
|
-
|
|
83
|
-
## Sponsors
|
|
84
|
-
|
|
85
|
-
Thank you to all our sponsors!
|
|
86
|
-
|
|
87
|
-
### CodeRabbit
|
|
88
|
-
|
|
89
|
-

|
|
90
|
-
|
|
91
|
-
[CodeRabbit](https://www.coderabbit.ai/) helps you cut code review time & bugs in half. Supercharge your entire team with AI-driven contextual feedback. Supports all languages!
|
|
49
|
+
Read the [docs](https://docs.ultracite.ai/) for detailed setup instructions, configuration options, and examples.
|
package/dist/index.js
CHANGED
|
@@ -168,7 +168,7 @@ export default defineConfig([
|
|
|
168
168
|
"arrowParens": "always",
|
|
169
169
|
"proseWrap": "never",
|
|
170
170
|
"printWidth": 80,
|
|
171
|
-
}`}],vscodeExtensionId:"oxc.oxc-vscode"}];var e2=["react","next","solid","vue","svelte","qwik","remix","angular","astro"],i2=["husky","lefthook","lint-staged","pre-commit"],o2=["eslint","prettier"],v={linters:s1.map(t=>t.id),editorConfigs:x.map(t=>t.id),agents:_.map(t=>t.id),integrations:i2,hooks:x.filter(t=>t.hooks).map(t=>t.id),frameworks:e2,migrations:o2};import{initTRPC as pi}from"@trpc/server";import{packageManagers as gi}from"nypm";import{createCli as ui}from"trpc-cli";import d from"zod";var y={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"7.0.1",type:"module",bin:{ultracite:"dist/index.js"},files:["config","dist","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.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":"catalog:","@eslint/js":"^9.39.2","@next/eslint-plugin-next":"^16.1.1","@repo/data":"workspace:*","@tanstack/eslint-plugin-query":"^5.91.2","@types/node":"catalog:","@typescript-eslint/eslint-plugin":"^8.51.0","@typescript-eslint/parser":"^8.51.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.0.2","eslint-plugin-cypress":"^5.2.0","eslint-plugin-github":"6.0.0","eslint-plugin-html":"^8.1.3","eslint-plugin-import":"^2.32.0","eslint-plugin-jest":"^29.12.0","eslint-plugin-jsx-a11y":"^6.10.2","eslint-plugin-n":"^17.23.1","eslint-plugin-prettier":"^5.5.4","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.1.11","eslint-plugin-svelte":"^3.13.1","eslint-plugin-tailwindcss":"^3.18.2","eslint-plugin-unicorn":"^62.0.0","eslint-plugin-unused-imports":"^4.3.0","eslint-plugin-vue":"^10.6.2",globals:"^16.5.0","prettier-plugin-tailwindcss":"^0.7.2","stylelint-config-idiomatic-order":"^10.0.0","stylelint-config-standard":"^39.0.1","stylelint-prettier":"^5.0.3",tsup:"^8.5.1"},dependencies:{"@clack/prompts":"^0.11.0","@trpc/server":"^11.8.1",deepmerge:"^4.3.1",glob:"^13.0.0","jsonc-parser":"^3.3.1",nypm:"^0.6.2",oxlint:"^1.36.0","trpc-cli":"^0.12.1",zod:"^4.3.2"},packageManager:"bun@1.3.5"};f();import{spawnSync as L}from"child_process";import R from"process";import{detectPackageManager as D,dlxCommand as N}from"nypm";var u2=async(t,e)=>{let i=["check","--no-errors-on-unmatched"];e&&i.push(`--diagnostic-level=${e}`),t.length>0?i.push(...u(t)):i.push("./");let n=(await D(R.cwd()))?.name||"npm",s=N(n,"@biomejs/biome",{args:i,short:n==="npm"}),r=L(s,{stdio:"inherit",shell:!0});if(r.error)throw new Error(`Failed to run Biome: ${r.error.message}`);return{hasErrors:r.status!==0}},h2=async t=>{let e=t.length>0?u(t):["."],o=(await D(R.cwd()))?.name||"npm",n=N(o,"eslint",{args:e,short:o==="npm"}),s=L(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run ESLint: ${s.error.message}`);return{hasErrors:s.status!==0}},w2=async t=>{let e=["--check",...t.length>0?u(t):["."]],o=(await D(R.cwd()))?.name||"npm",n=N(o,"prettier",{args:e,short:o==="npm"}),s=L(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Prettier: ${s.error.message}`);return{hasErrors:s.status!==0}},x2=async t=>{let e=t.length>0?u(t):["."],o=(await D(R.cwd()))?.name||"npm",n=N(o,"stylelint",{args:e,short:o==="npm"}),s=L(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Stylelint: ${s.error.message}`);return{hasErrors:s.status!==0}},v2=async t=>{let e=t.length>0?u(t):["."],o=(await D(R.cwd()))?.name||"npm",n=N(o,"oxlint",{args:e,short:o==="npm"}),s=L(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Oxlint: ${s.error.message}`);return{hasErrors:s.status!==0}},y2=async t=>{let e=["--check",...t.length>0?u(t):["."]],o=(await D(R.cwd()))?.name||"npm",n=N(o,"oxfmt",{args:e,short:o==="npm"}),s=L(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run oxfmt: ${s.error.message}`);return{hasErrors:s.status!==0}},St=async t=>{let e=t?.[0]||[],i=t?.[1]["diagnostic-level"],n=t?.[1].linter||await r1();if(!n)throw new Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(n){case"eslint":{let s=await w2(e),r=await h2(e),a=await x2(e);return{hasErrors:s.hasErrors||r.hasErrors||a.hasErrors}}case"oxlint":{let s=await y2(e),r=await v2(e);return{hasErrors:s.hasErrors||r.hasErrors}}default:return u2(e,i)}};import{spawnSync as j1}from"child_process";import{existsSync as A}from"fs";import{readFile as c1}from"fs/promises";import{join as O}from"path";import w from"process";import{intro as k2,log as a1,outro as S1,spinner as b2}from"@clack/prompts";import{parse as jt}from"jsonc-parser";import{detectPackageManager as l1,dlxCommand as d1}from"nypm";var z2=[".prettierrc",".prettierrc.js",".prettierrc.cjs",".prettierrc.mjs",".prettierrc.json",".prettierrc.yaml",".prettierrc.yml","prettier.config.js","prettier.config.mjs","prettier.config.cjs"],C2=[".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"],S2=async()=>{let e=(await l1(w.cwd()))?.name||"npm",i=d1(e,"@biomejs/biome",{args:["--version"],short:e==="npm"}),o=j1(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"}},j2=async()=>{let e=(await l1(w.cwd()))?.name||"npm",i=d1(e,"eslint",{args:["--version"],short:e==="npm"}),o=j1(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)"}},P2=async()=>{let e=(await l1(w.cwd()))?.name||"npm",i=d1(e,"oxlint",{args:["--version"],short:e==="npm"}),o=j1(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)"}},E2=async()=>{let t=O(w.cwd(),"biome.json"),e=O(w.cwd(),"biome.jsonc"),i=null;if(A(t)?i=t:A(e)&&(i=e),!i)return{name:"Biome configuration",status:"warn",message:"No biome.json or biome.jsonc file found"};try{let o=await c1(i,"utf-8"),n=jt(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"}}},A2=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=O(w.cwd(),i);if(A(o)){e=o;break}}if(!e)return{name:"ESLint configuration",status:"warn",message:"No eslint.config.* file found (optional)"};try{return(await c1(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"}}},O2=async()=>{let t=O(w.cwd(),".oxlintrc.json");if(!A(t))return{name:"Oxlint configuration",status:"warn",message:"No .oxlintrc.json file found (optional)"};try{let e=await c1(t,"utf-8"),i=jt(e);return Array.isArray(i?.extends)&&i.extends.includes("ultracite/oxlint/core")?{name:"Oxlint configuration",status:"pass",message:".oxlintrc.json extends ultracite/oxlint/core"}:{name:"Oxlint configuration",status:"warn",message:".oxlintrc.json exists but doesn't extend ultracite/oxlint/core"}}catch{return{name:"Oxlint configuration",status:"fail",message:"Could not parse .oxlintrc.json file"}}},B2=async()=>{let t=O(w.cwd(),"package.json");if(!A(t))return{name:"Ultracite dependency",status:"warn",message:"No package.json found"};try{let e=JSON.parse(await c1(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"}}},I2=()=>{let t=z2.some(o=>A(O(w.cwd(),o))),i=C2.filter(o=>!o.startsWith("eslint.config")).some(o=>A(O(w.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"}},C=async(t,e)=>{let i=b2();i.start(`Checking ${e}...`);let o=await t();return o.status==="pass"||o.status,i.stop(o.message),o},Pt=async()=>{k2(`Ultracite v${y.version} Doctor`);let e=(await l1(w.cwd()))?.name||"npm",i=d1(e,"ultracite",{args:["init"],short:e==="npm"}),o=[];o.push(await C(S2,"Biome installation")),o.push(await C(j2,"ESLint installation")),o.push(await C(P2,"Oxlint installation")),o.push(await C(E2,"Biome configuration")),o.push(await C(A2,"ESLint configuration")),o.push(await C(O2,"Oxlint configuration")),o.push(await C(B2,"Ultracite dependency")),o.push(await C(I2,"conflicting tools"));let n=o.filter(a=>a.status==="pass").length,s=o.filter(a=>a.status==="fail").length,r=o.filter(a=>a.status==="warn").length;if(a1.info(`Summary: ${n} passed, ${r} warnings, ${s} failed`),s>0)throw a1.error(`Some checks failed. Run '${i}' to fix issues.`),S1("Doctor complete"),new Error("Doctor checks failed");if(r>0){a1.warn(`Some optional improvements available. Run '${i}' to configure.`),S1("Doctor complete");return}a1.success("Everything looks good!"),S1("Doctor complete")};f();import{spawnSync as T}from"child_process";import G from"process";import{detectPackageManager as M,dlxCommand as J}from"nypm";var F2=async(t,e)=>{let i=["check","--write","--no-errors-on-unmatched"];e&&i.push("--unsafe"),t.length>0?i.push(...u(t)):i.push("./");let n=(await M(G.cwd()))?.name||"npm",s=J(n,"@biomejs/biome",{args:i,short:n==="npm"}),r=T(s,{stdio:"inherit",shell:!0});if(r.error)throw new Error(`Failed to run Biome: ${r.error.message}`);return{hasErrors:r.status!==0}},$2=async t=>{let e=["--fix",...t.length>0?u(t):["."]],o=(await M(G.cwd()))?.name||"npm",n=J(o,"eslint",{args:e,short:o==="npm"}),s=T(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run ESLint: ${s.error.message}`);return{hasErrors:s.status!==0}},_2=async t=>{let e=["--write",...t.length>0?u(t):["."]],o=(await M(G.cwd()))?.name||"npm",n=J(o,"prettier",{args:e,short:o==="npm"}),s=T(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Prettier: ${s.error.message}`);return{hasErrors:s.status!==0}},U2=async t=>{let e=["--fix",...t.length>0?u(t):["."]],o=(await M(G.cwd()))?.name||"npm",n=J(o,"stylelint",{args:e,short:o==="npm"}),s=T(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Stylelint: ${s.error.message}`);return{hasErrors:s.status!==0}},L2=async t=>{let e=["--fix",...t.length>0?u(t):["."]],o=(await M(G.cwd()))?.name||"npm",n=J(o,"oxlint",{args:e,short:o==="npm"}),s=T(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Oxlint: ${s.error.message}`);return{hasErrors:s.status!==0}},R2=async t=>{let e=["--write",...t.length>0?u(t):["."]],o=(await M(G.cwd()))?.name||"npm",n=J(o,"oxfmt",{args:e,short:o==="npm"}),s=T(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run oxfmt: ${s.error.message}`);return{hasErrors:s.status!==0}},Et=async(t,e={})=>{let i=e.linter||await r1();if(!i)throw new Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(i){case"eslint":{let o=await _2(t),n=await $2(t),s=await U2(t);return{hasErrors:o.hasErrors||n.hasErrors||s.hasErrors}}case"oxlint":{let o=await R2(t),n=await L2(t);return{hasErrors:o.hasErrors||n.hasErrors}}default:return F2(t,e.unsafe)}};import V3 from"process";import{cancel as V,intro as X3,isCancel as X,log as k1,multiselect as q,select as Q3,spinner as p}from"@clack/prompts";import{addDevDependency as K3,detectPackageManager as Y3}from"nypm";import{readFile as D2,writeFile as P1}from"fs/promises";var At=t=>`# Ultracite Code Standards
|
|
171
|
+
}`}],vscodeExtensionId:"oxc.oxc-vscode"}];var e2=["react","next","solid","vue","svelte","qwik","remix","angular","astro"],i2=["husky","lefthook","lint-staged","pre-commit"],o2=["eslint","prettier"],v={linters:s1.map(t=>t.id),editorConfigs:x.map(t=>t.id),agents:_.map(t=>t.id),integrations:i2,hooks:x.filter(t=>t.hooks).map(t=>t.id),frameworks:e2,migrations:o2};import{initTRPC as pi}from"@trpc/server";import{packageManagers as gi}from"nypm";import{createCli as ui}from"trpc-cli";import d from"zod";var y={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"7.0.2",type:"module",bin:{ultracite:"dist/index.js"},files:["config","dist","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.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.10","@eslint/js":"^9.39.2","@next/eslint-plugin-next":"^16.1.1","@repo/data":"workspace:*","@tanstack/eslint-plugin-query":"^5.91.2","@types/node":"^25.0.3","@typescript-eslint/eslint-plugin":"^8.51.0","@typescript-eslint/parser":"^8.51.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.0.2","eslint-plugin-cypress":"^5.2.0","eslint-plugin-github":"6.0.0","eslint-plugin-html":"^8.1.3","eslint-plugin-import":"^2.32.0","eslint-plugin-jest":"^29.12.0","eslint-plugin-jsx-a11y":"^6.10.2","eslint-plugin-n":"^17.23.1","eslint-plugin-prettier":"^5.5.4","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.1.11","eslint-plugin-svelte":"^3.13.1","eslint-plugin-tailwindcss":"^3.18.2","eslint-plugin-unicorn":"^62.0.0","eslint-plugin-unused-imports":"^4.3.0","eslint-plugin-vue":"^10.6.2",globals:"^16.5.0","prettier-plugin-tailwindcss":"^0.7.2","stylelint-config-idiomatic-order":"^10.0.0","stylelint-config-standard":"^39.0.1","stylelint-prettier":"^5.0.3",tsup:"^8.5.1"},dependencies:{"@clack/prompts":"^0.11.0","@trpc/server":"^11.8.1",deepmerge:"^4.3.1",glob:"^13.0.0","jsonc-parser":"^3.3.1",nypm:"^0.6.2",oxlint:"^1.36.0","trpc-cli":"^0.12.1",zod:"^4.3.2"},packageManager:"bun@1.3.5"};f();import{spawnSync as L}from"child_process";import R from"process";import{detectPackageManager as D,dlxCommand as N}from"nypm";var u2=async(t,e)=>{let i=["check","--no-errors-on-unmatched"];e&&i.push(`--diagnostic-level=${e}`),t.length>0?i.push(...u(t)):i.push("./");let n=(await D(R.cwd()))?.name||"npm",s=N(n,"@biomejs/biome",{args:i,short:n==="npm"}),r=L(s,{stdio:"inherit",shell:!0});if(r.error)throw new Error(`Failed to run Biome: ${r.error.message}`);return{hasErrors:r.status!==0}},h2=async t=>{let e=t.length>0?u(t):["."],o=(await D(R.cwd()))?.name||"npm",n=N(o,"eslint",{args:e,short:o==="npm"}),s=L(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run ESLint: ${s.error.message}`);return{hasErrors:s.status!==0}},w2=async t=>{let e=["--check",...t.length>0?u(t):["."]],o=(await D(R.cwd()))?.name||"npm",n=N(o,"prettier",{args:e,short:o==="npm"}),s=L(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Prettier: ${s.error.message}`);return{hasErrors:s.status!==0}},x2=async t=>{let e=t.length>0?u(t):["."],o=(await D(R.cwd()))?.name||"npm",n=N(o,"stylelint",{args:e,short:o==="npm"}),s=L(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Stylelint: ${s.error.message}`);return{hasErrors:s.status!==0}},v2=async t=>{let e=t.length>0?u(t):["."],o=(await D(R.cwd()))?.name||"npm",n=N(o,"oxlint",{args:e,short:o==="npm"}),s=L(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Oxlint: ${s.error.message}`);return{hasErrors:s.status!==0}},y2=async t=>{let e=["--check",...t.length>0?u(t):["."]],o=(await D(R.cwd()))?.name||"npm",n=N(o,"oxfmt",{args:e,short:o==="npm"}),s=L(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run oxfmt: ${s.error.message}`);return{hasErrors:s.status!==0}},St=async t=>{let e=t?.[0]||[],i=t?.[1]["diagnostic-level"],n=t?.[1].linter||await r1();if(!n)throw new Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(n){case"eslint":{let s=await w2(e),r=await h2(e),a=await x2(e);return{hasErrors:s.hasErrors||r.hasErrors||a.hasErrors}}case"oxlint":{let s=await y2(e),r=await v2(e);return{hasErrors:s.hasErrors||r.hasErrors}}default:return u2(e,i)}};import{spawnSync as j1}from"child_process";import{existsSync as A}from"fs";import{readFile as c1}from"fs/promises";import{join as O}from"path";import w from"process";import{intro as k2,log as a1,outro as S1,spinner as b2}from"@clack/prompts";import{parse as jt}from"jsonc-parser";import{detectPackageManager as l1,dlxCommand as d1}from"nypm";var z2=[".prettierrc",".prettierrc.js",".prettierrc.cjs",".prettierrc.mjs",".prettierrc.json",".prettierrc.yaml",".prettierrc.yml","prettier.config.js","prettier.config.mjs","prettier.config.cjs"],C2=[".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"],S2=async()=>{let e=(await l1(w.cwd()))?.name||"npm",i=d1(e,"@biomejs/biome",{args:["--version"],short:e==="npm"}),o=j1(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"}},j2=async()=>{let e=(await l1(w.cwd()))?.name||"npm",i=d1(e,"eslint",{args:["--version"],short:e==="npm"}),o=j1(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)"}},P2=async()=>{let e=(await l1(w.cwd()))?.name||"npm",i=d1(e,"oxlint",{args:["--version"],short:e==="npm"}),o=j1(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)"}},E2=async()=>{let t=O(w.cwd(),"biome.json"),e=O(w.cwd(),"biome.jsonc"),i=null;if(A(t)?i=t:A(e)&&(i=e),!i)return{name:"Biome configuration",status:"warn",message:"No biome.json or biome.jsonc file found"};try{let o=await c1(i,"utf-8"),n=jt(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"}}},A2=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=O(w.cwd(),i);if(A(o)){e=o;break}}if(!e)return{name:"ESLint configuration",status:"warn",message:"No eslint.config.* file found (optional)"};try{return(await c1(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"}}},O2=async()=>{let t=O(w.cwd(),".oxlintrc.json");if(!A(t))return{name:"Oxlint configuration",status:"warn",message:"No .oxlintrc.json file found (optional)"};try{let e=await c1(t,"utf-8"),i=jt(e);return Array.isArray(i?.extends)&&i.extends.includes("ultracite/oxlint/core")?{name:"Oxlint configuration",status:"pass",message:".oxlintrc.json extends ultracite/oxlint/core"}:{name:"Oxlint configuration",status:"warn",message:".oxlintrc.json exists but doesn't extend ultracite/oxlint/core"}}catch{return{name:"Oxlint configuration",status:"fail",message:"Could not parse .oxlintrc.json file"}}},B2=async()=>{let t=O(w.cwd(),"package.json");if(!A(t))return{name:"Ultracite dependency",status:"warn",message:"No package.json found"};try{let e=JSON.parse(await c1(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"}}},I2=()=>{let t=z2.some(o=>A(O(w.cwd(),o))),i=C2.filter(o=>!o.startsWith("eslint.config")).some(o=>A(O(w.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"}},C=async(t,e)=>{let i=b2();i.start(`Checking ${e}...`);let o=await t();return o.status==="pass"||o.status,i.stop(o.message),o},Pt=async()=>{k2(`Ultracite v${y.version} Doctor`);let e=(await l1(w.cwd()))?.name||"npm",i=d1(e,"ultracite",{args:["init"],short:e==="npm"}),o=[];o.push(await C(S2,"Biome installation")),o.push(await C(j2,"ESLint installation")),o.push(await C(P2,"Oxlint installation")),o.push(await C(E2,"Biome configuration")),o.push(await C(A2,"ESLint configuration")),o.push(await C(O2,"Oxlint configuration")),o.push(await C(B2,"Ultracite dependency")),o.push(await C(I2,"conflicting tools"));let n=o.filter(a=>a.status==="pass").length,s=o.filter(a=>a.status==="fail").length,r=o.filter(a=>a.status==="warn").length;if(a1.info(`Summary: ${n} passed, ${r} warnings, ${s} failed`),s>0)throw a1.error(`Some checks failed. Run '${i}' to fix issues.`),S1("Doctor complete"),new Error("Doctor checks failed");if(r>0){a1.warn(`Some optional improvements available. Run '${i}' to configure.`),S1("Doctor complete");return}a1.success("Everything looks good!"),S1("Doctor complete")};f();import{spawnSync as T}from"child_process";import G from"process";import{detectPackageManager as M,dlxCommand as J}from"nypm";var F2=async(t,e)=>{let i=["check","--write","--no-errors-on-unmatched"];e&&i.push("--unsafe"),t.length>0?i.push(...u(t)):i.push("./");let n=(await M(G.cwd()))?.name||"npm",s=J(n,"@biomejs/biome",{args:i,short:n==="npm"}),r=T(s,{stdio:"inherit",shell:!0});if(r.error)throw new Error(`Failed to run Biome: ${r.error.message}`);return{hasErrors:r.status!==0}},$2=async t=>{let e=["--fix",...t.length>0?u(t):["."]],o=(await M(G.cwd()))?.name||"npm",n=J(o,"eslint",{args:e,short:o==="npm"}),s=T(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run ESLint: ${s.error.message}`);return{hasErrors:s.status!==0}},_2=async t=>{let e=["--write",...t.length>0?u(t):["."]],o=(await M(G.cwd()))?.name||"npm",n=J(o,"prettier",{args:e,short:o==="npm"}),s=T(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Prettier: ${s.error.message}`);return{hasErrors:s.status!==0}},U2=async t=>{let e=["--fix",...t.length>0?u(t):["."]],o=(await M(G.cwd()))?.name||"npm",n=J(o,"stylelint",{args:e,short:o==="npm"}),s=T(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Stylelint: ${s.error.message}`);return{hasErrors:s.status!==0}},L2=async t=>{let e=["--fix",...t.length>0?u(t):["."]],o=(await M(G.cwd()))?.name||"npm",n=J(o,"oxlint",{args:e,short:o==="npm"}),s=T(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run Oxlint: ${s.error.message}`);return{hasErrors:s.status!==0}},R2=async t=>{let e=["--write",...t.length>0?u(t):["."]],o=(await M(G.cwd()))?.name||"npm",n=J(o,"oxfmt",{args:e,short:o==="npm"}),s=T(n,{stdio:"inherit",shell:!0});if(s.error)throw new Error(`Failed to run oxfmt: ${s.error.message}`);return{hasErrors:s.status!==0}},Et=async(t,e={})=>{let i=e.linter||await r1();if(!i)throw new Error("No linter configuration found. Run `ultracite init` to set up a linter.");switch(i){case"eslint":{let o=await _2(t),n=await $2(t),s=await U2(t);return{hasErrors:o.hasErrors||n.hasErrors||s.hasErrors}}case"oxlint":{let o=await R2(t),n=await L2(t);return{hasErrors:o.hasErrors||n.hasErrors}}default:return F2(t,e.unsafe)}};import V3 from"process";import{cancel as V,intro as X3,isCancel as X,log as k1,multiselect as q,select as Q3,spinner as p}from"@clack/prompts";import{addDevDependency as K3,detectPackageManager as Y3}from"nypm";import{readFile as D2,writeFile as P1}from"fs/promises";var At=t=>`# Ultracite Code Standards
|
|
172
172
|
|
|
173
173
|
This project uses **Ultracite**, a zero-config Biome preset that enforces strict code quality standards through automated formatting and linting.
|
|
174
174
|
|
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.0.
|
|
4
|
+
"version": "7.0.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"ultracite": "dist/index.js"
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"url": "git+https://github.com/haydenbleasel/ultracite.git"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@biomejs/biome": "
|
|
49
|
+
"@biomejs/biome": "2.3.10",
|
|
50
50
|
"@eslint/js": "^9.39.2",
|
|
51
51
|
"@next/eslint-plugin-next": "^16.1.1",
|
|
52
52
|
"@repo/data": "workspace:*",
|
|
53
53
|
"@tanstack/eslint-plugin-query": "^5.91.2",
|
|
54
|
-
"@types/node": "
|
|
54
|
+
"@types/node": "^25.0.3",
|
|
55
55
|
"@typescript-eslint/eslint-plugin": "^8.51.0",
|
|
56
56
|
"@typescript-eslint/parser": "^8.51.0",
|
|
57
57
|
"eslint-config-prettier": "^10.1.8",
|