ultracite 5.0.22 → 5.0.24

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/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var jt=Object.create;var G=Object.defineProperty;var St=Object.getOwnPropertyDescriptor;var Ut=Object.getOwnPropertyNames;var At=Object.getPrototypeOf,Mt=Object.prototype.hasOwnProperty;var $e=e=>t=>{var s=e[t];if(s)return s();throw new Error("Module not found in bundle: "+t)};var r=(e,t)=>()=>(e&&(t=e(e=0)),t);var u=(e,t)=>{for(var s in t)G(e,s,{get:t[s],enumerable:!0})},Pe=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ut(t))!Mt.call(e,i)&&i!==s&&G(e,i,{get:()=>t[i],enumerable:!(n=St(t,i))||n.enumerable});return e};var g=(e,t,s)=>(s=e!=null?jt(At(e)):{},Pe(t||!e||!e.__esModule?G(s,"default",{value:e,enumerable:!0}):s,e)),l=e=>Pe(G({},"__esModule",{value:!0}),e);var Je={};u(Je,{format:()=>ne});var Ne,Oe,ne,oe=r(()=>{"use strict";Ne=require("child_process"),Oe=g(require("process")),ne=(e,t={})=>{try{let s=e.length>0?e.join(" "):"./",n=t.unsafe?" --unsafe":"";(0,Ne.execSync)(`npx @biomejs/biome check --write${n} ${s}`,{stdio:"inherit"})}catch(s){let n=s instanceof Error?s.message:"Unknown error";console.error("Failed to run Ultracite:",n),Oe.default.exit(1)}}});var We={};u(We,{exists:()=>o,isMonorepo:()=>Y});var _,Te,o,Y,d=r(()=>{"use strict";_=require("fs/promises"),Te=require("jsonc-parser"),o=async e=>{try{return await(0,_.access)(e),!0}catch{return!1}},Y=async()=>{if(await o("pnpm-workspace.yaml"))return!0;try{let e=(0,Te.parse)(await(0,_.readFile)("package.json","utf-8"));return e?!!e.workspaces:!1}catch{return!1}}});var He={};u(He,{biome:()=>$});var I,Ee,qe,ze,K,$,ae=r(()=>{"use strict";I=require("fs/promises"),Ee=g(require("deepmerge")),qe=require("jsonc-parser");d();ze={$schema:"https://biomejs.dev/schemas/2.0.5/schema.json",extends:["ultracite"]},K="./biome.jsonc",$={exists:()=>o(K),create:()=>(0,I.writeFile)(K,JSON.stringify(ze,null,2)),update:async()=>{let e=await(0,I.readFile)(K,"utf-8"),s=(0,qe.parse)(e)||{},n=s.extends&&Array.isArray(s.extends)?s.extends:[];n.includes("ultracite")||(s.extends=[...n,"ultracite"]);let i={$schema:ze.$schema},m=(0,Ee.default)(s,i);await(0,I.writeFile)(K,JSON.stringify(m,null,2))}}});var Ft,c,h=r(()=>{"use strict";Ft=["Don't use `accessKey` attribute on any HTML element.",'Don\'t set `aria-hidden="true"` on focusable elements.',"Don't add ARIA roles, states, and properties to elements that don't support them.","Don't use distracting elements like `<marquee>` or `<blink>`.","Only use the `scope` prop on `<th>` elements.","Don't assign non-interactive ARIA roles to interactive HTML elements.","Make sure label elements have text content and are associated with an input.","Don't assign interactive ARIA roles to non-interactive HTML elements.","Don't assign `tabIndex` to non-interactive HTML elements.","Don't use positive integers for `tabIndex` property.",'Don\'t include "image", "picture", or "photo" in img `alt` prop.',"Don't use explicit role property that's the same as the implicit/default role.","Make static elements with click handlers use a valid role attribute.","Always include a `title` element for SVG elements.","Give all elements requiring alt text meaningful information for screen readers.","Make sure anchors have content that's accessible to screen readers.","Assign `tabIndex` to non-interactive HTML elements with `aria-activedescendant`.","Include all required ARIA attributes for elements with ARIA roles.","Make sure ARIA properties are valid for the element's supported roles.","Always include a `type` attribute for button elements.","Make elements with interactive roles and handlers focusable.","Give heading elements content that's accessible to screen readers (not hidden with `aria-hidden`).","Always include a `lang` attribute on the html element.","Always include a `title` attribute for iframe elements.","Accompany `onClick` with at least one of: `onKeyUp`, `onKeyDown`, or `onKeyPress`.","Accompany `onMouseOver`/`onMouseOut` with `onFocus`/`onBlur`.","Include caption tracks for audio and video elements.","Use semantic elements instead of role attributes in JSX.","Make sure all anchors are valid and navigable.","Ensure all ARIA properties (`aria-*`) are valid.","Use valid, non-abstract ARIA roles for elements with ARIA roles.","Use valid ARIA state and property values.","Use valid values for the `autocomplete` attribute on input elements.","Use correct ISO language/country codes for the `lang` attribute.","Don't use consecutive spaces in regular expression literals.","Don't use the `arguments` object.","Don't use primitive type aliases or misleading types.","Don't use the comma operator.","Don't use empty type parameters in type aliases and interfaces.","Don't write functions that exceed a given Cognitive Complexity score.","Don't nest describe() blocks too deeply in test files.","Don't use unnecessary boolean casts.","Don't use unnecessary callbacks with flatMap.","Use for...of statements instead of Array.forEach.","Don't create classes that only have static members (like a static namespace).","Don't use this and super in static contexts.","Don't use unnecessary catch clauses.","Don't use unnecessary constructors.","Don't use unnecessary continue statements.","Don't export empty modules that don't change anything.","Don't use unnecessary escape sequences in regular expression literals.","Don't use unnecessary fragments.","Don't use unnecessary labels.","Don't use unnecessary nested block statements.","Don't rename imports, exports, and destructured assignments to the same name.","Don't use unnecessary string or template literal concatenation.","Don't use String.raw in template literals when there are no escape sequences.","Don't use useless case statements in switch statements.","Don't use ternary operators when simpler alternatives exist.","Don't use useless `this` aliasing.","Don't use any or unknown as type constraints.","Don't initialize variables to undefined.","Don't use void operators (they're not familiar).","Use arrow functions instead of function expressions.","Use Date.now() to get milliseconds since the Unix Epoch.","Use .flatMap() instead of map().flat() when possible.","Use literal property access instead of computed property access.","Don't use parseInt() or Number.parseInt() when binary, octal, or hexadecimal literals work.","Use concise optional chaining instead of chained logical expressions.","Use regular expression literals instead of the RegExp constructor when possible.","Don't use number literal object member names that aren't base 10 or use underscore separators.","Remove redundant terms from logical expressions.","Use while loops instead of for loops when you don't need initializer and update expressions.","Don't pass children as props.","Don't reassign const variables.","Don't use constant expressions in conditions.","Don't use `Math.min` and `Math.max` to clamp values when the result is constant.","Don't return a value from a constructor.","Don't use empty character classes in regular expression literals.","Don't use empty destructuring patterns.","Don't call global object properties as functions.","Don't declare functions and vars that are accessible outside their block.","Make sure builtins are correctly instantiated.","Don't use super() incorrectly inside classes. Also check that super() is called in classes that extend other constructors.","Don't use variables and function parameters before they're declared.","Don't use 8 and 9 escape sequences in string literals.","Don't use literal numbers that lose precision.","Don't use the return value of React.render.","Don't assign a value to itself.","Don't return a value from a setter.","Don't compare expressions that modify string case with non-compliant values.","Don't use lexical declarations in switch clauses.","Don't use variables that haven't been declared in the document.","Don't write unreachable code.","Make sure super() is called exactly once on every code path in a class constructor before this is accessed if the class has a superclass.","Don't use control flow statements in finally blocks.","Don't use optional chaining where undefined values aren't allowed.","Don't have unused function parameters.","Don't have unused imports.","Don't have unused labels.","Don't have unused private class members.","Don't have unused variables.","Make sure void (self-closing) elements don't have children.","Don't return a value from a function that has a 'void' return type.","Make sure all dependencies are correctly specified in React hooks.","Make sure all React hooks are called from the top level of component functions.","Use isNaN() when checking for NaN.","Don't forget key props in iterators and collection literals.",'Make sure "for" loop update clauses move the counter in the right direction.',"Make sure typeof expressions are compared to valid values.","Make sure generator functions contain yield.","Don't use await inside loops.","Don't use bitwise operators.","Don't use expressions where the operation doesn't change the value.","Don't destructure props inside JSX components in Solid projects.","Make sure Promise-like statements are handled appropriately.","Don't use __dirname and __filename in the global scope.","Prevent import cycles.","Don't define React components inside other components.","Don't use event handlers on non-interactive elements.","Don't assign to React component props.","Don't use configured elements.","Don't hardcode sensitive data like API keys and tokens.","Don't let variable declarations shadow variables from outer scopes.","Don't use the TypeScript directive @ts-ignore.","Prevent duplicate polyfills from Polyfill.io.","Don't use useless backreferences in regular expressions that always match empty strings.","Don't use unnecessary escapes in string literals.","Don't use useless undefined.","Make sure getters and setters for the same property are next to each other in class and object definitions.","Make sure object literals are declared consistently (defaults to explicit definitions).","Use static Response methods instead of new Response() constructor when possible.","Make sure switch-case statements are exhaustive.","Make sure the `preconnect` attribute is used when using Google Fonts.","Use `Array#{indexOf,lastIndexOf}()` instead of `Array#{findIndex,findLastIndex}()` when looking for the index of an item.","Make sure iterable callbacks return consistent values.",'Use `with { type: "json" }` for JSON module imports.',"Use numeric separators in numeric literals.","Use object spread instead of `Object.assign()` when constructing new objects.","Always use the radix argument when using `parseInt()`.","Make sure JSDoc comment lines start with a single asterisk, except for the first one.","Include a description parameter for `Symbol()`.","Don't use spread (`...`) syntax on accumulators.","Don't use the `delete` operator.","Don't access namespace imports dynamically.","Don't use `<img>` elements in Next.js projects.","Don't use namespace imports.","Declare regex literals at the top level.",'Don\'t use `target="_blank"` without `rel="noopener"`.',"Don't use dangerous JSX props.","Don't use both `children` and `dangerouslySetInnerHTML` props on the same element.","Don't use global `eval()`.","Don't use callbacks in asynchronous tests and hooks.","Don't use TypeScript enums.","Don't export imported variables.","Don't use `<head>` elements in Next.js projects.","Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions.","Don't use TypeScript namespaces.","Don't use negation in `if` statements that have `else` clauses.","Don't use nested ternary expressions.","Don't use non-null assertions with the `!` postfix operator.","Don't reassign function parameters.","Don't use parameter properties in class constructors.","This rule lets you specify global variable names you don't want to use in your application.","Don't use specified modules when loaded by import or require.","Don't use user-defined types.","Don't use constants whose value is the upper-case version of their name.","Use `String.slice()` instead of `String.substr()` and `String.substring()`.","Don't use template literals if you don't need interpolation or special-character handling.","Don't use `else` blocks when the `if` block breaks early.","Don't use yoda expressions.","Don't use Array constructors.","Use `as const` instead of literal types and type annotations.","Use `at()` instead of integer index access.","Follow curly brace conventions.","Use `else if` instead of nested `if` statements in `else` clauses.","Use single `if` statements instead of nested `if` clauses.","Use either `T[]` or `Array<T>` consistently.","Use `new` for all builtins except `String`, `Number`, and `Boolean`.","Use consistent accessibility modifiers on class properties and methods.","Use `const` declarations for variables that are only assigned once.","Put default function parameters and optional function parameters last.","Include a `default` clause in switch statements.","Initialize each enum member value explicitly.","Use the `**` operator instead of `Math.pow`.","Use `export type` for types.","Use `for-of` loops when you need the index to extract an item from the iterated array.","Use `<>...</>` instead of `<Fragment>...</Fragment>`.","Use `import type` for types.","Make sure all enum members are literal values.","Use `node:assert/strict` over `node:assert`.","Use the `node:` protocol for Node.js builtin modules.","Use Number properties instead of global ones.","Don't add extra closing tags for components without children.","Use assignment operator shorthand where possible.","Use function types instead of object types with call signatures.","Use template literals over string concatenation.","Use `new` when throwing an error.","Don't throw non-Error values.","Use `String.trimStart()` and `String.trimEnd()` over `String.trimLeft()` and `String.trimRight()`.","Use standard constants instead of approximated literals.","Don't use Array index in keys.","Don't assign values in expressions.","Don't use async functions as Promise executors.","Don't reassign exceptions in catch clauses.","Don't reassign class members.","Don't insert comments as text nodes.","Don't compare against -0.","Don't use labeled statements that aren't loops.","Don't use void type outside of generic or return types.","Don't use console.","Don't use TypeScript const enum.","Don't use control characters and escape sequences that match control characters in regular expression literals.","Don't use debugger.","Don't assign directly to document.cookie.","Don't import next/document outside of pages/_document.jsx in Next.js projects.","Use `===` and `!==`.","Don't use duplicate case labels.","Don't use duplicate class members.","Don't use duplicate conditions in if-else-if chains.","Don't assign JSX properties multiple times.","Don't use two keys with the same name inside objects.","Don't use duplicate function parameter names.","Don't have duplicate hooks in describe blocks.","Don't use empty block statements and static blocks.","Don't declare empty interfaces.","Don't let variables evolve into any type through reassignments.","Don't use the any type.","Don't use export or module.exports in test files.","Don't misuse the non-null assertion operator (!) in TypeScript files.","Don't let switch clauses fall through.","Don't use focused tests.","Don't reassign function declarations.","Don't allow assignments to native objects and read-only global variables.","Use Number.isFinite instead of global isFinite.","Use Number.isNaN instead of global isNaN.","Don't use the next/head module in pages/_document.js on Next.js projects.","Don't use implicit any type on variable declarations.","Don't assign to imported bindings.","Don't use irregular whitespace characters.","Don't use labels that share a name with a variable.","Don't use characters made with multiple code points in character class syntax.","Make sure to use new and constructor properly.","Make sure the assertion function, like expect, is placed inside an it() function call.","Don't use shorthand assign when the variable appears on both sides.","Don't use octal escape sequences in string literals.","Don't use Object.prototype builtins directly.","Don't redeclare variables, functions, classes, and types in the same scope.",`Don't have redundant "use strict".`,"Don't compare things where both sides are exactly the same.","Don't let identifiers shadow restricted names.","Don't use disabled tests.","Don't use sparse arrays (arrays with holes).",'Watch out for possible "wrong" semicolons inside JSX elements.',"Don't use template literal placeholder syntax in regular strings.","Don't use the then property.","Don't merge interfaces and classes unsafely.","Don't use unsafe negation.","Don't use var.","Don't use with statements in non-strict contexts.","Don't use overload signatures that aren't next to each other.","Make sure async functions actually use await.","Make sure default clauses in switch statements come last.","Make sure to pass a message value when creating a built-in error.","Make sure get methods always return a value.","Use a recommended display strategy with Google Fonts.","Make sure for-in loops include an if statement.","Use Array.isArray() instead of instanceof Array.","Use the namespace keyword instead of the module keyword to declare TypeScript namespaces.","Make sure to use the digits argument with Number#toFixed().",'Make sure to use the "use strict" directive in script files.'],c=`---
2
+ "use strict";var jt=Object.create;var G=Object.defineProperty;var St=Object.getOwnPropertyDescriptor;var Ut=Object.getOwnPropertyNames;var At=Object.getPrototypeOf,Mt=Object.prototype.hasOwnProperty;var Pe=e=>t=>{var s=e[t];if(s)return s();throw new Error("Module not found in bundle: "+t)};var r=(e,t)=>()=>(e&&(t=e(e=0)),t);var u=(e,t)=>{for(var s in t)G(e,s,{get:t[s],enumerable:!0})},$e=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ut(t))!Mt.call(e,a)&&a!==s&&G(e,a,{get:()=>t[a],enumerable:!(n=St(t,a))||n.enumerable});return e};var g=(e,t,s)=>(s=e!=null?jt(At(e)):{},$e(t||!e||!e.__esModule?G(s,"default",{value:e,enumerable:!0}):s,e)),l=e=>$e(G({},"__esModule",{value:!0}),e);var Je={};u(Je,{format:()=>se});var Ne,Oe,se,ne=r(()=>{"use strict";Ne=require("child_process"),Oe=g(require("process")),se=(e,t={})=>{try{let s=e.length>0?e.join(" "):"./",n=t.unsafe?" --unsafe":"";(0,Ne.execSync)(`npx @biomejs/biome check --write${n} ${s}`,{stdio:"inherit"})}catch(s){let n=s instanceof Error?s.message:"Unknown error";console.error("Failed to run Ultracite:",n),Oe.default.exit(1)}}});var We={};u(We,{exists:()=>o,isMonorepo:()=>_});var B,Te,o,_,d=r(()=>{"use strict";B=require("fs/promises"),Te=require("jsonc-parser"),o=async e=>{try{return await(0,B.access)(e),!0}catch{return!1}},_=async()=>{if(await o("pnpm-workspace.yaml"))return!0;try{let e=(0,Te.parse)(await(0,B.readFile)("package.json","utf-8"));return e?!!e.workspaces:!1}catch{return!1}}});var He={};u(He,{biome:()=>$});var P,Ee,qe,ze,oe,$,ae=r(()=>{"use strict";P=require("fs/promises"),Ee=g(require("deepmerge")),qe=require("jsonc-parser");d();ze={$schema:"https://biomejs.dev/schemas/2.0.5/schema.json",extends:["ultracite"]},oe=async()=>await o("./biome.json")?"./biome.json":"./biome.jsonc",$={exists:async()=>{let e=await oe();return o(e)},create:async()=>{let e=await oe();return(0,P.writeFile)(e,JSON.stringify(ze,null,2))},update:async()=>{let e=await oe(),t=await(0,P.readFile)(e,"utf-8"),n=(0,qe.parse)(t)||{},a=n.extends&&Array.isArray(n.extends)?n.extends:[];a.includes("ultracite")||(n.extends=[...a,"ultracite"]);let m={$schema:ze.$schema},b=(0,Ee.default)(n,m);await(0,P.writeFile)(e,JSON.stringify(b,null,2))}}});var Ft,c,h=r(()=>{"use strict";Ft=["Don't use `accessKey` attribute on any HTML element.",'Don\'t set `aria-hidden="true"` on focusable elements.',"Don't add ARIA roles, states, and properties to elements that don't support them.","Don't use distracting elements like `<marquee>` or `<blink>`.","Only use the `scope` prop on `<th>` elements.","Don't assign non-interactive ARIA roles to interactive HTML elements.","Make sure label elements have text content and are associated with an input.","Don't assign interactive ARIA roles to non-interactive HTML elements.","Don't assign `tabIndex` to non-interactive HTML elements.","Don't use positive integers for `tabIndex` property.",'Don\'t include "image", "picture", or "photo" in img `alt` prop.',"Don't use explicit role property that's the same as the implicit/default role.","Make static elements with click handlers use a valid role attribute.","Always include a `title` element for SVG elements.","Give all elements requiring alt text meaningful information for screen readers.","Make sure anchors have content that's accessible to screen readers.","Assign `tabIndex` to non-interactive HTML elements with `aria-activedescendant`.","Include all required ARIA attributes for elements with ARIA roles.","Make sure ARIA properties are valid for the element's supported roles.","Always include a `type` attribute for button elements.","Make elements with interactive roles and handlers focusable.","Give heading elements content that's accessible to screen readers (not hidden with `aria-hidden`).","Always include a `lang` attribute on the html element.","Always include a `title` attribute for iframe elements.","Accompany `onClick` with at least one of: `onKeyUp`, `onKeyDown`, or `onKeyPress`.","Accompany `onMouseOver`/`onMouseOut` with `onFocus`/`onBlur`.","Include caption tracks for audio and video elements.","Use semantic elements instead of role attributes in JSX.","Make sure all anchors are valid and navigable.","Ensure all ARIA properties (`aria-*`) are valid.","Use valid, non-abstract ARIA roles for elements with ARIA roles.","Use valid ARIA state and property values.","Use valid values for the `autocomplete` attribute on input elements.","Use correct ISO language/country codes for the `lang` attribute.","Don't use consecutive spaces in regular expression literals.","Don't use the `arguments` object.","Don't use primitive type aliases or misleading types.","Don't use the comma operator.","Don't use empty type parameters in type aliases and interfaces.","Don't write functions that exceed a given Cognitive Complexity score.","Don't nest describe() blocks too deeply in test files.","Don't use unnecessary boolean casts.","Don't use unnecessary callbacks with flatMap.","Use for...of statements instead of Array.forEach.","Don't create classes that only have static members (like a static namespace).","Don't use this and super in static contexts.","Don't use unnecessary catch clauses.","Don't use unnecessary constructors.","Don't use unnecessary continue statements.","Don't export empty modules that don't change anything.","Don't use unnecessary escape sequences in regular expression literals.","Don't use unnecessary fragments.","Don't use unnecessary labels.","Don't use unnecessary nested block statements.","Don't rename imports, exports, and destructured assignments to the same name.","Don't use unnecessary string or template literal concatenation.","Don't use String.raw in template literals when there are no escape sequences.","Don't use useless case statements in switch statements.","Don't use ternary operators when simpler alternatives exist.","Don't use useless `this` aliasing.","Don't use any or unknown as type constraints.","Don't initialize variables to undefined.","Don't use void operators (they're not familiar).","Use arrow functions instead of function expressions.","Use Date.now() to get milliseconds since the Unix Epoch.","Use .flatMap() instead of map().flat() when possible.","Use literal property access instead of computed property access.","Don't use parseInt() or Number.parseInt() when binary, octal, or hexadecimal literals work.","Use concise optional chaining instead of chained logical expressions.","Use regular expression literals instead of the RegExp constructor when possible.","Don't use number literal object member names that aren't base 10 or use underscore separators.","Remove redundant terms from logical expressions.","Use while loops instead of for loops when you don't need initializer and update expressions.","Don't pass children as props.","Don't reassign const variables.","Don't use constant expressions in conditions.","Don't use `Math.min` and `Math.max` to clamp values when the result is constant.","Don't return a value from a constructor.","Don't use empty character classes in regular expression literals.","Don't use empty destructuring patterns.","Don't call global object properties as functions.","Don't declare functions and vars that are accessible outside their block.","Make sure builtins are correctly instantiated.","Don't use super() incorrectly inside classes. Also check that super() is called in classes that extend other constructors.","Don't use variables and function parameters before they're declared.","Don't use 8 and 9 escape sequences in string literals.","Don't use literal numbers that lose precision.","Don't use the return value of React.render.","Don't assign a value to itself.","Don't return a value from a setter.","Don't compare expressions that modify string case with non-compliant values.","Don't use lexical declarations in switch clauses.","Don't use variables that haven't been declared in the document.","Don't write unreachable code.","Make sure super() is called exactly once on every code path in a class constructor before this is accessed if the class has a superclass.","Don't use control flow statements in finally blocks.","Don't use optional chaining where undefined values aren't allowed.","Don't have unused function parameters.","Don't have unused imports.","Don't have unused labels.","Don't have unused private class members.","Don't have unused variables.","Make sure void (self-closing) elements don't have children.","Don't return a value from a function that has a 'void' return type.","Make sure all dependencies are correctly specified in React hooks.","Make sure all React hooks are called from the top level of component functions.","Use isNaN() when checking for NaN.","Don't forget key props in iterators and collection literals.",'Make sure "for" loop update clauses move the counter in the right direction.',"Make sure typeof expressions are compared to valid values.","Make sure generator functions contain yield.","Don't use await inside loops.","Don't use bitwise operators.","Don't use expressions where the operation doesn't change the value.","Don't destructure props inside JSX components in Solid projects.","Make sure Promise-like statements are handled appropriately.","Don't use __dirname and __filename in the global scope.","Prevent import cycles.","Don't define React components inside other components.","Don't use event handlers on non-interactive elements.","Don't assign to React component props.","Don't use configured elements.","Don't hardcode sensitive data like API keys and tokens.","Don't let variable declarations shadow variables from outer scopes.","Don't use the TypeScript directive @ts-ignore.","Prevent duplicate polyfills from Polyfill.io.","Don't use useless backreferences in regular expressions that always match empty strings.","Don't use unnecessary escapes in string literals.","Don't use useless undefined.","Make sure getters and setters for the same property are next to each other in class and object definitions.","Make sure object literals are declared consistently (defaults to explicit definitions).","Use static Response methods instead of new Response() constructor when possible.","Make sure switch-case statements are exhaustive.","Make sure the `preconnect` attribute is used when using Google Fonts.","Use `Array#{indexOf,lastIndexOf}()` instead of `Array#{findIndex,findLastIndex}()` when looking for the index of an item.","Make sure iterable callbacks return consistent values.",'Use `with { type: "json" }` for JSON module imports.',"Use numeric separators in numeric literals.","Use object spread instead of `Object.assign()` when constructing new objects.","Always use the radix argument when using `parseInt()`.","Make sure JSDoc comment lines start with a single asterisk, except for the first one.","Include a description parameter for `Symbol()`.","Don't use spread (`...`) syntax on accumulators.","Don't use the `delete` operator.","Don't access namespace imports dynamically.","Don't use `<img>` elements in Next.js projects.","Don't use namespace imports.","Declare regex literals at the top level.",'Don\'t use `target="_blank"` without `rel="noopener"`.',"Don't use dangerous JSX props.","Don't use both `children` and `dangerouslySetInnerHTML` props on the same element.","Don't use global `eval()`.","Don't use callbacks in asynchronous tests and hooks.","Don't use TypeScript enums.","Don't export imported variables.","Don't use `<head>` elements in Next.js projects.","Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions.","Don't use TypeScript namespaces.","Don't use negation in `if` statements that have `else` clauses.","Don't use nested ternary expressions.","Don't use non-null assertions with the `!` postfix operator.","Don't reassign function parameters.","Don't use parameter properties in class constructors.","This rule lets you specify global variable names you don't want to use in your application.","Don't use specified modules when loaded by import or require.","Don't use user-defined types.","Don't use constants whose value is the upper-case version of their name.","Use `String.slice()` instead of `String.substr()` and `String.substring()`.","Don't use template literals if you don't need interpolation or special-character handling.","Don't use `else` blocks when the `if` block breaks early.","Don't use yoda expressions.","Don't use Array constructors.","Use `as const` instead of literal types and type annotations.","Use `at()` instead of integer index access.","Follow curly brace conventions.","Use `else if` instead of nested `if` statements in `else` clauses.","Use single `if` statements instead of nested `if` clauses.","Use either `T[]` or `Array<T>` consistently.","Use `new` for all builtins except `String`, `Number`, and `Boolean`.","Use consistent accessibility modifiers on class properties and methods.","Use `const` declarations for variables that are only assigned once.","Put default function parameters and optional function parameters last.","Include a `default` clause in switch statements.","Initialize each enum member value explicitly.","Use the `**` operator instead of `Math.pow`.","Use `export type` for types.","Use `for-of` loops when you need the index to extract an item from the iterated array.","Use `<>...</>` instead of `<Fragment>...</Fragment>`.","Use `import type` for types.","Make sure all enum members are literal values.","Use `node:assert/strict` over `node:assert`.","Use the `node:` protocol for Node.js builtin modules.","Use Number properties instead of global ones.","Don't add extra closing tags for components without children.","Use assignment operator shorthand where possible.","Use function types instead of object types with call signatures.","Use template literals over string concatenation.","Use `new` when throwing an error.","Don't throw non-Error values.","Use `String.trimStart()` and `String.trimEnd()` over `String.trimLeft()` and `String.trimRight()`.","Use standard constants instead of approximated literals.","Don't use Array index in keys.","Don't assign values in expressions.","Don't use async functions as Promise executors.","Don't reassign exceptions in catch clauses.","Don't reassign class members.","Don't insert comments as text nodes.","Don't compare against -0.","Don't use labeled statements that aren't loops.","Don't use void type outside of generic or return types.","Don't use console.","Don't use TypeScript const enum.","Don't use control characters and escape sequences that match control characters in regular expression literals.","Don't use debugger.","Don't assign directly to document.cookie.","Don't import next/document outside of pages/_document.jsx in Next.js projects.","Use `===` and `!==`.","Don't use duplicate case labels.","Don't use duplicate class members.","Don't use duplicate conditions in if-else-if chains.","Don't assign JSX properties multiple times.","Don't use two keys with the same name inside objects.","Don't use duplicate function parameter names.","Don't have duplicate hooks in describe blocks.","Don't use empty block statements and static blocks.","Don't declare empty interfaces.","Don't let variables evolve into any type through reassignments.","Don't use the any type.","Don't use export or module.exports in test files.","Don't misuse the non-null assertion operator (!) in TypeScript files.","Don't let switch clauses fall through.","Don't use focused tests.","Don't reassign function declarations.","Don't allow assignments to native objects and read-only global variables.","Use Number.isFinite instead of global isFinite.","Use Number.isNaN instead of global isNaN.","Don't use the next/head module in pages/_document.js on Next.js projects.","Don't use implicit any type on variable declarations.","Don't assign to imported bindings.","Don't use irregular whitespace characters.","Don't use labels that share a name with a variable.","Don't use characters made with multiple code points in character class syntax.","Make sure to use new and constructor properly.","Make sure the assertion function, like expect, is placed inside an it() function call.","Don't use shorthand assign when the variable appears on both sides.","Don't use octal escape sequences in string literals.","Don't use Object.prototype builtins directly.","Don't redeclare variables, functions, classes, and types in the same scope.",`Don't have redundant "use strict".`,"Don't compare things where both sides are exactly the same.","Don't let identifiers shadow restricted names.","Don't use disabled tests.","Don't use sparse arrays (arrays with holes).",'Watch out for possible "wrong" semicolons inside JSX elements.',"Don't use template literal placeholder syntax in regular strings.","Don't use the then property.","Don't merge interfaces and classes unsafely.","Don't use unsafe negation.","Don't use var.","Don't use with statements in non-strict contexts.","Don't use overload signatures that aren't next to each other.","Make sure async functions actually use await.","Make sure default clauses in switch statements come last.","Make sure to pass a message value when creating a built-in error.","Make sure get methods always return a value.","Use a recommended display strategy with Google Fonts.","Make sure for-in loops include an if statement.","Use Array.isArray() instead of instanceof Array.","Use the namespace keyword instead of the module keyword to declare TypeScript namespaces.","Make sure to use the digits argument with Number#toFixed().",'Make sure to use the "use strict" directive in script files.'],c=`---
3
3
  description: Ultracite Rules
4
4
  globs: "**/*.{ts,tsx,js,jsx}"
5
5
  alwaysApply: true
6
6
  ---
7
7
 
8
8
  ${Ft.map(e=>`- ${e}`).join(`
9
- `)}`});var Le={};u(Le,{claude:()=>P});var k,ie,P,re=r(()=>{"use strict";k=require("fs/promises");h();d();ie="./.claude/CLAUDE.md",P={exists:()=>o(ie),create:async()=>{await(0,k.mkdir)(".claude",{recursive:!0}),await(0,k.writeFile)(ie,c)},update:async()=>{await(0,k.mkdir)(".claude",{recursive:!0}),await(0,k.writeFile)(ie,c)}}});var Ge={};u(Ge,{codex:()=>N});var le,ce,N,ue=r(()=>{"use strict";le=require("fs/promises");h();d();ce="./AGENTS.md",N={exists:()=>o(ce),create:async()=>{await(0,le.writeFile)(ce,c)},update:async()=>{await(0,le.writeFile)(ce,c)}}});var _e={};u(_e,{cursor:()=>O});var D,de,O,pe=r(()=>{"use strict";D=require("fs/promises");h();d();de="./.cursor/rules/ultracite.mdc",O={exists:()=>o(de),create:async()=>{await(0,D.mkdir)(".cursor/rules",{recursive:!0}),await(0,D.writeFile)(de,c)},update:async()=>{await(0,D.mkdir)(".cursor/rules",{recursive:!0}),await(0,D.writeFile)(de,c)}}});var Ze={};u(Ze,{husky:()=>v});var Ke,y,Ye,Z,v,me=r(()=>{"use strict";Ke=require("child_process"),y=require("fs/promises");d();Ye="npx ultracite format",Z="./.husky/pre-commit",v={exists:()=>o(Z),install:e=>{(0,Ke.execSync)(`${e} -D husky`)},create:async()=>{await(0,y.mkdir)(".husky",{recursive:!0}),await(0,y.writeFile)(Z,Ye)},update:async()=>{let e=await(0,y.readFile)(Z,"utf-8");await(0,y.writeFile)(Z,`${e}
10
- ${Ye}`)}}});var Ve={};u(Ve,{lefthook:()=>j});var fe,w,B,C,Be,j,ge=r(()=>{"use strict";fe=require("child_process"),w=require("fs/promises");d();B="npx ultracite format",C="./lefthook.yml",Be=`pre-commit:
9
+ `)}`});var Le={};u(Le,{claude:()=>N});var D,ie,N,re=r(()=>{"use strict";D=require("fs/promises");h();d();ie="./.claude/CLAUDE.md",N={exists:()=>o(ie),create:async()=>{await(0,D.mkdir)(".claude",{recursive:!0}),await(0,D.writeFile)(ie,c)},update:async()=>{await(0,D.mkdir)(".claude",{recursive:!0}),await(0,D.writeFile)(ie,c)}}});var Ge={};u(Ge,{codex:()=>O});var le,ce,O,ue=r(()=>{"use strict";le=require("fs/promises");h();d();ce="./AGENTS.md",O={exists:()=>o(ce),create:async()=>{await(0,le.writeFile)(ce,c)},update:async()=>{await(0,le.writeFile)(ce,c)}}});var Be={};u(Be,{cursor:()=>J});var v,de,J,pe=r(()=>{"use strict";v=require("fs/promises");h();d();de="./.cursor/rules/ultracite.mdc",J={exists:()=>o(de),create:async()=>{await(0,v.mkdir)(".cursor/rules",{recursive:!0}),await(0,v.writeFile)(de,c)},update:async()=>{await(0,v.mkdir)(".cursor/rules",{recursive:!0}),await(0,v.writeFile)(de,c)}}});var Ke={};u(Ke,{husky:()=>C});var Ye,y,_e,Y,C,me=r(()=>{"use strict";Ye=require("child_process"),y=require("fs/promises");d();_e="npx ultracite format",Y="./.husky/pre-commit",C={exists:()=>o(Y),install:e=>{(0,Ye.execSync)(`${e} -D husky`)},create:async()=>{await(0,y.mkdir)(".husky",{recursive:!0}),await(0,y.writeFile)(Y,_e)},update:async()=>{let e=await(0,y.readFile)(Y,"utf-8");await(0,y.writeFile)(Y,`${e}
10
+ ${_e}`)}}});var Ve={};u(Ve,{lefthook:()=>S});var fe,w,K,j,Ze,S,ge=r(()=>{"use strict";fe=require("child_process"),w=require("fs/promises");d();K="npx ultracite format",j="./lefthook.yml",Ze=`pre-commit:
11
11
  jobs:
12
- - run: ${B}
12
+ - run: ${K}
13
13
  glob:
14
14
  - "*.js"
15
15
  - "*.jsx"
@@ -19,7 +19,7 @@ ${Ye}`)}}});var Ve={};u(Ve,{lefthook:()=>j});var fe,w,B,C,Be,j,ge=r(()=>{"use st
19
19
  - "*.jsonc"
20
20
  - "*.css"
21
21
  stage_fixed: true
22
- `,j={exists:()=>o(C),install:e=>{(0,fe.execSync)(`${e} -D lefthook`),(0,fe.execSync)("npx lefthook install")},create:async()=>{await(0,w.writeFile)(C,Be)},update:async()=>{let e=await(0,w.readFile)(C,"utf-8");if(!e.includes(B))if(e.includes("pre-commit:"))if(e.includes("jobs:")){let t=` - run: ${B}
22
+ `,S={exists:()=>o(j),install:e=>{(0,fe.execSync)(`${e} -D lefthook`),(0,fe.execSync)("npx lefthook install")},create:async()=>{await(0,w.writeFile)(j,Ze)},update:async()=>{let e=await(0,w.readFile)(j,"utf-8");if(!e.includes(K))if(e.includes("pre-commit:"))if(e.includes("jobs:")){let t=` - run: ${K}
23
23
  glob:
24
24
  - "*.js"
25
25
  - "*.jsx"
@@ -29,8 +29,8 @@ ${Ye}`)}}});var Ve={};u(Ve,{lefthook:()=>j});var fe,w,B,C,Be,j,ge=r(()=>{"use st
29
29
  - "*.jsonc"
30
30
  - "*.css"
31
31
  stage_fixed: true`,s=e.replace(/(pre-commit:\s*\n\s*jobs:\s*\n)/,`$1${t}
32
- `);await(0,w.writeFile)(C,s)}else{let t=` jobs:
33
- - run: ${B}
32
+ `);await(0,w.writeFile)(j,s)}else{let t=` jobs:
33
+ - run: ${K}
34
34
  glob:
35
35
  - "*.js"
36
36
  - "*.jsx"
@@ -40,8 +40,8 @@ ${Ye}`)}}});var Ve={};u(Ve,{lefthook:()=>j});var fe,w,B,C,Be,j,ge=r(()=>{"use st
40
40
  - "*.jsonc"
41
41
  - "*.css"
42
42
  stage_fixed: true`,s=e.replace(/(pre-commit:\s*\n)/,`$1${t}
43
- `);await(0,w.writeFile)(C,s)}else await(0,w.writeFile)(C,`${e}
44
- ${Be}`)}}});var et={};u(et,{lint:()=>he});var Xe,Qe,he,ye=r(()=>{"use strict";Xe=require("child_process"),Qe=g(require("process")),he=e=>{try{let t=e.length>0?e.join(" "):"./";(0,Xe.execSync)(`npx @biomejs/biome check ${t}`,{stdio:"inherit"})}catch(t){let s=t instanceof Error?t.message:"Unknown error";console.error("Failed to run Ultracite:",s),Qe.default.exit(1)}}});var st={};u(st,{packageManager:()=>X});var V,tt,X,we=r(()=>{"use strict";V=require("@clack/prompts");d();tt=[{hint:"Recommended",label:"pnpm",value:"pnpm add",lockfile:"pnpm-lock.yaml",monorepoSuffix:"-w"},{label:"bun",value:"bun add",lockfile:"bun.lockb",monorepoSuffix:""},{label:"yarn",value:"yarn add",lockfile:"yarn.lock",monorepoSuffix:""},{label:"npm",value:"npm install",lockfile:"package-lock.json",monorepoSuffix:"--workspace ."}],X={get:async()=>{let e=await Y();e&&V.log.info("Monorepo detected, updating install command to include workspace flag");for(let t of tt)if(await o(t.lockfile))return e&&t.monorepoSuffix?`${t.value} ${t.monorepoSuffix}`:t.value;return null},select:async()=>{let e=await Y(),t=await(0,V.select)({initialValue:"pnpm",message:"Which package manager do you use?",options:tt.map(s=>({label:s.label,value:e&&s.monorepoSuffix?`${s.value} ${s.monorepoSuffix}`:s.value}))});return typeof t!="string"?null:t}}});var nt={};u(nt,{title:()=>xe});var xe,be=r(()=>{"use strict";xe=`
43
+ `);await(0,w.writeFile)(j,s)}else await(0,w.writeFile)(j,`${e}
44
+ ${Ze}`)}}});var et={};u(et,{lint:()=>he});var Xe,Qe,he,ye=r(()=>{"use strict";Xe=require("child_process"),Qe=g(require("process")),he=e=>{try{let t=e.length>0?e.join(" "):"./";(0,Xe.execSync)(`npx @biomejs/biome check ${t}`,{stdio:"inherit"})}catch(t){let s=t instanceof Error?t.message:"Unknown error";console.error("Failed to run Ultracite:",s),Qe.default.exit(1)}}});var st={};u(st,{packageManager:()=>V});var Z,tt,V,we=r(()=>{"use strict";Z=require("@clack/prompts");d();tt=[{hint:"Recommended",label:"pnpm",value:"pnpm add",lockfile:"pnpm-lock.yaml",monorepoSuffix:"-w"},{label:"bun",value:"bun add",lockfile:"bun.lockb",monorepoSuffix:""},{label:"yarn",value:"yarn add",lockfile:"yarn.lock",monorepoSuffix:""},{label:"npm",value:"npm install",lockfile:"package-lock.json",monorepoSuffix:"--workspace ."}],V={get:async()=>{let e=await _();e&&Z.log.info("Monorepo detected, updating install command to include workspace flag");for(let t of tt)if(await o(t.lockfile))return e&&t.monorepoSuffix?`${t.value} ${t.monorepoSuffix}`:t.value;return null},select:async()=>{let e=await _(),t=await(0,Z.select)({initialValue:"pnpm",message:"Which package manager do you use?",options:tt.map(s=>({label:s.label,value:e&&s.monorepoSuffix?`${s.value} ${s.monorepoSuffix}`:s.value}))});return typeof t!="string"?null:t}}});var nt={};u(nt,{title:()=>xe});var xe,be=r(()=>{"use strict";xe=`
45
45
  888 888 888 88888888888 8888888b. d8888 .d8888b. 8888888 88888888888 8888888888
46
46
  888 888 888 888 888 Y88b d88888 d88P Y88b 888 888 888
47
47
  888 888 888 888 888 888 d88P888 888 888 888 888 888
@@ -50,12 +50,12 @@ ${Be}`)}}});var et={};u(et,{lint:()=>he});var Xe,Qe,he,ye=r(()=>{"use strict";Xe
50
50
  888 888 888 888 888 T88b d88P 888 888 888 888 888 888
51
51
  Y88b. .d88P 888 888 888 T88b d8888888888 Y88b d88P 888 888 888
52
52
  "Y88888P" 88888888 888 888 T88b d88P 888 "Y8888P" 8888888 888 8888888888
53
- `});var rt={};u(rt,{tsconfig:()=>T});var J,at,it,ot,Q,T,ke=r(()=>{"use strict";J=require("fs/promises"),at=g(require("deepmerge")),it=require("jsonc-parser");d();ot={compilerOptions:{strictNullChecks:!0}},Q="./tsconfig.json",T={exists:()=>o(Q),create:()=>(0,J.writeFile)(Q,JSON.stringify(ot,null,2)),update:async()=>{let e=await(0,J.readFile)(Q,"utf-8"),s=(0,it.parse)(e)||{},n=(0,at.default)(s,ot);await(0,J.writeFile)(Q,JSON.stringify(n,null,2))}}});var ct={};u(ct,{vscodeCopilot:()=>W});var S,De,W,ve=r(()=>{"use strict";S=require("fs/promises");h();d();De="./.github/copilot-instructions.md",W={exists:()=>o(De),create:async()=>{await(0,S.mkdir)(".github",{recursive:!0}),await(0,S.writeFile)(De,c)},update:async()=>{await(0,S.mkdir)(".github",{recursive:!0}),await(0,S.writeFile)(De,c)}}});var pt={};u(pt,{vscode:()=>z});var x,ut,dt,lt,ee,z,Ce=r(()=>{"use strict";x=require("fs/promises"),ut=g(require("deepmerge")),dt=require("jsonc-parser");d();lt={"editor.defaultFormatter":"esbenp.prettier-vscode","[javascript][typescript][javascriptreact][typescriptreact][json][jsonc][css][graphql]":{"editor.defaultFormatter":"biomejs.biome"},"typescript.tsdk":"node_modules/typescript/lib","editor.formatOnSave":!0,"editor.formatOnPaste":!0,"emmet.showExpandedAbbreviation":"never","editor.codeActionsOnSave":{"source.fixAll.biome":"explicit","source.organizeImports.biome":"explicit"}},ee="./.vscode/settings.json",z={exists:()=>o(ee),create:async()=>{await(0,x.mkdir)(".vscode",{recursive:!0}),await(0,x.writeFile)(ee,JSON.stringify(lt,null,2))},update:async()=>{let e=await(0,x.readFile)(ee,"utf-8"),s=(0,dt.parse)(e)||{},n=(0,ut.default)(s,lt);await(0,x.writeFile)(ee,JSON.stringify(n,null,2))}}});var mt={};u(mt,{windsurf:()=>E});var U,je,E,Se=r(()=>{"use strict";U=require("fs/promises");h();d();je="./.windsurf/rules/ultracite.md",E={exists:()=>o(je),create:async()=>{await(0,U.mkdir)(".windsurf/rules",{recursive:!0}),await(0,U.writeFile)(je,c)},update:async()=>{await(0,U.mkdir)(".windsurf/rules",{recursive:!0}),await(0,U.writeFile)(je,c)}}});var ft={};u(ft,{zed:()=>q});var M,A,q,Ue=r(()=>{"use strict";M=require("fs/promises");h();d();A="./.rules",q={exists:()=>o(A),create:async()=>{await(0,M.writeFile)(A,c)},update:async()=>{if(!await o(A)){await(0,M.writeFile)(A,c);return}let e=await(0,M.readFile)(A,"utf-8");e.includes(c.trim())||await(0,M.writeFile)(A,`${e}
53
+ `});var rt={};u(rt,{tsconfig:()=>W});var T,at,it,ot,X,W,ke=r(()=>{"use strict";T=require("fs/promises"),at=g(require("deepmerge")),it=require("jsonc-parser");d();ot={compilerOptions:{strictNullChecks:!0}},X="./tsconfig.json",W={exists:()=>o(X),create:()=>(0,T.writeFile)(X,JSON.stringify(ot,null,2)),update:async()=>{let e=await(0,T.readFile)(X,"utf-8"),s=(0,it.parse)(e)||{},n=(0,at.default)(s,ot);await(0,T.writeFile)(X,JSON.stringify(n,null,2))}}});var ct={};u(ct,{vscodeCopilot:()=>z});var U,De,z,ve=r(()=>{"use strict";U=require("fs/promises");h();d();De="./.github/copilot-instructions.md",z={exists:()=>o(De),create:async()=>{await(0,U.mkdir)(".github",{recursive:!0}),await(0,U.writeFile)(De,c)},update:async()=>{await(0,U.mkdir)(".github",{recursive:!0}),await(0,U.writeFile)(De,c)}}});var pt={};u(pt,{vscode:()=>E});var x,ut,dt,lt,Q,E,Ce=r(()=>{"use strict";x=require("fs/promises"),ut=g(require("deepmerge")),dt=require("jsonc-parser");d();lt={"editor.defaultFormatter":"esbenp.prettier-vscode","[javascript][typescript][javascriptreact][typescriptreact][json][jsonc][css][graphql]":{"editor.defaultFormatter":"biomejs.biome"},"typescript.tsdk":"node_modules/typescript/lib","editor.formatOnSave":!0,"editor.formatOnPaste":!0,"emmet.showExpandedAbbreviation":"never","editor.codeActionsOnSave":{"source.fixAll.biome":"explicit","source.organizeImports.biome":"explicit"}},Q="./.vscode/settings.json",E={exists:()=>o(Q),create:async()=>{await(0,x.mkdir)(".vscode",{recursive:!0}),await(0,x.writeFile)(Q,JSON.stringify(lt,null,2))},update:async()=>{let e=await(0,x.readFile)(Q,"utf-8"),s=(0,dt.parse)(e)||{},n=(0,ut.default)(s,lt);await(0,x.writeFile)(Q,JSON.stringify(n,null,2))}}});var mt={};u(mt,{windsurf:()=>q});var A,je,q,Se=r(()=>{"use strict";A=require("fs/promises");h();d();je="./.windsurf/rules/ultracite.md",q={exists:()=>o(je),create:async()=>{await(0,A.mkdir)(".windsurf/rules",{recursive:!0}),await(0,A.writeFile)(je,c)},update:async()=>{await(0,A.mkdir)(".windsurf/rules",{recursive:!0}),await(0,A.writeFile)(je,c)}}});var ft={};u(ft,{zed:()=>H});var F,M,H,Ue=r(()=>{"use strict";F=require("fs/promises");h();d();M="./.rules",H={exists:()=>o(M),create:async()=>{await(0,F.writeFile)(M,c)},update:async()=>{if(!await o(M)){await(0,F.writeFile)(M,c);return}let e=await(0,F.readFile)(M,"utf-8");e.includes(c.trim())||await(0,F.writeFile)(M,`${e}
54
54
 
55
- ${c}`)}}});var It,Ae=r(()=>{It=$e({"./biome.ts":()=>(ae(),l(He)),"./claude.ts":()=>(re(),l(Le)),"./codex.ts":()=>(ue(),l(Ge)),"./cursor.ts":()=>(pe(),l(_e)),"./format.ts":()=>(oe(),l(Je)),"./husky.ts":()=>(me(),l(Ze)),"./index.ts":()=>(yt(),l(Rt)),"./initialize.ts":()=>(Fe(),l(ht)),"./lefthook.ts":()=>(ge(),l(Ve)),"./lint-staged.ts":()=>(Me(),l(gt)),"./lint.ts":()=>(ye(),l(et)),"./package-manager.ts":()=>(we(),l(st)),"./title.ts":()=>(be(),l(nt)),"./tsconfig.ts":()=>(ke(),l(rt)),"./utils.ts":()=>(d(),l(We)),"./vscode-copilot.ts":()=>(ve(),l(ct)),"./vscode-settings.ts":()=>(Ce(),l(pt)),"./windsurf.ts":()=>(Se(),l(mt)),"./zed.ts":()=>(Ue(),l(ft))})});var gt={};u(gt,{lintStaged:()=>R});var xt,p,bt,F,te,f,wt,$t,Pt,Nt,Ot,Jt,Tt,Wt,zt,Et,Re,qt,R,Me=r(()=>{"use strict";xt=require("child_process"),p=require("fs/promises"),bt=require("url"),F=g(require("deepmerge")),te=require("jsonc-parser");d();Ae();f={"*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}":["npx ultracite format"]},wt=["./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"],$t=(e,t,s,n)=>{let i=e.trim();if(i.includes(":")&&!i.startsWith("-")){s&&n.length>0&&(t[s]=n);let[m,...L]=i.split(":"),b=L.join(":").trim(),se=m.trim().replace(/['"]/g,"");return b&&b!==""?(b.startsWith("[")&&b.endsWith("]")?t[se]=b.slice(1,-1).split(",").map(Ct=>Ct.trim().replace(/['"]/g,"")):t[se]=b.replace(/['"]/g,""),{newCurrentKey:null,newCurrentArray:[]}):{newCurrentKey:se,newCurrentArray:[]}}if(i.startsWith("-")&&s){let m=[...n,i.slice(1).trim().replace(/['"]/g,"")];return{newCurrentKey:s,newCurrentArray:m}}return{newCurrentKey:s,newCurrentArray:n}},Pt=e=>{let t=e.split(`
56
- `).filter(m=>m.trim()&&!m.trim().startsWith("#")),s={},n=null,i=[];for(let m of t){let L=$t(m,s,n,i);n=L.newCurrentKey,i=L.newCurrentArray}return n&&i.length>0&&(s[n]=i),s},Nt=e=>{let t="";for(let[s,n]of Object.entries(e))if(Array.isArray(n)){t+=`${s}:
57
- `;for(let i of n)t+=` - '${i}'
55
+ ${c}`)}}});var It,Ae=r(()=>{It=Pe({"./biome.ts":()=>(ae(),l(He)),"./claude.ts":()=>(re(),l(Le)),"./codex.ts":()=>(ue(),l(Ge)),"./cursor.ts":()=>(pe(),l(Be)),"./format.ts":()=>(ne(),l(Je)),"./husky.ts":()=>(me(),l(Ke)),"./index.ts":()=>(yt(),l(Rt)),"./initialize.ts":()=>(Fe(),l(ht)),"./lefthook.ts":()=>(ge(),l(Ve)),"./lint-staged.ts":()=>(Me(),l(gt)),"./lint.ts":()=>(ye(),l(et)),"./package-manager.ts":()=>(we(),l(st)),"./title.ts":()=>(be(),l(nt)),"./tsconfig.ts":()=>(ke(),l(rt)),"./utils.ts":()=>(d(),l(We)),"./vscode-copilot.ts":()=>(ve(),l(ct)),"./vscode-settings.ts":()=>(Ce(),l(pt)),"./windsurf.ts":()=>(Se(),l(mt)),"./zed.ts":()=>(Ue(),l(ft))})});var gt={};u(gt,{lintStaged:()=>I});var xt,p,bt,R,ee,f,wt,Pt,$t,Nt,Ot,Jt,Tt,Wt,zt,Et,Re,qt,I,Me=r(()=>{"use strict";xt=require("child_process"),p=require("fs/promises"),bt=require("url"),R=g(require("deepmerge")),ee=require("jsonc-parser");d();Ae();f={"*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}":["npx ultracite format"]},wt=["./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"],Pt=(e,t,s,n)=>{let a=e.trim();if(a.includes(":")&&!a.startsWith("-")){s&&n.length>0&&(t[s]=n);let[m,...b]=a.split(":"),k=b.join(":").trim(),te=m.trim().replace(/['"]/g,"");return k&&k!==""?(k.startsWith("[")&&k.endsWith("]")?t[te]=k.slice(1,-1).split(",").map(Ct=>Ct.trim().replace(/['"]/g,"")):t[te]=k.replace(/['"]/g,""),{newCurrentKey:null,newCurrentArray:[]}):{newCurrentKey:te,newCurrentArray:[]}}if(a.startsWith("-")&&s){let m=[...n,a.slice(1).trim().replace(/['"]/g,"")];return{newCurrentKey:s,newCurrentArray:m}}return{newCurrentKey:s,newCurrentArray:n}},$t=e=>{let t=e.split(`
56
+ `).filter(m=>m.trim()&&!m.trim().startsWith("#")),s={},n=null,a=[];for(let m of t){let b=Pt(m,s,n,a);n=b.newCurrentKey,a=b.newCurrentArray}return n&&a.length>0&&(s[n]=a),s},Nt=e=>{let t="";for(let[s,n]of Object.entries(e))if(Array.isArray(n)){t+=`${s}:
57
+ `;for(let a of n)t+=` - '${a}'
58
58
  `}else t+=`${s}: '${n}'
59
- `;return t},Ot=async()=>{try{let e=(0,te.parse)(await(0,p.readFile)("./package.json","utf-8"));return e?e.type==="module":!1}catch{return!1}},Jt=async()=>{let e=(0,te.parse)(await(0,p.readFile)("./package.json","utf-8"));e&&(e["lint-staged"]?e["lint-staged"]=(0,F.default)(e["lint-staged"],f):e["lint-staged"]=f,await(0,p.writeFile)("./package.json",JSON.stringify(e,null,2)))},Tt=async e=>{let t=await(0,p.readFile)(e,"utf-8"),s=(0,te.parse)(t);if(!s)return;let n=(0,F.default)(s,f);await(0,p.writeFile)(e,JSON.stringify(n,null,2))},Wt=async e=>{let t=await(0,p.readFile)(e,"utf-8"),s=Pt(t);if(!s)return;let n=(0,F.default)(s,f);await(0,p.writeFile)(e,Nt(n))},zt=async e=>{let n=(await import((0,bt.pathToFileURL)(e).href)).default||{},i=(0,F.default)(n,f),m=`export default ${JSON.stringify(i,null,2)};
60
- `;await(0,p.writeFile)(e,m)},Et=async e=>{delete require.cache[require.resolve(`./${e}`)];let t=It(`./${e}`),s=(0,F.default)(t,f),n=`module.exports = ${JSON.stringify(s,null,2)};
61
- `;await(0,p.writeFile)(e,n)},Re=async()=>{await(0,p.writeFile)(".lintstagedrc.json",JSON.stringify(f,null,2))},qt=async e=>{if(e==="./package.json"){await Jt();return}if(e.endsWith(".json")||e==="./.lintstagedrc"){await Tt(e);return}if(e.endsWith(".yaml")||e.endsWith(".yml")){await Wt(e);return}let t=await Ot();if(e.endsWith(".mjs")||e.endsWith(".js")&&t){try{await zt(e)}catch{await Re()}return}if(e.endsWith(".cjs")||e.endsWith(".js")&&!t)try{await Et(e)}catch{await Re()}},R={exists:async()=>{for(let e of wt)if(await o(e))return!0;return!1},install:e=>{(0,xt.execSync)(`${e} -D lint-staged`)},create:async()=>{await(0,p.writeFile)(".lintstagedrc.json",JSON.stringify(f,null,2))},update:async()=>{let e=null;for(let t of wt)if(await o(t)){e=t;break}if(!e){await Re();return}await qt(e)}}});var ht={};u(ht,{initialize:()=>Ie});var kt,Dt,a,Ht,Lt,Gt,_t,Yt,Kt,Zt,Bt,Vt,Xt,Qt,es,ts,Ie,Fe=r(()=>{"use strict";kt=require("child_process"),Dt=g(require("process")),a=require("@clack/prompts");ae();re();ue();pe();me();ge();Me();we();be();ke();ve();Ce();Se();Ue();Ht=e=>{let t=(0,a.spinner)();t.start("Installing dependencies..."),(0,kt.execSync)(`${e} -D -E ultracite @biomejs/biome@2.0.5`),t.stop("Dependencies installed.")},Lt=async()=>{let e=(0,a.spinner)();if(e.start("Checking for tsconfig.json..."),await T.exists()){e.message("tsconfig.json found, updating..."),await T.update(),e.stop("tsconfig.json updated.");return}e.message("tsconfig.json not found, creating..."),await T.create(),e.stop("tsconfig.json created.")},Gt=async()=>{let e=(0,a.spinner)();if(e.start("Checking for .vscode/settings.json..."),await z.exists()){e.message("settings.json found, updating..."),await z.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await z.create(),e.stop("settings.json created.")},_t=async()=>{let e=(0,a.spinner)();if(e.start("Checking for biome.jsonc..."),await $.exists()){e.message("biome.jsonc found, updating..."),await $.update(),e.stop("biome.jsonc updated.");return}e.message("biome.jsonc not found, creating..."),await $.create(),e.stop("biome.jsonc created.")},Yt=async e=>{let t=(0,a.spinner)();if(t.start("Initializing pre-commit hooks..."),t.message("Installing Husky..."),v.install(e),await v.exists()){t.message("Pre-commit hook found, updating..."),await v.update(),t.stop("Pre-commit hook updated.");return}t.message("Updating pre-commit hook..."),t.message("Pre-commit hook not found, creating..."),await v.create(),t.stop("Pre-commit hook created.")},Kt=async e=>{let t=(0,a.spinner)();if(t.start("Initializing lefthook..."),t.message("Installing lefthook..."),j.install(e),await j.exists()){t.message("lefthook.yml found, updating..."),await j.update(),t.stop("lefthook.yml updated.");return}t.message("lefthook.yml not found, creating..."),await j.create(),t.stop("lefthook.yml created.")},Zt=async e=>{let t=(0,a.spinner)();if(t.start("Initializing lint-staged..."),t.message("Installing lint-staged..."),R.install(e),await R.exists()){t.message("lint-staged found, updating..."),await R.update(),t.stop("lint-staged updated.");return}t.message("lint-staged not found, creating..."),await R.create(),t.stop("lint-staged created.")},Bt=async()=>{let e=(0,a.spinner)();if(e.start("Checking for GitHub Copilot rules..."),await W.exists()){e.message("GitHub Copilot rules found, updating..."),await W.update(),e.stop("GitHub Copilot rules updated.");return}e.message("GitHub Copilot rules not found, creating..."),await W.create(),e.stop("GitHub Copilot rules created.")},Vt=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Cursor rules..."),await O.exists()){e.message("Cursor rules found, updating..."),await O.update(),e.stop("Cursor rules updated.");return}e.message("Cursor rules not found, creating..."),await O.create(),e.stop("Cursor rules created.")},Xt=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Windsurf rules..."),await E.exists()){e.message("Windsurf rules found, updating..."),await E.update(),e.stop("Windsurf rules updated.");return}e.message("Windsurf rules not found, creating..."),await E.create(),e.stop("Windsurf rules created.")},Qt=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Zed rules..."),await q.exists()){e.message("Zed rules found, updating..."),await q.update(),e.stop("Zed rules updated.");return}e.message("Zed rules not found, creating..."),await q.create(),e.stop("Zed rules created.")},es=async()=>{let e=(0,a.spinner)();if(e.start("Checking for Claude Code rules..."),await P.exists()){e.message("Claude Code rules found, updating..."),await P.update(),e.stop("Claude Code rules updated.");return}e.message("Claude Code rules not found, creating..."),await P.create(),e.stop("Claude Code rules created.")},ts=async()=>{let e=(0,a.spinner)();if(e.start("Checking for OpenAI Codex rules..."),await N.exists()){e.message("OpenAI Codex rules found, updating..."),await N.update(),e.stop("OpenAI Codex rules updated.");return}e.message("OpenAI Codex rules not found, creating..."),await N.create(),e.stop("OpenAI Codex rules created.")},Ie=async()=>{(0,a.intro)(xe);try{let e=await X.get();if(e?a.log.info(`Detected lockfile, using ${e}`):e=await X.select(),!e||typeof e!="string")throw new Error("No package manager selected");let t=await(0,a.multiselect)({message:"Which editor rules do you want to enable (optional)?",options:[{label:"GitHub Copilot (VSCode)",value:"vscode-copilot"},{label:"Cursor",value:"cursor"},{label:"Windsurf",value:"windsurf"},{label:"Zed",value:"zed"},{label:"Claude Code",value:"claude"},{label:"OpenAI Codex",value:"codex"}],required:!1}),s=await(0,a.multiselect)({message:"Would you like any of the following (optional)?",options:[{label:"Husky pre-commit hook",value:"precommit-hooks"},{label:"Lefthook pre-commit hook",value:"lefthook"},{label:"Lint-staged",value:"lint-staged"}],required:!1});Ht(e),await Lt(),await Gt(),await _t(),Array.isArray(t)&&(t.includes("vscode-copilot")&&await Bt(),t.includes("cursor")&&await Vt(),t.includes("windsurf")&&await Xt(),t.includes("zed")&&await Qt(),t.includes("claude")&&await es(),t.includes("codex")&&await ts()),Array.isArray(s)&&(s.includes("precommit-hooks")&&await Yt(e),s.includes("lefthook")&&await Kt(e),s.includes("lint-staged")&&await Zt(e)),a.log.success("Successfully initialized Ultracite configuration!")}catch(e){let t=e instanceof Error?e.message:"Unknown error";a.log.error(`Failed to initialize Ultracite configuration: ${t}`),Dt.default.exit(1)}}});var Rt={};var vt,H,yt=r(()=>{vt=require("commander");oe();Fe();ye();H=new vt.Command;H.name("Ultracite").description("Ship code faster and with more confidence.");H.command("init").description("Initialize Ultracite in the current directory").action(Ie);H.command("lint").description("Run Biome linter without fixing files").argument("[files...]","specific files to lint (optional)").action(he);H.command("format").description("Run Biome linter and fixes files").argument("[files...]","specific files to format (optional)").option("--unsafe","apply unsafe fixes").action(ne);H.parse()});yt();
59
+ `;return t},Ot=async()=>{try{let e=(0,ee.parse)(await(0,p.readFile)("./package.json","utf-8"));return e?e.type==="module":!1}catch{return!1}},Jt=async()=>{let e=(0,ee.parse)(await(0,p.readFile)("./package.json","utf-8"));e&&(e["lint-staged"]?e["lint-staged"]=(0,R.default)(e["lint-staged"],f):e["lint-staged"]=f,await(0,p.writeFile)("./package.json",JSON.stringify(e,null,2)))},Tt=async e=>{let t=await(0,p.readFile)(e,"utf-8"),s=(0,ee.parse)(t);if(!s)return;let n=(0,R.default)(s,f);await(0,p.writeFile)(e,JSON.stringify(n,null,2))},Wt=async e=>{let t=await(0,p.readFile)(e,"utf-8"),s=$t(t);if(!s)return;let n=(0,R.default)(s,f);await(0,p.writeFile)(e,Nt(n))},zt=async e=>{let n=(await import((0,bt.pathToFileURL)(e).href)).default||{},a=(0,R.default)(n,f),m=`export default ${JSON.stringify(a,null,2)};
60
+ `;await(0,p.writeFile)(e,m)},Et=async e=>{delete require.cache[require.resolve(`./${e}`)];let t=It(`./${e}`),s=(0,R.default)(t,f),n=`module.exports = ${JSON.stringify(s,null,2)};
61
+ `;await(0,p.writeFile)(e,n)},Re=async()=>{await(0,p.writeFile)(".lintstagedrc.json",JSON.stringify(f,null,2))},qt=async e=>{if(e==="./package.json"){await Jt();return}if(e.endsWith(".json")||e==="./.lintstagedrc"){await Tt(e);return}if(e.endsWith(".yaml")||e.endsWith(".yml")){await Wt(e);return}let t=await Ot();if(e.endsWith(".mjs")||e.endsWith(".js")&&t){try{await zt(e)}catch{await Re()}return}if(e.endsWith(".cjs")||e.endsWith(".js")&&!t)try{await Et(e)}catch{await Re()}},I={exists:async()=>{for(let e of wt)if(await o(e))return!0;return!1},install:e=>{(0,xt.execSync)(`${e} -D lint-staged`)},create:async()=>{await(0,p.writeFile)(".lintstagedrc.json",JSON.stringify(f,null,2))},update:async()=>{let e=null;for(let t of wt)if(await o(t)){e=t;break}if(!e){await Re();return}await qt(e)}}});var ht={};u(ht,{initialize:()=>Ie});var kt,Dt,i,Ht,Lt,Gt,Bt,_t,Yt,Kt,Zt,Vt,Xt,Qt,es,ts,Ie,Fe=r(()=>{"use strict";kt=require("child_process"),Dt=g(require("process")),i=require("@clack/prompts");ae();re();ue();pe();me();ge();Me();we();be();ke();ve();Ce();Se();Ue();Ht=e=>{let t=(0,i.spinner)();t.start("Installing dependencies..."),(0,kt.execSync)(`${e} -D -E ultracite @biomejs/biome@2.0.5`),t.stop("Dependencies installed.")},Lt=async()=>{let e=(0,i.spinner)();if(e.start("Checking for tsconfig.json..."),await W.exists()){e.message("tsconfig.json found, updating..."),await W.update(),e.stop("tsconfig.json updated.");return}e.message("tsconfig.json not found, creating..."),await W.create(),e.stop("tsconfig.json created.")},Gt=async()=>{let e=(0,i.spinner)();if(e.start("Checking for .vscode/settings.json..."),await E.exists()){e.message("settings.json found, updating..."),await E.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await E.create(),e.stop("settings.json created.")},Bt=async()=>{let e=(0,i.spinner)();if(e.start("Checking for Biome configuration..."),await $.exists()){e.message("Biome configuration found, updating..."),await $.update(),e.stop("Biome configuration updated.");return}e.message("Biome configuration not found, creating..."),await $.create(),e.stop("Biome configuration created.")},_t=async e=>{let t=(0,i.spinner)();if(t.start("Initializing pre-commit hooks..."),t.message("Installing Husky..."),C.install(e),await C.exists()){t.message("Pre-commit hook found, updating..."),await C.update(),t.stop("Pre-commit hook updated.");return}t.message("Updating pre-commit hook..."),t.message("Pre-commit hook not found, creating..."),await C.create(),t.stop("Pre-commit hook created.")},Yt=async e=>{let t=(0,i.spinner)();if(t.start("Initializing lefthook..."),t.message("Installing lefthook..."),S.install(e),await S.exists()){t.message("lefthook.yml found, updating..."),await S.update(),t.stop("lefthook.yml updated.");return}t.message("lefthook.yml not found, creating..."),await S.create(),t.stop("lefthook.yml created.")},Kt=async e=>{let t=(0,i.spinner)();if(t.start("Initializing lint-staged..."),t.message("Installing lint-staged..."),I.install(e),await I.exists()){t.message("lint-staged found, updating..."),await I.update(),t.stop("lint-staged updated.");return}t.message("lint-staged not found, creating..."),await I.create(),t.stop("lint-staged created.")},Zt=async()=>{let e=(0,i.spinner)();if(e.start("Checking for GitHub Copilot rules..."),await z.exists()){e.message("GitHub Copilot rules found, updating..."),await z.update(),e.stop("GitHub Copilot rules updated.");return}e.message("GitHub Copilot rules not found, creating..."),await z.create(),e.stop("GitHub Copilot rules created.")},Vt=async()=>{let e=(0,i.spinner)();if(e.start("Checking for Cursor rules..."),await J.exists()){e.message("Cursor rules found, updating..."),await J.update(),e.stop("Cursor rules updated.");return}e.message("Cursor rules not found, creating..."),await J.create(),e.stop("Cursor rules created.")},Xt=async()=>{let e=(0,i.spinner)();if(e.start("Checking for Windsurf rules..."),await q.exists()){e.message("Windsurf rules found, updating..."),await q.update(),e.stop("Windsurf rules updated.");return}e.message("Windsurf rules not found, creating..."),await q.create(),e.stop("Windsurf rules created.")},Qt=async()=>{let e=(0,i.spinner)();if(e.start("Checking for Zed rules..."),await H.exists()){e.message("Zed rules found, updating..."),await H.update(),e.stop("Zed rules updated.");return}e.message("Zed rules not found, creating..."),await H.create(),e.stop("Zed rules created.")},es=async()=>{let e=(0,i.spinner)();if(e.start("Checking for Claude Code rules..."),await N.exists()){e.message("Claude Code rules found, updating..."),await N.update(),e.stop("Claude Code rules updated.");return}e.message("Claude Code rules not found, creating..."),await N.create(),e.stop("Claude Code rules created.")},ts=async()=>{let e=(0,i.spinner)();if(e.start("Checking for OpenAI Codex rules..."),await O.exists()){e.message("OpenAI Codex rules found, updating..."),await O.update(),e.stop("OpenAI Codex rules updated.");return}e.message("OpenAI Codex rules not found, creating..."),await O.create(),e.stop("OpenAI Codex rules created.")},Ie=async()=>{(0,i.intro)(xe);try{let e=await V.get();if(e?i.log.info(`Detected lockfile, using ${e}`):e=await V.select(),!e||typeof e!="string")throw new Error("No package manager selected");let t=await(0,i.multiselect)({message:"Which editor rules do you want to enable (optional)?",options:[{label:"GitHub Copilot (VSCode)",value:"vscode-copilot"},{label:"Cursor",value:"cursor"},{label:"Windsurf",value:"windsurf"},{label:"Zed",value:"zed"},{label:"Claude Code",value:"claude"},{label:"OpenAI Codex",value:"codex"}],required:!1}),s=await(0,i.multiselect)({message:"Would you like any of the following (optional)?",options:[{label:"Husky pre-commit hook",value:"precommit-hooks"},{label:"Lefthook pre-commit hook",value:"lefthook"},{label:"Lint-staged",value:"lint-staged"}],required:!1});Ht(e),await Lt(),await Gt(),await Bt(),Array.isArray(t)&&(t.includes("vscode-copilot")&&await Zt(),t.includes("cursor")&&await Vt(),t.includes("windsurf")&&await Xt(),t.includes("zed")&&await Qt(),t.includes("claude")&&await es(),t.includes("codex")&&await ts()),Array.isArray(s)&&(s.includes("precommit-hooks")&&await _t(e),s.includes("lefthook")&&await Yt(e),s.includes("lint-staged")&&await Kt(e)),i.log.success("Successfully initialized Ultracite configuration!")}catch(e){let t=e instanceof Error?e.message:"Unknown error";i.log.error(`Failed to initialize Ultracite configuration: ${t}`),Dt.default.exit(1)}}});var Rt={};var vt,L,yt=r(()=>{vt=require("commander");ne();Fe();ye();L=new vt.Command;L.name("Ultracite").description("Ship code faster and with more confidence.");L.command("init").description("Initialize Ultracite in the current directory").action(Ie);L.command("lint").description("Run Biome linter without fixing files").argument("[files...]","specific files to lint (optional)").action(he);L.command("format").description("Run Biome linter and fixes files").argument("[files...]","specific files to format (optional)").option("--unsafe","apply unsafe fixes").action(se);L.parse()});yt();
package/dist/index.mjs CHANGED
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
- var L=Object.defineProperty;var pt=Object.getOwnPropertyDescriptor;var mt=Object.getOwnPropertyNames;var ft=Object.prototype.hasOwnProperty;var G=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,s)=>(typeof require<"u"?require:t)[s]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),ve=e=>t=>{var s=e[t];if(s)return s();throw new Error("Module not found in bundle: "+t)};var i=(e,t)=>()=>(e&&(t=e(e=0)),t);var l=(e,t)=>{for(var s in t)L(e,s,{get:t[s],enumerable:!0})},gt=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of mt(t))!ft.call(e,a)&&a!==s&&L(e,a,{get:()=>t[a],enumerable:!(n=pt(t,a))||n.enumerable});return e};var c=e=>gt(L({},"__esModule",{value:!0}),e);var Ce={};l(Ce,{format:()=>_});import{execSync as ht}from"child_process";import yt from"process";var _,Y=i(()=>{"use strict";_=(e,t={})=>{try{let s=e.length>0?e.join(" "):"./",n=t.unsafe?" --unsafe":"";ht(`npx @biomejs/biome check --write${n} ${s}`,{stdio:"inherit"})}catch(s){let n=s instanceof Error?s.message:"Unknown error";console.error("Failed to run Ultracite:",n),yt.exit(1)}}});var je={};l(je,{exists:()=>o,isMonorepo:()=>P});import{access as wt,readFile as xt}from"fs/promises";import{parse as bt}from"jsonc-parser";var o,P,u=i(()=>{"use strict";o=async e=>{try{return await wt(e),!0}catch{return!1}},P=async()=>{if(await o("pnpm-workspace.yaml"))return!0;try{let e=bt(await xt("package.json","utf-8"));return e?!!e.workspaces:!1}catch{return!1}}});var Ae={};l(Ae,{biome:()=>D});import{readFile as kt,writeFile as Se}from"fs/promises";import Dt from"deepmerge";import{parse as vt}from"jsonc-parser";var Ue,N,D,K=i(()=>{"use strict";u();Ue={$schema:"https://biomejs.dev/schemas/2.0.5/schema.json",extends:["ultracite"]},N="./biome.jsonc",D={exists:()=>o(N),create:()=>Se(N,JSON.stringify(Ue,null,2)),update:async()=>{let e=await kt(N,"utf-8"),s=vt(e)||{},n=s.extends&&Array.isArray(s.extends)?s.extends:[];n.includes("ultracite")||(s.extends=[...n,"ultracite"]);let a={$schema:Ue.$schema},p=Dt(s,a);await Se(N,JSON.stringify(p,null,2))}}});var Ct,r,f=i(()=>{"use strict";Ct=["Don't use `accessKey` attribute on any HTML element.",'Don\'t set `aria-hidden="true"` on focusable elements.',"Don't add ARIA roles, states, and properties to elements that don't support them.","Don't use distracting elements like `<marquee>` or `<blink>`.","Only use the `scope` prop on `<th>` elements.","Don't assign non-interactive ARIA roles to interactive HTML elements.","Make sure label elements have text content and are associated with an input.","Don't assign interactive ARIA roles to non-interactive HTML elements.","Don't assign `tabIndex` to non-interactive HTML elements.","Don't use positive integers for `tabIndex` property.",'Don\'t include "image", "picture", or "photo" in img `alt` prop.',"Don't use explicit role property that's the same as the implicit/default role.","Make static elements with click handlers use a valid role attribute.","Always include a `title` element for SVG elements.","Give all elements requiring alt text meaningful information for screen readers.","Make sure anchors have content that's accessible to screen readers.","Assign `tabIndex` to non-interactive HTML elements with `aria-activedescendant`.","Include all required ARIA attributes for elements with ARIA roles.","Make sure ARIA properties are valid for the element's supported roles.","Always include a `type` attribute for button elements.","Make elements with interactive roles and handlers focusable.","Give heading elements content that's accessible to screen readers (not hidden with `aria-hidden`).","Always include a `lang` attribute on the html element.","Always include a `title` attribute for iframe elements.","Accompany `onClick` with at least one of: `onKeyUp`, `onKeyDown`, or `onKeyPress`.","Accompany `onMouseOver`/`onMouseOut` with `onFocus`/`onBlur`.","Include caption tracks for audio and video elements.","Use semantic elements instead of role attributes in JSX.","Make sure all anchors are valid and navigable.","Ensure all ARIA properties (`aria-*`) are valid.","Use valid, non-abstract ARIA roles for elements with ARIA roles.","Use valid ARIA state and property values.","Use valid values for the `autocomplete` attribute on input elements.","Use correct ISO language/country codes for the `lang` attribute.","Don't use consecutive spaces in regular expression literals.","Don't use the `arguments` object.","Don't use primitive type aliases or misleading types.","Don't use the comma operator.","Don't use empty type parameters in type aliases and interfaces.","Don't write functions that exceed a given Cognitive Complexity score.","Don't nest describe() blocks too deeply in test files.","Don't use unnecessary boolean casts.","Don't use unnecessary callbacks with flatMap.","Use for...of statements instead of Array.forEach.","Don't create classes that only have static members (like a static namespace).","Don't use this and super in static contexts.","Don't use unnecessary catch clauses.","Don't use unnecessary constructors.","Don't use unnecessary continue statements.","Don't export empty modules that don't change anything.","Don't use unnecessary escape sequences in regular expression literals.","Don't use unnecessary fragments.","Don't use unnecessary labels.","Don't use unnecessary nested block statements.","Don't rename imports, exports, and destructured assignments to the same name.","Don't use unnecessary string or template literal concatenation.","Don't use String.raw in template literals when there are no escape sequences.","Don't use useless case statements in switch statements.","Don't use ternary operators when simpler alternatives exist.","Don't use useless `this` aliasing.","Don't use any or unknown as type constraints.","Don't initialize variables to undefined.","Don't use void operators (they're not familiar).","Use arrow functions instead of function expressions.","Use Date.now() to get milliseconds since the Unix Epoch.","Use .flatMap() instead of map().flat() when possible.","Use literal property access instead of computed property access.","Don't use parseInt() or Number.parseInt() when binary, octal, or hexadecimal literals work.","Use concise optional chaining instead of chained logical expressions.","Use regular expression literals instead of the RegExp constructor when possible.","Don't use number literal object member names that aren't base 10 or use underscore separators.","Remove redundant terms from logical expressions.","Use while loops instead of for loops when you don't need initializer and update expressions.","Don't pass children as props.","Don't reassign const variables.","Don't use constant expressions in conditions.","Don't use `Math.min` and `Math.max` to clamp values when the result is constant.","Don't return a value from a constructor.","Don't use empty character classes in regular expression literals.","Don't use empty destructuring patterns.","Don't call global object properties as functions.","Don't declare functions and vars that are accessible outside their block.","Make sure builtins are correctly instantiated.","Don't use super() incorrectly inside classes. Also check that super() is called in classes that extend other constructors.","Don't use variables and function parameters before they're declared.","Don't use 8 and 9 escape sequences in string literals.","Don't use literal numbers that lose precision.","Don't use the return value of React.render.","Don't assign a value to itself.","Don't return a value from a setter.","Don't compare expressions that modify string case with non-compliant values.","Don't use lexical declarations in switch clauses.","Don't use variables that haven't been declared in the document.","Don't write unreachable code.","Make sure super() is called exactly once on every code path in a class constructor before this is accessed if the class has a superclass.","Don't use control flow statements in finally blocks.","Don't use optional chaining where undefined values aren't allowed.","Don't have unused function parameters.","Don't have unused imports.","Don't have unused labels.","Don't have unused private class members.","Don't have unused variables.","Make sure void (self-closing) elements don't have children.","Don't return a value from a function that has a 'void' return type.","Make sure all dependencies are correctly specified in React hooks.","Make sure all React hooks are called from the top level of component functions.","Use isNaN() when checking for NaN.","Don't forget key props in iterators and collection literals.",'Make sure "for" loop update clauses move the counter in the right direction.',"Make sure typeof expressions are compared to valid values.","Make sure generator functions contain yield.","Don't use await inside loops.","Don't use bitwise operators.","Don't use expressions where the operation doesn't change the value.","Don't destructure props inside JSX components in Solid projects.","Make sure Promise-like statements are handled appropriately.","Don't use __dirname and __filename in the global scope.","Prevent import cycles.","Don't define React components inside other components.","Don't use event handlers on non-interactive elements.","Don't assign to React component props.","Don't use configured elements.","Don't hardcode sensitive data like API keys and tokens.","Don't let variable declarations shadow variables from outer scopes.","Don't use the TypeScript directive @ts-ignore.","Prevent duplicate polyfills from Polyfill.io.","Don't use useless backreferences in regular expressions that always match empty strings.","Don't use unnecessary escapes in string literals.","Don't use useless undefined.","Make sure getters and setters for the same property are next to each other in class and object definitions.","Make sure object literals are declared consistently (defaults to explicit definitions).","Use static Response methods instead of new Response() constructor when possible.","Make sure switch-case statements are exhaustive.","Make sure the `preconnect` attribute is used when using Google Fonts.","Use `Array#{indexOf,lastIndexOf}()` instead of `Array#{findIndex,findLastIndex}()` when looking for the index of an item.","Make sure iterable callbacks return consistent values.",'Use `with { type: "json" }` for JSON module imports.',"Use numeric separators in numeric literals.","Use object spread instead of `Object.assign()` when constructing new objects.","Always use the radix argument when using `parseInt()`.","Make sure JSDoc comment lines start with a single asterisk, except for the first one.","Include a description parameter for `Symbol()`.","Don't use spread (`...`) syntax on accumulators.","Don't use the `delete` operator.","Don't access namespace imports dynamically.","Don't use `<img>` elements in Next.js projects.","Don't use namespace imports.","Declare regex literals at the top level.",'Don\'t use `target="_blank"` without `rel="noopener"`.',"Don't use dangerous JSX props.","Don't use both `children` and `dangerouslySetInnerHTML` props on the same element.","Don't use global `eval()`.","Don't use callbacks in asynchronous tests and hooks.","Don't use TypeScript enums.","Don't export imported variables.","Don't use `<head>` elements in Next.js projects.","Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions.","Don't use TypeScript namespaces.","Don't use negation in `if` statements that have `else` clauses.","Don't use nested ternary expressions.","Don't use non-null assertions with the `!` postfix operator.","Don't reassign function parameters.","Don't use parameter properties in class constructors.","This rule lets you specify global variable names you don't want to use in your application.","Don't use specified modules when loaded by import or require.","Don't use user-defined types.","Don't use constants whose value is the upper-case version of their name.","Use `String.slice()` instead of `String.substr()` and `String.substring()`.","Don't use template literals if you don't need interpolation or special-character handling.","Don't use `else` blocks when the `if` block breaks early.","Don't use yoda expressions.","Don't use Array constructors.","Use `as const` instead of literal types and type annotations.","Use `at()` instead of integer index access.","Follow curly brace conventions.","Use `else if` instead of nested `if` statements in `else` clauses.","Use single `if` statements instead of nested `if` clauses.","Use either `T[]` or `Array<T>` consistently.","Use `new` for all builtins except `String`, `Number`, and `Boolean`.","Use consistent accessibility modifiers on class properties and methods.","Use `const` declarations for variables that are only assigned once.","Put default function parameters and optional function parameters last.","Include a `default` clause in switch statements.","Initialize each enum member value explicitly.","Use the `**` operator instead of `Math.pow`.","Use `export type` for types.","Use `for-of` loops when you need the index to extract an item from the iterated array.","Use `<>...</>` instead of `<Fragment>...</Fragment>`.","Use `import type` for types.","Make sure all enum members are literal values.","Use `node:assert/strict` over `node:assert`.","Use the `node:` protocol for Node.js builtin modules.","Use Number properties instead of global ones.","Don't add extra closing tags for components without children.","Use assignment operator shorthand where possible.","Use function types instead of object types with call signatures.","Use template literals over string concatenation.","Use `new` when throwing an error.","Don't throw non-Error values.","Use `String.trimStart()` and `String.trimEnd()` over `String.trimLeft()` and `String.trimRight()`.","Use standard constants instead of approximated literals.","Don't use Array index in keys.","Don't assign values in expressions.","Don't use async functions as Promise executors.","Don't reassign exceptions in catch clauses.","Don't reassign class members.","Don't insert comments as text nodes.","Don't compare against -0.","Don't use labeled statements that aren't loops.","Don't use void type outside of generic or return types.","Don't use console.","Don't use TypeScript const enum.","Don't use control characters and escape sequences that match control characters in regular expression literals.","Don't use debugger.","Don't assign directly to document.cookie.","Don't import next/document outside of pages/_document.jsx in Next.js projects.","Use `===` and `!==`.","Don't use duplicate case labels.","Don't use duplicate class members.","Don't use duplicate conditions in if-else-if chains.","Don't assign JSX properties multiple times.","Don't use two keys with the same name inside objects.","Don't use duplicate function parameter names.","Don't have duplicate hooks in describe blocks.","Don't use empty block statements and static blocks.","Don't declare empty interfaces.","Don't let variables evolve into any type through reassignments.","Don't use the any type.","Don't use export or module.exports in test files.","Don't misuse the non-null assertion operator (!) in TypeScript files.","Don't let switch clauses fall through.","Don't use focused tests.","Don't reassign function declarations.","Don't allow assignments to native objects and read-only global variables.","Use Number.isFinite instead of global isFinite.","Use Number.isNaN instead of global isNaN.","Don't use the next/head module in pages/_document.js on Next.js projects.","Don't use implicit any type on variable declarations.","Don't assign to imported bindings.","Don't use irregular whitespace characters.","Don't use labels that share a name with a variable.","Don't use characters made with multiple code points in character class syntax.","Make sure to use new and constructor properly.","Make sure the assertion function, like expect, is placed inside an it() function call.","Don't use shorthand assign when the variable appears on both sides.","Don't use octal escape sequences in string literals.","Don't use Object.prototype builtins directly.","Don't redeclare variables, functions, classes, and types in the same scope.",`Don't have redundant "use strict".`,"Don't compare things where both sides are exactly the same.","Don't let identifiers shadow restricted names.","Don't use disabled tests.","Don't use sparse arrays (arrays with holes).",'Watch out for possible "wrong" semicolons inside JSX elements.',"Don't use template literal placeholder syntax in regular strings.","Don't use the then property.","Don't merge interfaces and classes unsafely.","Don't use unsafe negation.","Don't use var.","Don't use with statements in non-strict contexts.","Don't use overload signatures that aren't next to each other.","Make sure async functions actually use await.","Make sure default clauses in switch statements come last.","Make sure to pass a message value when creating a built-in error.","Make sure get methods always return a value.","Use a recommended display strategy with Google Fonts.","Make sure for-in loops include an if statement.","Use Array.isArray() instead of instanceof Array.","Use the namespace keyword instead of the module keyword to declare TypeScript namespaces.","Make sure to use the digits argument with Number#toFixed().",'Make sure to use the "use strict" directive in script files.'],r=`---
2
+ var H=Object.defineProperty;var pt=Object.getOwnPropertyDescriptor;var mt=Object.getOwnPropertyNames;var ft=Object.prototype.hasOwnProperty;var L=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,s)=>(typeof require<"u"?require:t)[s]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),ve=e=>t=>{var s=e[t];if(s)return s();throw new Error("Module not found in bundle: "+t)};var i=(e,t)=>()=>(e&&(t=e(e=0)),t);var l=(e,t)=>{for(var s in t)H(e,s,{get:t[s],enumerable:!0})},gt=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of mt(t))!ft.call(e,a)&&a!==s&&H(e,a,{get:()=>t[a],enumerable:!(n=pt(t,a))||n.enumerable});return e};var c=e=>gt(H({},"__esModule",{value:!0}),e);var Ce={};l(Ce,{format:()=>G});import{execSync as ht}from"child_process";import yt from"process";var G,B=i(()=>{"use strict";G=(e,t={})=>{try{let s=e.length>0?e.join(" "):"./",n=t.unsafe?" --unsafe":"";ht(`npx @biomejs/biome check --write${n} ${s}`,{stdio:"inherit"})}catch(s){let n=s instanceof Error?s.message:"Unknown error";console.error("Failed to run Ultracite:",n),yt.exit(1)}}});var je={};l(je,{exists:()=>o,isMonorepo:()=>$});import{access as wt,readFile as xt}from"fs/promises";import{parse as bt}from"jsonc-parser";var o,$,u=i(()=>{"use strict";o=async e=>{try{return await wt(e),!0}catch{return!1}},$=async()=>{if(await o("pnpm-workspace.yaml"))return!0;try{let e=bt(await xt("package.json","utf-8"));return e?!!e.workspaces:!1}catch{return!1}}});var Ae={};l(Ae,{biome:()=>v});import{readFile as kt,writeFile as Se}from"fs/promises";import Dt from"deepmerge";import{parse as vt}from"jsonc-parser";var Ue,_,v,Y=i(()=>{"use strict";u();Ue={$schema:"https://biomejs.dev/schemas/2.0.5/schema.json",extends:["ultracite"]},_=async()=>await o("./biome.json")?"./biome.json":"./biome.jsonc",v={exists:async()=>{let e=await _();return o(e)},create:async()=>{let e=await _();return Se(e,JSON.stringify(Ue,null,2))},update:async()=>{let e=await _(),t=await kt(e,"utf-8"),n=vt(t)||{},a=n.extends&&Array.isArray(n.extends)?n.extends:[];a.includes("ultracite")||(n.extends=[...a,"ultracite"]);let p={$schema:Ue.$schema},h=Dt(n,p);await Se(e,JSON.stringify(h,null,2))}}});var Ct,r,f=i(()=>{"use strict";Ct=["Don't use `accessKey` attribute on any HTML element.",'Don\'t set `aria-hidden="true"` on focusable elements.',"Don't add ARIA roles, states, and properties to elements that don't support them.","Don't use distracting elements like `<marquee>` or `<blink>`.","Only use the `scope` prop on `<th>` elements.","Don't assign non-interactive ARIA roles to interactive HTML elements.","Make sure label elements have text content and are associated with an input.","Don't assign interactive ARIA roles to non-interactive HTML elements.","Don't assign `tabIndex` to non-interactive HTML elements.","Don't use positive integers for `tabIndex` property.",'Don\'t include "image", "picture", or "photo" in img `alt` prop.',"Don't use explicit role property that's the same as the implicit/default role.","Make static elements with click handlers use a valid role attribute.","Always include a `title` element for SVG elements.","Give all elements requiring alt text meaningful information for screen readers.","Make sure anchors have content that's accessible to screen readers.","Assign `tabIndex` to non-interactive HTML elements with `aria-activedescendant`.","Include all required ARIA attributes for elements with ARIA roles.","Make sure ARIA properties are valid for the element's supported roles.","Always include a `type` attribute for button elements.","Make elements with interactive roles and handlers focusable.","Give heading elements content that's accessible to screen readers (not hidden with `aria-hidden`).","Always include a `lang` attribute on the html element.","Always include a `title` attribute for iframe elements.","Accompany `onClick` with at least one of: `onKeyUp`, `onKeyDown`, or `onKeyPress`.","Accompany `onMouseOver`/`onMouseOut` with `onFocus`/`onBlur`.","Include caption tracks for audio and video elements.","Use semantic elements instead of role attributes in JSX.","Make sure all anchors are valid and navigable.","Ensure all ARIA properties (`aria-*`) are valid.","Use valid, non-abstract ARIA roles for elements with ARIA roles.","Use valid ARIA state and property values.","Use valid values for the `autocomplete` attribute on input elements.","Use correct ISO language/country codes for the `lang` attribute.","Don't use consecutive spaces in regular expression literals.","Don't use the `arguments` object.","Don't use primitive type aliases or misleading types.","Don't use the comma operator.","Don't use empty type parameters in type aliases and interfaces.","Don't write functions that exceed a given Cognitive Complexity score.","Don't nest describe() blocks too deeply in test files.","Don't use unnecessary boolean casts.","Don't use unnecessary callbacks with flatMap.","Use for...of statements instead of Array.forEach.","Don't create classes that only have static members (like a static namespace).","Don't use this and super in static contexts.","Don't use unnecessary catch clauses.","Don't use unnecessary constructors.","Don't use unnecessary continue statements.","Don't export empty modules that don't change anything.","Don't use unnecessary escape sequences in regular expression literals.","Don't use unnecessary fragments.","Don't use unnecessary labels.","Don't use unnecessary nested block statements.","Don't rename imports, exports, and destructured assignments to the same name.","Don't use unnecessary string or template literal concatenation.","Don't use String.raw in template literals when there are no escape sequences.","Don't use useless case statements in switch statements.","Don't use ternary operators when simpler alternatives exist.","Don't use useless `this` aliasing.","Don't use any or unknown as type constraints.","Don't initialize variables to undefined.","Don't use void operators (they're not familiar).","Use arrow functions instead of function expressions.","Use Date.now() to get milliseconds since the Unix Epoch.","Use .flatMap() instead of map().flat() when possible.","Use literal property access instead of computed property access.","Don't use parseInt() or Number.parseInt() when binary, octal, or hexadecimal literals work.","Use concise optional chaining instead of chained logical expressions.","Use regular expression literals instead of the RegExp constructor when possible.","Don't use number literal object member names that aren't base 10 or use underscore separators.","Remove redundant terms from logical expressions.","Use while loops instead of for loops when you don't need initializer and update expressions.","Don't pass children as props.","Don't reassign const variables.","Don't use constant expressions in conditions.","Don't use `Math.min` and `Math.max` to clamp values when the result is constant.","Don't return a value from a constructor.","Don't use empty character classes in regular expression literals.","Don't use empty destructuring patterns.","Don't call global object properties as functions.","Don't declare functions and vars that are accessible outside their block.","Make sure builtins are correctly instantiated.","Don't use super() incorrectly inside classes. Also check that super() is called in classes that extend other constructors.","Don't use variables and function parameters before they're declared.","Don't use 8 and 9 escape sequences in string literals.","Don't use literal numbers that lose precision.","Don't use the return value of React.render.","Don't assign a value to itself.","Don't return a value from a setter.","Don't compare expressions that modify string case with non-compliant values.","Don't use lexical declarations in switch clauses.","Don't use variables that haven't been declared in the document.","Don't write unreachable code.","Make sure super() is called exactly once on every code path in a class constructor before this is accessed if the class has a superclass.","Don't use control flow statements in finally blocks.","Don't use optional chaining where undefined values aren't allowed.","Don't have unused function parameters.","Don't have unused imports.","Don't have unused labels.","Don't have unused private class members.","Don't have unused variables.","Make sure void (self-closing) elements don't have children.","Don't return a value from a function that has a 'void' return type.","Make sure all dependencies are correctly specified in React hooks.","Make sure all React hooks are called from the top level of component functions.","Use isNaN() when checking for NaN.","Don't forget key props in iterators and collection literals.",'Make sure "for" loop update clauses move the counter in the right direction.',"Make sure typeof expressions are compared to valid values.","Make sure generator functions contain yield.","Don't use await inside loops.","Don't use bitwise operators.","Don't use expressions where the operation doesn't change the value.","Don't destructure props inside JSX components in Solid projects.","Make sure Promise-like statements are handled appropriately.","Don't use __dirname and __filename in the global scope.","Prevent import cycles.","Don't define React components inside other components.","Don't use event handlers on non-interactive elements.","Don't assign to React component props.","Don't use configured elements.","Don't hardcode sensitive data like API keys and tokens.","Don't let variable declarations shadow variables from outer scopes.","Don't use the TypeScript directive @ts-ignore.","Prevent duplicate polyfills from Polyfill.io.","Don't use useless backreferences in regular expressions that always match empty strings.","Don't use unnecessary escapes in string literals.","Don't use useless undefined.","Make sure getters and setters for the same property are next to each other in class and object definitions.","Make sure object literals are declared consistently (defaults to explicit definitions).","Use static Response methods instead of new Response() constructor when possible.","Make sure switch-case statements are exhaustive.","Make sure the `preconnect` attribute is used when using Google Fonts.","Use `Array#{indexOf,lastIndexOf}()` instead of `Array#{findIndex,findLastIndex}()` when looking for the index of an item.","Make sure iterable callbacks return consistent values.",'Use `with { type: "json" }` for JSON module imports.',"Use numeric separators in numeric literals.","Use object spread instead of `Object.assign()` when constructing new objects.","Always use the radix argument when using `parseInt()`.","Make sure JSDoc comment lines start with a single asterisk, except for the first one.","Include a description parameter for `Symbol()`.","Don't use spread (`...`) syntax on accumulators.","Don't use the `delete` operator.","Don't access namespace imports dynamically.","Don't use `<img>` elements in Next.js projects.","Don't use namespace imports.","Declare regex literals at the top level.",'Don\'t use `target="_blank"` without `rel="noopener"`.',"Don't use dangerous JSX props.","Don't use both `children` and `dangerouslySetInnerHTML` props on the same element.","Don't use global `eval()`.","Don't use callbacks in asynchronous tests and hooks.","Don't use TypeScript enums.","Don't export imported variables.","Don't use `<head>` elements in Next.js projects.","Don't add type annotations to variables, parameters, and class properties that are initialized with literal expressions.","Don't use TypeScript namespaces.","Don't use negation in `if` statements that have `else` clauses.","Don't use nested ternary expressions.","Don't use non-null assertions with the `!` postfix operator.","Don't reassign function parameters.","Don't use parameter properties in class constructors.","This rule lets you specify global variable names you don't want to use in your application.","Don't use specified modules when loaded by import or require.","Don't use user-defined types.","Don't use constants whose value is the upper-case version of their name.","Use `String.slice()` instead of `String.substr()` and `String.substring()`.","Don't use template literals if you don't need interpolation or special-character handling.","Don't use `else` blocks when the `if` block breaks early.","Don't use yoda expressions.","Don't use Array constructors.","Use `as const` instead of literal types and type annotations.","Use `at()` instead of integer index access.","Follow curly brace conventions.","Use `else if` instead of nested `if` statements in `else` clauses.","Use single `if` statements instead of nested `if` clauses.","Use either `T[]` or `Array<T>` consistently.","Use `new` for all builtins except `String`, `Number`, and `Boolean`.","Use consistent accessibility modifiers on class properties and methods.","Use `const` declarations for variables that are only assigned once.","Put default function parameters and optional function parameters last.","Include a `default` clause in switch statements.","Initialize each enum member value explicitly.","Use the `**` operator instead of `Math.pow`.","Use `export type` for types.","Use `for-of` loops when you need the index to extract an item from the iterated array.","Use `<>...</>` instead of `<Fragment>...</Fragment>`.","Use `import type` for types.","Make sure all enum members are literal values.","Use `node:assert/strict` over `node:assert`.","Use the `node:` protocol for Node.js builtin modules.","Use Number properties instead of global ones.","Don't add extra closing tags for components without children.","Use assignment operator shorthand where possible.","Use function types instead of object types with call signatures.","Use template literals over string concatenation.","Use `new` when throwing an error.","Don't throw non-Error values.","Use `String.trimStart()` and `String.trimEnd()` over `String.trimLeft()` and `String.trimRight()`.","Use standard constants instead of approximated literals.","Don't use Array index in keys.","Don't assign values in expressions.","Don't use async functions as Promise executors.","Don't reassign exceptions in catch clauses.","Don't reassign class members.","Don't insert comments as text nodes.","Don't compare against -0.","Don't use labeled statements that aren't loops.","Don't use void type outside of generic or return types.","Don't use console.","Don't use TypeScript const enum.","Don't use control characters and escape sequences that match control characters in regular expression literals.","Don't use debugger.","Don't assign directly to document.cookie.","Don't import next/document outside of pages/_document.jsx in Next.js projects.","Use `===` and `!==`.","Don't use duplicate case labels.","Don't use duplicate class members.","Don't use duplicate conditions in if-else-if chains.","Don't assign JSX properties multiple times.","Don't use two keys with the same name inside objects.","Don't use duplicate function parameter names.","Don't have duplicate hooks in describe blocks.","Don't use empty block statements and static blocks.","Don't declare empty interfaces.","Don't let variables evolve into any type through reassignments.","Don't use the any type.","Don't use export or module.exports in test files.","Don't misuse the non-null assertion operator (!) in TypeScript files.","Don't let switch clauses fall through.","Don't use focused tests.","Don't reassign function declarations.","Don't allow assignments to native objects and read-only global variables.","Use Number.isFinite instead of global isFinite.","Use Number.isNaN instead of global isNaN.","Don't use the next/head module in pages/_document.js on Next.js projects.","Don't use implicit any type on variable declarations.","Don't assign to imported bindings.","Don't use irregular whitespace characters.","Don't use labels that share a name with a variable.","Don't use characters made with multiple code points in character class syntax.","Make sure to use new and constructor properly.","Make sure the assertion function, like expect, is placed inside an it() function call.","Don't use shorthand assign when the variable appears on both sides.","Don't use octal escape sequences in string literals.","Don't use Object.prototype builtins directly.","Don't redeclare variables, functions, classes, and types in the same scope.",`Don't have redundant "use strict".`,"Don't compare things where both sides are exactly the same.","Don't let identifiers shadow restricted names.","Don't use disabled tests.","Don't use sparse arrays (arrays with holes).",'Watch out for possible "wrong" semicolons inside JSX elements.',"Don't use template literal placeholder syntax in regular strings.","Don't use the then property.","Don't merge interfaces and classes unsafely.","Don't use unsafe negation.","Don't use var.","Don't use with statements in non-strict contexts.","Don't use overload signatures that aren't next to each other.","Make sure async functions actually use await.","Make sure default clauses in switch statements come last.","Make sure to pass a message value when creating a built-in error.","Make sure get methods always return a value.","Use a recommended display strategy with Google Fonts.","Make sure for-in loops include an if statement.","Use Array.isArray() instead of instanceof Array.","Use the namespace keyword instead of the module keyword to declare TypeScript namespaces.","Make sure to use the digits argument with Number#toFixed().",'Make sure to use the "use strict" directive in script files.'],r=`---
3
3
  description: Ultracite Rules
4
4
  globs: "**/*.{ts,tsx,js,jsx}"
5
5
  alwaysApply: true
6
6
  ---
7
7
 
8
8
  ${Ct.map(e=>`- ${e}`).join(`
9
- `)}`});var Re={};l(Re,{claude:()=>v});import{mkdir as Me,writeFile as Fe}from"fs/promises";var Z,v,B=i(()=>{"use strict";f();u();Z="./.claude/CLAUDE.md",v={exists:()=>o(Z),create:async()=>{await Me(".claude",{recursive:!0}),await Fe(Z,r)},update:async()=>{await Me(".claude",{recursive:!0}),await Fe(Z,r)}}});var $e={};l($e,{codex:()=>C});import{writeFile as Ie}from"fs/promises";var V,C,X=i(()=>{"use strict";f();u();V="./AGENTS.md",C={exists:()=>o(V),create:async()=>{await Ie(V,r)},update:async()=>{await Ie(V,r)}}});var Oe={};l(Oe,{cursor:()=>j});import{mkdir as Pe,writeFile as Ne}from"fs/promises";var Q,j,ee=i(()=>{"use strict";f();u();Q="./.cursor/rules/ultracite.mdc",j={exists:()=>o(Q),create:async()=>{await Pe(".cursor/rules",{recursive:!0}),await Ne(Q,r)},update:async()=>{await Pe(".cursor/rules",{recursive:!0}),await Ne(Q,r)}}});var We={};l(We,{husky:()=>y});import{execSync as jt}from"child_process";import{mkdir as St,readFile as Ut,writeFile as Je}from"fs/promises";var Te,O,y,te=i(()=>{"use strict";u();Te="npx ultracite format",O="./.husky/pre-commit",y={exists:()=>o(O),install:e=>{jt(`${e} -D husky`)},create:async()=>{await St(".husky",{recursive:!0}),await Je(O,Te)},update:async()=>{let e=await Ut(O,"utf-8");await Je(O,`${e}
10
- ${Te}`)}}});var qe={};l(qe,{lefthook:()=>x});import{execSync as ze}from"child_process";import{readFile as At,writeFile as J}from"fs/promises";var T,w,Ee,x,se=i(()=>{"use strict";u();T="npx ultracite format",w="./lefthook.yml",Ee=`pre-commit:
9
+ `)}`});var Re={};l(Re,{claude:()=>C});import{mkdir as Me,writeFile as Fe}from"fs/promises";var K,C,Z=i(()=>{"use strict";f();u();K="./.claude/CLAUDE.md",C={exists:()=>o(K),create:async()=>{await Me(".claude",{recursive:!0}),await Fe(K,r)},update:async()=>{await Me(".claude",{recursive:!0}),await Fe(K,r)}}});var Pe={};l(Pe,{codex:()=>j});import{writeFile as Ie}from"fs/promises";var V,j,X=i(()=>{"use strict";f();u();V="./AGENTS.md",j={exists:()=>o(V),create:async()=>{await Ie(V,r)},update:async()=>{await Ie(V,r)}}});var Oe={};l(Oe,{cursor:()=>S});import{mkdir as $e,writeFile as Ne}from"fs/promises";var Q,S,ee=i(()=>{"use strict";f();u();Q="./.cursor/rules/ultracite.mdc",S={exists:()=>o(Q),create:async()=>{await $e(".cursor/rules",{recursive:!0}),await Ne(Q,r)},update:async()=>{await $e(".cursor/rules",{recursive:!0}),await Ne(Q,r)}}});var We={};l(We,{husky:()=>w});import{execSync as jt}from"child_process";import{mkdir as St,readFile as Ut,writeFile as Je}from"fs/promises";var Te,N,w,te=i(()=>{"use strict";u();Te="npx ultracite format",N="./.husky/pre-commit",w={exists:()=>o(N),install:e=>{jt(`${e} -D husky`)},create:async()=>{await St(".husky",{recursive:!0}),await Je(N,Te)},update:async()=>{let e=await Ut(N,"utf-8");await Je(N,`${e}
10
+ ${Te}`)}}});var qe={};l(qe,{lefthook:()=>b});import{execSync as ze}from"child_process";import{readFile as At,writeFile as O}from"fs/promises";var J,x,Ee,b,se=i(()=>{"use strict";u();J="npx ultracite format",x="./lefthook.yml",Ee=`pre-commit:
11
11
  jobs:
12
- - run: ${T}
12
+ - run: ${J}
13
13
  glob:
14
14
  - "*.js"
15
15
  - "*.jsx"
@@ -19,7 +19,7 @@ ${Te}`)}}});var qe={};l(qe,{lefthook:()=>x});import{execSync as ze}from"child_pr
19
19
  - "*.jsonc"
