ultracite 6.3.3 → 6.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/core/biome.jsonc +6 -0
- package/config/vue/biome.jsonc +9 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/config/core/biome.jsonc
CHANGED
|
@@ -246,18 +246,23 @@
|
|
|
246
246
|
},
|
|
247
247
|
"noParametersOnlyUsedInRecursion": "error",
|
|
248
248
|
"noShadow": "error",
|
|
249
|
+
"noSyncScripts": "error",
|
|
249
250
|
"noUnusedExpressions": "error",
|
|
250
251
|
"noUselessUndefined": "error",
|
|
251
252
|
"useConsistentArrowReturn": "error",
|
|
253
|
+
"useConsistentGraphqlDescriptions": "error",
|
|
252
254
|
"useDeprecatedDate": "error",
|
|
253
255
|
"useMaxParams": "error",
|
|
256
|
+
"useUniqueGraphqlOperationName": "error",
|
|
254
257
|
|
|
255
258
|
"noContinue": "off",
|
|
259
|
+
"noForIn": "off",
|
|
256
260
|
"noJsxLiterals": "off",
|
|
257
261
|
"noUselessCatchBinding": "off",
|
|
258
262
|
"noUnnecessaryConditions": "off",
|
|
259
263
|
"useArraySortCompare": "off",
|
|
260
264
|
"useExplicitType": "off",
|
|
265
|
+
"useFind": "error",
|
|
261
266
|
"useSortedClasses": {
|
|
262
267
|
"fix": "safe",
|
|
263
268
|
"level": "error",
|
|
@@ -266,6 +271,7 @@
|
|
|
266
271
|
"functions": ["clsx", "cva", "tw", "twMerge", "cn", "twJoin", "tv"]
|
|
267
272
|
}
|
|
268
273
|
},
|
|
274
|
+
"useSpread": "error",
|
|
269
275
|
|
|
270
276
|
/** ------ Project rules use Scanner and are too slow (https://biomejs.dev/linter/domains/#project-rules) ------ **/
|
|
271
277
|
"noDeprecatedImports": "off",
|
package/config/vue/biome.jsonc
CHANGED
|
@@ -15,9 +15,17 @@
|
|
|
15
15
|
"nursery": {
|
|
16
16
|
"noVueDataObjectDeclaration": "error",
|
|
17
17
|
"noVueDuplicateKeys": "error",
|
|
18
|
+
"noVueVIfWithVFor": "error",
|
|
18
19
|
"noVueReservedKeys": "error",
|
|
19
20
|
"noVueReservedProps": "error",
|
|
20
|
-
"
|
|
21
|
+
"useVueHyphenatedAttributes": "error",
|
|
22
|
+
"useVueMultiWordComponentNames": "error",
|
|
23
|
+
"useVueValidVBind": "error",
|
|
24
|
+
"useVueValidVElseIf": "error",
|
|
25
|
+
"useVueValidVElse": "error",
|
|
26
|
+
"useVueValidVHtml": "error",
|
|
27
|
+
"useVueValidVIf": "error",
|
|
28
|
+
"useVueValidVOn": "error"
|
|
21
29
|
},
|
|
22
30
|
"correctness": {
|
|
23
31
|
"noUnusedVariables": "off",
|
package/dist/index.js
CHANGED
|
@@ -117,7 +117,7 @@ ${s}`)}}});var io,me=D(()=>{io=ke({"./husky.ts":()=>(fe(),oe(ze)),"./lefthook.ts
|
|
|
117
117
|
`}else e+=`${o}: '${s}'
|
|
118
118
|
`;return e},mo=async()=>{try{let t=he(await X("./package.json","utf-8"));return t?t.type==="module":!1}catch{return!1}},uo=async t=>{let e=he(await X("./package.json","utf-8"));e&&(e["lint-staged"]?e["lint-staged"]=J(e["lint-staged"],w(t)):e["lint-staged"]=w(t),await j("./package.json",JSON.stringify(e,null,2)))},go=async(t,e)=>{let o=await X(t,"utf-8"),s=he(o);if(!s)return;let n=J(s,w(e));await j(t,JSON.stringify(n,null,2))},ho=async(t,e)=>{let o=await X(t,"utf-8"),s=fo(o);if(!s)return;let n=J(s,w(e));await j(t,po(n))},yo=async(t,e)=>{let n=(await import(ao(t).href)).default||{},i=J(n,w(e)),a=`export default ${JSON.stringify(i,null,2)};
|
|
119
119
|
`;await j(t,a)},wo=async(t,e)=>{delete ee.cache[ee.resolve(`./${t}`)];let o=io(`./${t}`),s=J(o,w(e)),n=`module.exports = ${JSON.stringify(s,null,2)};
|
|
120
|
-
`;await j(t,n)},ge=async t=>{await j(".lintstagedrc.json",JSON.stringify(w(t),null,2))},ko=async(t,e)=>{if(t==="./package.json"){await uo(e);return}if(t.endsWith(".json")||t==="./.lintstagedrc"){await go(t,e);return}if(t.endsWith(".yaml")||t.endsWith(".yml")){await ho(t,e);return}let o=await mo();if(t.endsWith(".mjs")||t.endsWith(".js")&&o){try{await yo(t,e)}catch{await ge(e)}return}if(t.endsWith(".cjs")||t.endsWith(".js")&&!o)try{await wo(t,e)}catch{await ge(e)}},E={exists:async()=>{for(let t of Ke)if(await l(t))return!0;return!1},install:async t=>{await ro("lint-staged",{packageManager:t,workspace:await h()})},create:async t=>{await j(".lintstagedrc.json",JSON.stringify(w(t),null,2))},update:async t=>{let e=null;for(let o of Ke)if(await l(o)){e=o;break}if(!e){await ge(t);return}await ko(e,t)}}});import{initTRPC as Ho}from"@trpc/server";import{createCli as zo}from"trpc-cli";import r from"zod";var b={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"6.3.
|
|
120
|
+
`;await j(t,n)},ge=async t=>{await j(".lintstagedrc.json",JSON.stringify(w(t),null,2))},ko=async(t,e)=>{if(t==="./package.json"){await uo(e);return}if(t.endsWith(".json")||t==="./.lintstagedrc"){await go(t,e);return}if(t.endsWith(".yaml")||t.endsWith(".yml")){await ho(t,e);return}let o=await mo();if(t.endsWith(".mjs")||t.endsWith(".js")&&o){try{await yo(t,e)}catch{await ge(e)}return}if(t.endsWith(".cjs")||t.endsWith(".js")&&!o)try{await wo(t,e)}catch{await ge(e)}},E={exists:async()=>{for(let t of Ke)if(await l(t))return!0;return!1},install:async t=>{await ro("lint-staged",{packageManager:t,workspace:await h()})},create:async t=>{await j(".lintstagedrc.json",JSON.stringify(w(t),null,2))},update:async t=>{let e=null;for(let o of Ke)if(await l(o)){e=o;break}if(!e){await ge(t);return}await ko(e,t)}}});import{initTRPC as Ho}from"@trpc/server";import{createCli as zo}from"trpc-cli";import r from"zod";var b={name:"ultracite",description:"The AI-ready formatter that helps you write and generate code faster.",version:"6.3.4",type:"module",bin:{ultracite:"dist/index.js"},files:["config","dist","README.md"],scripts:{build:"tsup",test:"bun test","test:coverage":"bun test --coverage"},exports:{"./*":"./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.6","@types/node":"^24.10.1",tsup:"^8.5.1",turbo:"^2.6.1"},dependencies:{"@clack/prompts":"^0.11.0","@trpc/server":"^11.7.1",deepmerge:"^4.3.1",glob:"^12.0.0","jsonc-parser":"^3.3.1",nypm:"^0.6.2","trpc-cli":"^0.12.0",zod:"^4.1.12"},packageManager:"bun@1.3.2"};m();import{spawnSync as dt}from"child_process";import ve from"process";var se=t=>{let e=t?.[0]||[],o=t?.[1]["diagnostic-level"],s=["npx","@biomejs/biome","check","--no-errors-on-unmatched"];o&&s.push(`--diagnostic-level=${o}`),e.length>0?s.push(...L(e)):s.push("./");let n=s.join(" "),i=dt(n,{stdio:"inherit",shell:!0});i.error&&(console.error("Failed to run Ultracite:",i.error.message),ve.exit(1)),i.status!==0&&ve.exit(i.status??1)};import{spawnSync as Pt}from"child_process";import{existsSync as T}from"fs";import{readFile as Ee}from"fs/promises";import{join as M}from"path";import{parse as St}from"jsonc-parser";m();import{readFile as Ce,unlink as ft,writeFile as pt}from"fs/promises";import{parse as je}from"jsonc-parser";import{removeDependency as mt}from"nypm";var H=[".eslintrc",".eslintrc.js",".eslintrc.json",".eslintrc.yml",".eslintrc.yaml",".eslintrc.config.js","eslint.config.js","eslint.config.mjs","eslint.config.cjs",".eslintignore"],Pe=async()=>{try{let t=await Ce("package.json","utf-8"),e=je(t);if(!e||typeof e!="object")return[];let o=e.dependencies||{},s=e.devDependencies||{},n={...o,...s};return Object.keys(n).filter(i=>i.includes("eslint"))}catch{return[]}},ut=async(t,e)=>{if(e.length!==0)try{for(let o of e)await mt(o,{packageManager:t})}catch(o){console.warn(o)}},gt=async()=>{let t=[];for(let e of H)if(await l(e))try{await ft(e),t.push(e)}catch(o){console.warn(o)}return t},ht=async()=>{let t="./.vscode/settings.json";if(!await l(t))return!1;try{let e=await Ce(t,"utf-8"),o=je(e);if(!o||typeof o!="object")return!1;let s=!1,n={...o},i=["eslint.enable","eslint.format.enable","eslint.validate","eslint.workingDirectories","eslint.codeAction.showDocumentation","eslint.run","eslint.autoFixOnSave","eslint.quiet","eslint.packageManager","eslint.options","eslint.trace.server"];for(let a of i)a in n&&(delete n[a],s=!0);if("editor.codeActionsOnSave"in n){let a=n["editor.codeActionsOnSave"];if(a&&typeof a=="object"){let c=["source.fixAll.eslint","source.organizeImports.eslint"];for(let f of c)f in a&&(delete a[f],s=!0);Object.keys(a).length===0&&(n["editor.codeActionsOnSave"]=void 0)}}return s?(await pt(t,JSON.stringify(n,null,2)),!0):!1}catch(e){return console.warn(e),!1}},yt=async()=>{if((await Pe()).length>0)return!0;for(let e of H)if(await l(e))return!0;return!1},ne={hasEsLint:yt,remove:async t=>{let e=await Pe();await ut(t,e);let o=await gt(),s=await ht();return{packagesRemoved:e,filesRemoved:o,vsCodeCleaned:s}}};m();import{readFile as Se,unlink as wt,writeFile as kt}from"fs/promises";import{parse as Re}from"jsonc-parser";import{removeDependency as bt}from"nypm";var z=[".prettierrc",".prettierrc.js",".prettierrc.json",".prettierrc.yml",".prettierrc.yaml",".prettierrc.config.js","prettier.config.js","prettier.config.mjs",".prettierignore"],Ae=async()=>{try{let t=await Se("package.json","utf-8"),e=Re(t);if(!e||typeof e!="object")return[];let o=e.dependencies||{},s=e.devDependencies||{},n={...o,...s};return Object.keys(n).filter(i=>i.includes("prettier"))}catch{return[]}},xt=async(t,e)=>{if(e.length!==0)try{for(let o of e)await bt(o,{packageManager:t})}catch(o){console.warn(o)}},vt=async()=>{let t=[];for(let e of z)if(await l(e))try{await wt(e),t.push(e)}catch(o){console.warn(o)}return t},Ct=async()=>{let t="./.vscode/settings.json";if(!await l(t))return!1;try{let e=await Se(t,"utf-8"),o=Re(e);if(!o||typeof o!="object")return!1;let s=!1,n={...o},i=["editor.defaultFormatter","prettier.enable","prettier.requireConfig","prettier.configPath","prettier.printWidth","prettier.tabWidth","prettier.useTabs","prettier.semi","prettier.singleQuote","prettier.quoteProps","prettier.trailingComma","prettier.bracketSpacing","prettier.arrowParens","prettier.endOfLine"];for(let c of i)c in n&&(c==="editor.defaultFormatter"&&n[c]==="esbenp.prettier-vscode"||c!=="editor.defaultFormatter")&&(delete n[c],s=!0);let a=Object.keys(n).filter(c=>c.startsWith("[")&&c.includes("javascript"));for(let c of a){let f=n[c];f&&typeof f=="object"&&"editor.defaultFormatter"in f&&f["editor.defaultFormatter"]==="esbenp.prettier-vscode"&&(delete f["editor.defaultFormatter"],s=!0,Object.keys(f).length===0&&delete n[c])}return s?(await kt(t,JSON.stringify(n,null,2)),!0):!1}catch(e){return console.warn(e),!1}},jt=async()=>{if((await Ae()).length>0)return!0;for(let e of z)if(await l(e))return!0;return!1},ie={hasPrettier:jt,remove:async t=>{let e=await Ae();await xt(t,e);let o=await vt(),s=await Ct();return{packagesRemoved:e,filesRemoved:o,vsCodeCleaned:s}}};var Rt=()=>{let t=Pt("npx @biomejs/biome --version",{shell:!0,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"}},At=async()=>{let t=M(process.cwd(),"biome.json"),e=M(process.cwd(),"biome.jsonc"),o=null;if(T(t)?o=t:T(e)&&(o=e),!o)return{name:"Biome configuration",status:"fail",message:"No biome.json or biome.jsonc file found"};try{let s=await Ee(o,"utf-8"),n=St(s);return Array.isArray(n?.extends)&&n.extends.includes("ultracite/core")?{name:"Biome configuration",status:"pass",message:"biome.json(c) extends ultracite/core"}:{name:"Biome configuration",status:"warn",message:"biome.json(c) exists but doesn't extend ultracite/core"}}catch{return{name:"Biome configuration",status:"fail",message:"Could not parse biome.json(c) file"}}},Et=async()=>{let t=M(process.cwd(),"package.json");if(!T(t))return{name:"Ultracite dependency",status:"warn",message:"No package.json found"};try{let e=JSON.parse(await Ee(t,"utf-8")),o=e.dependencies?.ultracite||e.devDependencies?.ultracite||e.peerDependencies?.ultracite;return o?{name:"Ultracite dependency",status:"pass",message:`Ultracite is in package.json (${o})`}:{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"}}},Ft=()=>{let t=z.some(o=>T(M(process.cwd(),o))),e=H.some(o=>T(M(process.cwd(),o)));if(t||e){let o=[];return t&&o.push("Prettier"),e&&o.push("ESLint"),{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"}},Fe=async()=>{let t=[];console.log(`\u{1FA7A} Running Ultracite doctor...
|
|
121
121
|
`),t.push(Rt()),t.push(await At()),t.push(await Et()),t.push(Ft());let e=t.filter(n=>n.status==="pass").length,o=t.filter(n=>n.status==="fail").length,s=t.filter(n=>n.status==="warn").length;for(let n of t){let i;n.status==="pass"?i="\u2705":n.status==="fail"?i="\u274C":i="\u26A0\uFE0F",console.log(`${i} ${n.name}: ${n.message}`)}console.log(`
|
|
122
122
|
\u{1F4CA} Summary:`),console.log(` ${e} passed, ${s} warnings, ${o} failed`),o>0&&(console.log(`
|
|
123
123
|
\u{1F4A1} To fix issues, run: npx ultracite init`),process.exit(1)),s>0?console.log(`
|
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": "6.3.
|
|
4
|
+
"version": "6.3.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"ultracite": "dist/index.js"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"url": "git+https://github.com/haydenbleasel/ultracite.git"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@biomejs/biome": "2.3.
|
|
44
|
+
"@biomejs/biome": "2.3.6",
|
|
45
45
|
"@types/node": "^24.10.1",
|
|
46
46
|
"tsup": "^8.5.1",
|
|
47
47
|
"turbo": "^2.6.1"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@clack/prompts": "^0.11.0",
|
|
51
51
|
"@trpc/server": "^11.7.1",
|
|
52
52
|
"deepmerge": "^4.3.1",
|
|
53
|
-
"glob": "^
|
|
53
|
+
"glob": "^12.0.0",
|
|
54
54
|
"jsonc-parser": "^3.3.1",
|
|
55
55
|
"nypm": "^0.6.2",
|
|
56
56
|
"trpc-cli": "^0.12.0",
|