20
20
  - "*.css"
21
21
  stage_fixed: true
22
- `,x={exists:()=>o(w),install:e=>{ze(`${e} -D lefthook`),ze("npx lefthook install")},create:async()=>{await J(w,Ee)},update:async()=>{let e=await At(w,"utf-8");if(!e.includes(T))if(e.includes("pre-commit:"))if(e.includes("jobs:")){let t=` - run: ${T}
22
+ `,b={exists:()=>o(x),install:e=>{ze(`${e} -D lefthook`),ze("npx lefthook install")},create:async()=>{await O(x,Ee)},update:async()=>{let e=await At(x,"utf-8");if(!e.includes(J))if(e.includes("pre-commit:"))if(e.includes("jobs:")){let t=` - run: ${J}
23
23
  glob:
24
24
  - "*.js"
25
25
  - "*.jsx"
@@ -29,8 +29,8 @@ ${Te}`)}}});var qe={};l(qe,{lefthook:()=>x});import{execSync as ze}from"child_pr
29
29
  - "*.jsonc"
30
30
  - "*.css"
31
31
  stage_fixed: true`,s=e.replace(/(pre-commit:\s*\n\s*jobs:\s*\n)/,`$1${t}
32
- `);await J(w,s)}else{let t=` jobs:
33
- - run: ${T}
32
+ `);await O(x,s)}else{let t=` jobs:
33
+ - run: ${J}
34
34
  glob:
35
35
  - "*.js"
36
36
  - "*.jsx"
@@ -40,8 +40,8 @@ ${Te}`)}}});var qe={};l(qe,{lefthook:()=>x});import{execSync as ze}from"child_pr
40
40
  - "*.jsonc"
41
41
  - "*.css"
42
42
  stage_fixed: true`,s=e.replace(/(pre-commit:\s*\n)/,`$1${t}
43
- `);await J(w,s)}else await J(w,`${e}
44
- ${Ee}`)}}});var He={};l(He,{lint:()=>ne});import{execSync as Mt}from"child_process";import Ft from"process";var ne,oe=i(()=>{"use strict";ne=e=>{try{let t=e.length>0?e.join(" "):"./";Mt(`npx @biomejs/biome check ${t}`,{stdio:"inherit"})}catch(t){let s=t instanceof Error?t.message:"Unknown error";console.error("Failed to run Ultracite:",s),Ft.exit(1)}}});var Ge={};l(Ge,{packageManager:()=>W});import{log as Rt,select as It}from"@clack/prompts";var Le,W,ae=i(()=>{"use strict";u();Le=[{hint:"Recommended",label:"pnpm",value:"pnpm add",lockfile:"pnpm-lock.yaml",monorepoSuffix:"-w"},{label:"bun",value:"bun add",lockfile:"bun.lockb",monorepoSuffix:""},{label:"yarn",value:"yarn add",lockfile:"yarn.lock",monorepoSuffix:""},{label:"npm",value:"npm install",lockfile:"package-lock.json",monorepoSuffix:"--workspace ."}],W={get:async()=>{let e=await P();e&&Rt.info("Monorepo detected, updating install command to include workspace flag");for(let t of Le)if(await o(t.lockfile))return e&&t.monorepoSuffix?`${t.value} ${t.monorepoSuffix}`:t.value;return null},select:async()=>{let e=await P(),t=await It({initialValue:"pnpm",message:"Which package manager do you use?",options:Le.map(s=>({label:s.label,value:e&&s.monorepoSuffix?`${s.value} ${s.monorepoSuffix}`:s.value}))});return typeof t!="string"?null:t}}});var _e={};l(_e,{title:()=>ie});var ie,re=i(()=>{"use strict";ie=`
43
+ `);await O(x,s)}else await O(x,`${e}
44
+ ${Ee}`)}}});var He={};l(He,{lint:()=>ne});import{execSync as Mt}from"child_process";import Ft from"process";var ne,oe=i(()=>{"use strict";ne=e=>{try{let t=e.length>0?e.join(" "):"./";Mt(`npx @biomejs/biome check ${t}`,{stdio:"inherit"})}catch(t){let s=t instanceof Error?t.message:"Unknown error";console.error("Failed to run Ultracite:",s),Ft.exit(1)}}});var Ge={};l(Ge,{packageManager:()=>T});import{log as Rt,select as It}from"@clack/prompts";var Le,T,ae=i(()=>{"use strict";u();Le=[{hint:"Recommended",label:"pnpm",value:"pnpm add",lockfile:"pnpm-lock.yaml",monorepoSuffix:"-w"},{label:"bun",value:"bun add",lockfile:"bun.lockb",monorepoSuffix:""},{label:"yarn",value:"yarn add",lockfile:"yarn.lock",monorepoSuffix:""},{label:"npm",value:"npm install",lockfile:"package-lock.json",monorepoSuffix:"--workspace ."}],T={get:async()=>{let e=await $();e&&Rt.info("Monorepo detected, updating install command to include workspace flag");for(let t of Le)if(await o(t.lockfile))return e&&t.monorepoSuffix?`${t.value} ${t.monorepoSuffix}`:t.value;return null},select:async()=>{let e=await $(),t=await It({initialValue:"pnpm",message:"Which package manager do you use?",options:Le.map(s=>({label:s.label,value:e&&s.monorepoSuffix?`${s.value} ${s.monorepoSuffix}`:s.value}))});return typeof t!="string"?null:t}}});var Be={};l(Be,{title:()=>ie});var ie,re=i(()=>{"use strict";ie=`
45
45
  888 888 888 88888888888 8888888b. d8888 .d8888b. 8888888 88888888888 8888888888
46
46
  888 888 888 888 888 Y88b d88888 d88P Y88b 888 888 888
47
47
  888 888 888 888 888 888 d88P888 888 888 888 888 888
@@ -50,12 +50,12 @@ ${Ee}`)}}});var He={};l(He,{lint:()=>ne});import{execSync as Mt}from"child_proce
50
50
  888 888 888 888 888 T88b d88P 888 888 888 888 888 888
51
51
  Y88b. .d88P 888 888 888 T88b d8888888888 Y88b d88P 888 888 888
52
52
  "Y88888P" 88888888 888 888 T88b d88P 888 "Y8888P" 8888888 888 8888888888
53
- `});var Ze={};l(Ze,{tsconfig:()=>S});import{readFile as $t,writeFile as Ye}from"fs/promises";import Pt from"deepmerge";import{parse as Nt}from"jsonc-parser";var Ke,z,S,ce=i(()=>{"use strict";u();Ke={compilerOptions:{strictNullChecks:!0}},z="./tsconfig.json",S={exists:()=>o(z),create:()=>Ye(z,JSON.stringify(Ke,null,2)),update:async()=>{let e=await $t(z,"utf-8"),s=Nt(e)||{},n=Pt(s,Ke);await Ye(z,JSON.stringify(n,null,2))}}});var Xe={};l(Xe,{vscodeCopilot:()=>U});import{mkdir as Be,writeFile as Ve}from"fs/promises";var le,U,ue=i(()=>{"use strict";f();u();le="./.github/copilot-instructions.md",U={exists:()=>o(le),create:async()=>{await Be(".github",{recursive:!0}),await Ve(le,r)},update:async()=>{await Be(".github",{recursive:!0}),await Ve(le,r)}}});var tt={};l(tt,{vscode:()=>A});import{mkdir as Ot,readFile as Jt,writeFile as Qe}from"fs/promises";import Tt from"deepmerge";import{parse as Wt}from"jsonc-parser";var et,E,A,de=i(()=>{"use strict";u();et={"editor.defaultFormatter":"esbenp.prettier-vscode","[javascript][typescript][javascriptreact][typescriptreact][json][jsonc][css][graphql]":{"editor.defaultFormatter":"biomejs.biome"},"typescript.tsdk":"node_modules/typescript/lib","editor.formatOnSave":!0,"editor.formatOnPaste":!0,"emmet.showExpandedAbbreviation":"never","editor.codeActionsOnSave":{"source.fixAll.biome":"explicit","source.organizeImports.biome":"explicit"}},E="./.vscode/settings.json",A={exists:()=>o(E),create:async()=>{await Ot(".vscode",{recursive:!0}),await Qe(E,JSON.stringify(et,null,2))},update:async()=>{let e=await Jt(E,"utf-8"),s=Wt(e)||{},n=Tt(s,et);await Qe(E,JSON.stringify(n,null,2))}}});var ot={};l(ot,{windsurf:()=>M});import{mkdir as st,writeFile as nt}from"fs/promises";var pe,M,me=i(()=>{"use strict";f();u();pe="./.windsurf/rules/ultracite.md",M={exists:()=>o(pe),create:async()=>{await st(".windsurf/rules",{recursive:!0}),await nt(pe,r)},update:async()=>{await st(".windsurf/rules",{recursive:!0}),await nt(pe,r)}}});var at={};l(at,{zed:()=>F});import{readFile as zt,writeFile as fe}from"fs/promises";var b,F,ge=i(()=>{"use strict";f();u();b="./.rules",F={exists:()=>o(b),create:async()=>{await fe(b,r)},update:async()=>{if(!await o(b)){await fe(b,r);return}let e=await zt(b,"utf-8");e.includes(r.trim())||await fe(b,`${e}
53
+ `});var Ke={};l(Ke,{tsconfig:()=>U});import{readFile as Pt,writeFile as _e}from"fs/promises";import $t from"deepmerge";import{parse as Nt}from"jsonc-parser";var Ye,W,U,ce=i(()=>{"use strict";u();Ye={compilerOptions:{strictNullChecks:!0}},W="./tsconfig.json",U={exists:()=>o(W),create:()=>_e(W,JSON.stringify(Ye,null,2)),update:async()=>{let e=await Pt(W,"utf-8"),s=Nt(e)||{},n=$t(s,Ye);await _e(W,JSON.stringify(n,null,2))}}});var Xe={};l(Xe,{vscodeCopilot:()=>A});import{mkdir as Ze,writeFile as Ve}from"fs/promises";var le,A,ue=i(()=>{"use strict";f();u();le="./.github/copilot-instructions.md",A={exists:()=>o(le),create:async()=>{await Ze(".github",{recursive:!0}),await Ve(le,r)},update:async()=>{await Ze(".github",{recursive:!0}),await Ve(le,r)}}});var tt={};l(tt,{vscode:()=>M});import{mkdir as Ot,readFile as Jt,writeFile as Qe}from"fs/promises";import Tt from"deepmerge";import{parse as Wt}from"jsonc-parser";var et,z,M,de=i(()=>{"use strict";u();et={"editor.defaultFormatter":"esbenp.prettier-vscode","[javascript][typescript][javascriptreact][typescriptreact][json][jsonc][css][graphql]":{"editor.defaultFormatter":"biomejs.biome"},"typescript.tsdk":"node_modules/typescript/lib","editor.formatOnSave":!0,"editor.formatOnPaste":!0,"emmet.showExpandedAbbreviation":"never","editor.codeActionsOnSave":{"source.fixAll.biome":"explicit","source.organizeImports.biome":"explicit"}},z="./.vscode/settings.json",M={exists:()=>o(z),create:async()=>{await Ot(".vscode",{recursive:!0}),await Qe(z,JSON.stringify(et,null,2))},update:async()=>{let e=await Jt(z,"utf-8"),s=Wt(e)||{},n=Tt(s,et);await Qe(z,JSON.stringify(n,null,2))}}});var ot={};l(ot,{windsurf:()=>F});import{mkdir as st,writeFile as nt}from"fs/promises";var pe,F,me=i(()=>{"use strict";f();u();pe="./.windsurf/rules/ultracite.md",F={exists:()=>o(pe),create:async()=>{await st(".windsurf/rules",{recursive:!0}),await nt(pe,r)},update:async()=>{await st(".windsurf/rules",{recursive:!0}),await nt(pe,r)}}});var at={};l(at,{zed:()=>R});import{readFile as zt,writeFile as fe}from"fs/promises";var k,R,ge=i(()=>{"use strict";f();u();k="./.rules",R={exists:()=>o(k),create:async()=>{await fe(k,r)},update:async()=>{if(!await o(k)){await fe(k,r);return}let e=await zt(k,"utf-8");e.includes(r.trim())||await fe(k,`${e}
54
54
 
55
- ${r}`)}}});var qt,he=i(()=>{qt=ve({"./biome.ts":()=>(K(),c(Ae)),"./claude.ts":()=>(B(),c(Re)),"./codex.ts":()=>(X(),c($e)),"./cursor.ts":()=>(ee(),c(Oe)),"./format.ts":()=>(Y(),c(Ce)),"./husky.ts":()=>(te(),c(We)),"./index.ts":()=>(ct(),c(Et)),"./initialize.ts":()=>(we(),c(rt)),"./lefthook.ts":()=>(se(),c(qe)),"./lint-staged.ts":()=>(ye(),c(it)),"./lint.ts":()=>(oe(),c(He)),"./package-manager.ts":()=>(ae(),c(Ge)),"./title.ts":()=>(re(),c(_e)),"./tsconfig.ts":()=>(ce(),c(Ze)),"./utils.ts":()=>(u(),c(je)),"./vscode-copilot.ts":()=>(ue(),c(Xe)),"./vscode-settings.ts":()=>(de(),c(tt)),"./windsurf.ts":()=>(me(),c(ot)),"./zed.ts":()=>(ge(),c(at))})});var it={};l(it,{lintStaged:()=>k});import{execSync as Ht}from"child_process";import{readFile as q,writeFile as g}from"fs/promises";import{pathToFileURL as Lt}from"url";import R from"deepmerge";import{parse as be}from"jsonc-parser";var m,lt,Gt,_t,Yt,Kt,Zt,Bt,Vt,Xt,Qt,xe,es,k,ye=i(()=>{"use strict";u();he();m={"*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}":["npx ultracite format"]},lt=["./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"],Gt=(e,t,s,n)=>{let a=e.trim();if(a.includes(":")&&!a.startsWith("-")){s&&n.length>0&&(t[s]=n);let[p,...$]=a.split(":"),h=$.join(":").trim(),H=p.trim().replace(/['"]/g,"");return h&&h!==""?(h.startsWith("[")&&h.endsWith("]")?t[H]=h.slice(1,-1).split(",").map(dt=>dt.trim().replace(/['"]/g,"")):t[H]=h.replace(/['"]/g,""),{newCurrentKey:null,newCurrentArray:[]}):{newCurrentKey:H,newCurrentArray:[]}}if(a.startsWith("-")&&s){let p=[...n,a.slice(1).trim().replace(/['"]/g,"")];return{newCurrentKey:s,newCurrentArray:p}}return{newCurrentKey:s,newCurrentArray:n}},_t=e=>{let t=e.split(`
56
- `).filter(p=>p.trim()&&!p.trim().startsWith("#")),s={},n=null,a=[];for(let p of t){let $=Gt(p,s,n,a);n=$.newCurrentKey,a=$.newCurrentArray}return n&&a.length>0&&(s[n]=a),s},Yt=e=>{let t="";for(let[s,n]of Object.entries(e))if(Array.isArray(n)){t+=`${s}:
55
+ ${r}`)}}});var qt,he=i(()=>{qt=ve({"./biome.ts":()=>(Y(),c(Ae)),"./claude.ts":()=>(Z(),c(Re)),"./codex.ts":()=>(X(),c(Pe)),"./cursor.ts":()=>(ee(),c(Oe)),"./format.ts":()=>(B(),c(Ce)),"./husky.ts":()=>(te(),c(We)),"./index.ts":()=>(ct(),c(Et)),"./initialize.ts":()=>(we(),c(rt)),"./lefthook.ts":()=>(se(),c(qe)),"./lint-staged.ts":()=>(ye(),c(it)),"./lint.ts":()=>(oe(),c(He)),"./package-manager.ts":()=>(ae(),c(Ge)),"./title.ts":()=>(re(),c(Be)),"./tsconfig.ts":()=>(ce(),c(Ke)),"./utils.ts":()=>(u(),c(je)),"./vscode-copilot.ts":()=>(ue(),c(Xe)),"./vscode-settings.ts":()=>(de(),c(tt)),"./windsurf.ts":()=>(me(),c(ot)),"./zed.ts":()=>(ge(),c(at))})});var it={};l(it,{lintStaged:()=>D});import{execSync as Ht}from"child_process";import{readFile as E,writeFile as g}from"fs/promises";import{pathToFileURL as Lt}from"url";import I from"deepmerge";import{parse as be}from"jsonc-parser";var m,lt,Gt,Bt,_t,Yt,Kt,Zt,Vt,Xt,Qt,xe,es,D,ye=i(()=>{"use strict";u();he();m={"*.{js,jsx,ts,tsx,json,jsonc,css,scss,md,mdx}":["npx ultracite format"]},lt=["./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"],Gt=(e,t,s,n)=>{let a=e.trim();if(a.includes(":")&&!a.startsWith("-")){s&&n.length>0&&(t[s]=n);let[p,...h]=a.split(":"),y=h.join(":").trim(),q=p.trim().replace(/['"]/g,"");return y&&y!==""?(y.startsWith("[")&&y.endsWith("]")?t[q]=y.slice(1,-1).split(",").map(dt=>dt.trim().replace(/['"]/g,"")):t[q]=y.replace(/['"]/g,""),{newCurrentKey:null,newCurrentArray:[]}):{newCurrentKey:q,newCurrentArray:[]}}if(a.startsWith("-")&&s){let p=[...n,a.slice(1).trim().replace(/['"]/g,"")];return{newCurrentKey:s,newCurrentArray:p}}return{newCurrentKey:s,newCurrentArray:n}},Bt=e=>{let t=e.split(`
56
+ `).filter(p=>p.trim()&&!p.trim().startsWith("#")),s={},n=null,a=[];for(let p of t){let h=Gt(p,s,n,a);n=h.newCurrentKey,a=h.newCurrentArray}return n&&a.length>0&&(s[n]=a),s},_t=e=>{let t="";for(let[s,n]of Object.entries(e))if(Array.isArray(n)){t+=`${s}:
57
57
  `;for(let a of n)t+=` - '${a}'
58
58
  `}else t+=`${s}: '${n}'
59
- `;return t},Kt=async()=>{try{let e=be(await q("./package.json","utf-8"));return e?e.type==="module":!1}catch{return!1}},Zt=async()=>{let e=be(await q("./package.json","utf-8"));e&&(e["lint-staged"]?e["lint-staged"]=R(e["lint-staged"],m):e["lint-staged"]=m,await g("./package.json",JSON.stringify(e,null,2)))},Bt=async e=>{let t=await q(e,"utf-8"),s=be(t);if(!s)return;let n=R(s,m);await g(e,JSON.stringify(n,null,2))},Vt=async e=>{let t=await q(e,"utf-8"),s=_t(t);if(!s)return;let n=R(s,m);await g(e,Yt(n))},Xt=async e=>{let n=(await import(Lt(e).href)).default||{},a=R(n,m),p=`export default ${JSON.stringify(a,null,2)};
60
- `;await g(e,p)},Qt=async e=>{delete G.cache[G.resolve(`./${e}`)];let t=qt(`./${e}`),s=R(t,m),n=`module.exports = ${JSON.stringify(s,null,2)};
61
- `;await g(e,n)},xe=async()=>{await g(".lintstagedrc.json",JSON.stringify(m,null,2))},es=async e=>{if(e==="./package.json"){await Zt();return}if(e.endsWith(".json")||e==="./.lintstagedrc"){await Bt(e);return}if(e.endsWith(".yaml")||e.endsWith(".yml")){await Vt(e);return}let t=await Kt();if(e.endsWith(".mjs")||e.endsWith(".js")&&t){try{await Xt(e)}catch{await xe()}return}if(e.endsWith(".cjs")||e.endsWith(".js")&&!t)try{await Qt(e)}catch{await xe()}},k={exists:async()=>{for(let e of lt)if(await o(e))return!0;return!1},install:e=>{Ht(`${e} -D lint-staged`)},create:async()=>{await g(".lintstagedrc.json",JSON.stringify(m,null,2))},update:async()=>{let e=null;for(let t of lt)if(await o(t)){e=t;break}if(!e){await xe();return}await es(e)}}});var rt={};l(rt,{initialize:()=>De});import{execSync as ts}from"child_process";import ss from"process";import{intro as ns,log as ke,multiselect as ut,spinner as d}from"@clack/prompts";var os,as,is,rs,cs,ls,us,ds,ps,ms,fs,gs,hs,De,we=i(()=>{"use strict";K();B();X();ee();te();se();ye();ae();re();ce();ue();de();me();ge();os=e=>{let t=d();t.start("Installing dependencies..."),ts(`${e} -D -E ultracite @biomejs/biome@2.0.5`),t.stop("Dependencies installed.")},as=async()=>{let e=d();if(e.start("Checking for tsconfig.json..."),await S.exists()){e.message("tsconfig.json found, updating..."),await S.update(),e.stop("tsconfig.json updated.");return}e.message("tsconfig.json not found, creating..."),await S.create(),e.stop("tsconfig.json created.")},is=async()=>{let e=d();if(e.start("Checking for .vscode/settings.json..."),await A.exists()){e.message("settings.json found, updating..."),await A.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await A.create(),e.stop("settings.json created.")},rs=async()=>{let e=d();if(e.start("Checking for biome.jsonc..."),await D.exists()){e.message("biome.jsonc found, updating..."),await D.update(),e.stop("biome.jsonc updated.");return}e.message("biome.jsonc not found, creating..."),await D.create(),e.stop("biome.jsonc created.")},cs=async e=>{let t=d();if(t.start("Initializing pre-commit hooks..."),t.message("Installing Husky..."),y.install(e),await y.exists()){t.message("Pre-commit hook found, updating..."),await y.update(),t.stop("Pre-commit hook updated.");return}t.message("Updating pre-commit hook..."),t.message("Pre-commit hook not found, creating..."),await y.create(),t.stop("Pre-commit hook created.")},ls=async e=>{let t=d();if(t.start("Initializing lefthook..."),t.message("Installing lefthook..."),x.install(e),await x.exists()){t.message("lefthook.yml found, updating..."),await x.update(),t.stop("lefthook.yml updated.");return}t.message("lefthook.yml not found, creating..."),await x.create(),t.stop("lefthook.yml created.")},us=async e=>{let t=d();if(t.start("Initializing lint-staged..."),t.message("Installing lint-staged..."),k.install(e),await k.exists()){t.message("lint-staged found, updating..."),await k.update(),t.stop("lint-staged updated.");return}t.message("lint-staged not found, creating..."),await k.create(),t.stop("lint-staged created.")},ds=async()=>{let e=d();if(e.start("Checking for GitHub Copilot rules..."),await U.exists()){e.message("GitHub Copilot rules found, updating..."),await U.update(),e.stop("GitHub Copilot rules updated.");return}e.message("GitHub Copilot rules not found, creating..."),await U.create(),e.stop("GitHub Copilot rules created.")},ps=async()=>{let e=d();if(e.start("Checking for Cursor rules..."),await j.exists()){e.message("Cursor rules found, updating..."),await j.update(),e.stop("Cursor rules updated.");return}e.message("Cursor rules not found, creating..."),await j.create(),e.stop("Cursor rules created.")},ms=async()=>{let e=d();if(e.start("Checking for Windsurf rules..."),await M.exists()){e.message("Windsurf rules found, updating..."),await M.update(),e.stop("Windsurf rules updated.");return}e.message("Windsurf rules not found, creating..."),await M.create(),e.stop("Windsurf rules created.")},fs=async()=>{let e=d();if(e.start("Checking for Zed rules..."),await F.exists()){e.message("Zed rules found, updating..."),await F.update(),e.stop("Zed rules updated.");return}e.message("Zed rules not found, creating..."),await F.create(),e.stop("Zed rules created.")},gs=async()=>{let e=d();if(e.start("Checking for Claude Code rules..."),await v.exists()){e.message("Claude Code rules found, updating..."),await v.update(),e.stop("Claude Code rules updated.");return}e.message("Claude Code rules not found, creating..."),await v.create(),e.stop("Claude Code rules created.")},hs=async()=>{let e=d();if(e.start("Checking for OpenAI Codex rules..."),await C.exists()){e.message("OpenAI Codex rules found, updating..."),await C.update(),e.stop("OpenAI Codex rules updated.");return}e.message("OpenAI Codex rules not found, creating..."),await C.create(),e.stop("OpenAI Codex rules created.")},De=async()=>{ns(ie);try{let e=await W.get();if(e?ke.info(`Detected lockfile, using ${e}`):e=await W.select(),!e||typeof e!="string")throw new Error("No package manager selected");let t=await ut({message:"Which editor rules do you want to enable (optional)?",options:[{label:"GitHub Copilot (VSCode)",value:"vscode-copilot"},{label:"Cursor",value:"cursor"},{label:"Windsurf",value:"windsurf"},{label:"Zed",value:"zed"},{label:"Claude Code",value:"claude"},{label:"OpenAI Codex",value:"codex"}],required:!1}),s=await ut({message:"Would you like any of the following (optional)?",options:[{label:"Husky pre-commit hook",value:"precommit-hooks"},{label:"Lefthook pre-commit hook",value:"lefthook"},{label:"Lint-staged",value:"lint-staged"}],required:!1});os(e),await as(),await is(),await rs(),Array.isArray(t)&&(t.includes("vscode-copilot")&&await ds(),t.includes("cursor")&&await ps(),t.includes("windsurf")&&await ms(),t.includes("zed")&&await fs(),t.includes("claude")&&await gs(),t.includes("codex")&&await hs()),Array.isArray(s)&&(s.includes("precommit-hooks")&&await cs(e),s.includes("lefthook")&&await ls(e),s.includes("lint-staged")&&await us(e)),ke.success("Successfully initialized Ultracite configuration!")}catch(e){let t=e instanceof Error?e.message:"Unknown error";ke.error(`Failed to initialize Ultracite configuration: ${t}`),ss.exit(1)}}});var Et={};import{Command as ys}from"commander";var I,ct=i(()=>{Y();we();oe();I=new ys;I.name("Ultracite").description("Ship code faster and with more confidence.");I.command("init").description("Initialize Ultracite in the current directory").action(De);I.command("lint").description("Run Biome linter without fixing files").argument("[files...]","specific files to lint (optional)").action(ne);I.command("format").description("Run Biome linter and fixes files").argument("[files...]","specific files to format (optional)").option("--unsafe","apply unsafe fixes").action(_);I.parse()});ct();
59
+ `;return t},Yt=async()=>{try{let e=be(await E("./package.json","utf-8"));return e?e.type==="module":!1}catch{return!1}},Kt=async()=>{let e=be(await E("./package.json","utf-8"));e&&(e["lint-staged"]?e["lint-staged"]=I(e["lint-staged"],m):e["lint-staged"]=m,await g("./package.json",JSON.stringify(e,null,2)))},Zt=async e=>{let t=await E(e,"utf-8"),s=be(t);if(!s)return;let n=I(s,m);await g(e,JSON.stringify(n,null,2))},Vt=async e=>{let t=await E(e,"utf-8"),s=Bt(t);if(!s)return;let n=I(s,m);await g(e,_t(n))},Xt=async e=>{let n=(await import(Lt(e).href)).default||{},a=I(n,m),p=`export default ${JSON.stringify(a,null,2)};
60
+ `;await g(e,p)},Qt=async e=>{delete L.cache[L.resolve(`./${e}`)];let t=qt(`./${e}`),s=I(t,m),n=`module.exports = ${JSON.stringify(s,null,2)};
61
+ `;await g(e,n)},xe=async()=>{await g(".lintstagedrc.json",JSON.stringify(m,null,2))},es=async e=>{if(e==="./package.json"){await Kt();return}if(e.endsWith(".json")||e==="./.lintstagedrc"){await Zt(e);return}if(e.endsWith(".yaml")||e.endsWith(".yml")){await Vt(e);return}let t=await Yt();if(e.endsWith(".mjs")||e.endsWith(".js")&&t){try{await Xt(e)}catch{await xe()}return}if(e.endsWith(".cjs")||e.endsWith(".js")&&!t)try{await Qt(e)}catch{await xe()}},D={exists:async()=>{for(let e of lt)if(await o(e))return!0;return!1},install:e=>{Ht(`${e} -D lint-staged`)},create:async()=>{await g(".lintstagedrc.json",JSON.stringify(m,null,2))},update:async()=>{let e=null;for(let t of lt)if(await o(t)){e=t;break}if(!e){await xe();return}await es(e)}}});var rt={};l(rt,{initialize:()=>De});import{execSync as ts}from"child_process";import ss from"process";import{intro as ns,log as ke,multiselect as ut,spinner as d}from"@clack/prompts";var os,as,is,rs,cs,ls,us,ds,ps,ms,fs,gs,hs,De,we=i(()=>{"use strict";Y();Z();X();ee();te();se();ye();ae();re();ce();ue();de();me();ge();os=e=>{let t=d();t.start("Installing dependencies..."),ts(`${e} -D -E ultracite @biomejs/biome@2.0.5`),t.stop("Dependencies installed.")},as=async()=>{let e=d();if(e.start("Checking for tsconfig.json..."),await U.exists()){e.message("tsconfig.json found, updating..."),await U.update(),e.stop("tsconfig.json updated.");return}e.message("tsconfig.json not found, creating..."),await U.create(),e.stop("tsconfig.json created.")},is=async()=>{let e=d();if(e.start("Checking for .vscode/settings.json..."),await M.exists()){e.message("settings.json found, updating..."),await M.update(),e.stop("settings.json updated.");return}e.message("settings.json not found, creating..."),await M.create(),e.stop("settings.json created.")},rs=async()=>{let e=d();if(e.start("Checking for Biome configuration..."),await v.exists()){e.message("Biome configuration found, updating..."),await v.update(),e.stop("Biome configuration updated.");return}e.message("Biome configuration not found, creating..."),await v.create(),e.stop("Biome configuration created.")},cs=async e=>{let t=d();if(t.start("Initializing pre-commit hooks..."),t.message("Installing Husky..."),w.install(e),await w.exists()){t.message("Pre-commit hook found, updating..."),await w.update(),t.stop("Pre-commit hook updated.");return}t.message("Updating pre-commit hook..."),t.message("Pre-commit hook not found, creating..."),await w.create(),t.stop("Pre-commit hook created.")},ls=async e=>{let t=d();if(t.start("Initializing lefthook..."),t.message("Installing lefthook..."),b.install(e),await b.exists()){t.message("lefthook.yml found, updating..."),await b.update(),t.stop("lefthook.yml updated.");return}t.message("lefthook.yml not found, creating..."),await b.create(),t.stop("lefthook.yml created.")},us=async e=>{let t=d();if(t.start("Initializing lint-staged..."),t.message("Installing lint-staged..."),D.install(e),await D.exists()){t.message("lint-staged found, updating..."),await D.update(),t.stop("lint-staged updated.");return}t.message("lint-staged not found, creating..."),await D.create(),t.stop("lint-staged created.")},ds=async()=>{let e=d();if(e.start("Checking for GitHub Copilot rules..."),await A.exists()){e.message("GitHub Copilot rules found, updating..."),await A.update(),e.stop("GitHub Copilot rules updated.");return}e.message("GitHub Copilot rules not found, creating..."),await A.create(),e.stop("GitHub Copilot rules created.")},ps=async()=>{let e=d();if(e.start("Checking for Cursor rules..."),await S.exists()){e.message("Cursor rules found, updating..."),await S.update(),e.stop("Cursor rules updated.");return}e.message("Cursor rules not found, creating..."),await S.create(),e.stop("Cursor rules created.")},ms=async()=>{let e=d();if(e.start("Checking for Windsurf rules..."),await F.exists()){e.message("Windsurf rules found, updating..."),await F.update(),e.stop("Windsurf rules updated.");return}e.message("Windsurf rules not found, creating..."),await F.create(),e.stop("Windsurf rules created.")},fs=async()=>{let e=d();if(e.start("Checking for Zed rules..."),await R.exists()){e.message("Zed rules found, updating..."),await R.update(),e.stop("Zed rules updated.");return}e.message("Zed rules not found, creating..."),await R.create(),e.stop("Zed rules created.")},gs=async()=>{let e=d();if(e.start("Checking for Claude Code rules..."),await C.exists()){e.message("Claude Code rules found, updating..."),await C.update(),e.stop("Claude Code rules updated.");return}e.message("Claude Code rules not found, creating..."),await C.create(),e.stop("Claude Code rules created.")},hs=async()=>{let e=d();if(e.start("Checking for OpenAI Codex rules..."),await j.exists()){e.message("OpenAI Codex rules found, updating..."),await j.update(),e.stop("OpenAI Codex rules updated.");return}e.message("OpenAI Codex rules not found, creating..."),await j.create(),e.stop("OpenAI Codex rules created.")},De=async()=>{ns(ie);try{let e=await T.get();if(e?ke.info(`Detected lockfile, using ${e}`):e=await T.select(),!e||typeof e!="string")throw new Error("No package manager selected");let t=await ut({message:"Which editor rules do you want to enable (optional)?",options:[{label:"GitHub Copilot (VSCode)",value:"vscode-copilot"},{label:"Cursor",value:"cursor"},{label:"Windsurf",value:"windsurf"},{label:"Zed",value:"zed"},{label:"Claude Code",value:"claude"},{label:"OpenAI Codex",value:"codex"}],required:!1}),s=await ut({message:"Would you like any of the following (optional)?",options:[{label:"Husky pre-commit hook",value:"precommit-hooks"},{label:"Lefthook pre-commit hook",value:"lefthook"},{label:"Lint-staged",value:"lint-staged"}],required:!1});os(e),await as(),await is(),await rs(),Array.isArray(t)&&(t.includes("vscode-copilot")&&await ds(),t.includes("cursor")&&await ps(),t.includes("windsurf")&&await ms(),t.includes("zed")&&await fs(),t.includes("claude")&&await gs(),t.includes("codex")&&await hs()),Array.isArray(s)&&(s.includes("precommit-hooks")&&await cs(e),s.includes("lefthook")&&await ls(e),s.includes("lint-staged")&&await us(e)),ke.success("Successfully initialized Ultracite configuration!")}catch(e){let t=e instanceof Error?e.message:"Unknown error";ke.error(`Failed to initialize Ultracite configuration: ${t}`),ss.exit(1)}}});var Et={};import{Command as ys}from"commander";var P,ct=i(()=>{B();we();oe();P=new ys;P.name("Ultracite").description("Ship code faster and with more confidence.");P.command("init").description("Initialize Ultracite in the current directory").action(De);P.command("lint").description("Run Biome linter without fixing files").argument("[files...]","specific files to lint (optional)").action(ne);P.command("format").description("Run Biome linter and fixes files").argument("[files...]","specific files to format (optional)").option("--unsafe","apply unsafe fixes").action(G);P.parse()});ct();
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": "5.0.22",
4
+ "version": "5.0.24",
5
5
  "bin": {
6
6
  "ultracite": "dist/index.js"
7
7
  },