ultracite@8.3.1
Patch Changes
-
6a8d57f: The prompt
ultracite fix --claudeandultracite fix --codexgive the agent has two changes.It now separates rewriting code from disguising it. Writing the code in the form a rule asks for is the fix: a nested ternary as early returns, a declaration as an arrow function. Disguising code so the rule stops matching, by rewording a comment, re-spelling a name or splitting a string, is not, and the agent leaves the issue for review when that is the only way to clear it. The earlier wording listed “an equivalent construct” among the things that aren’t a fix, which read as ruling out the rewrite the rule wanted.
It also tells the agent not to turn a conditional or lazy load, a
requireorimport()inside a branch or a function, into a static import at the top of the file, even when a rule’s message asks for one. The agent leaves that issue for review and says why. -
6a8d57f: The agent rules that
ultracite initwrites (AGENTS.md,CLAUDE.mdand the editor rules files), and the code standards in the bundled skill, now say what the presets enforce about conditionals:- “Prefer simple conditionals over nested ternary operators” is now “Use a single ternary for a choice between two values. For three or more outcomes, use early returns or a lookup; never nest ternaries”.
- “Use early returns to reduce nesting” now adds “and put braces around every
ifbody, including a one-line guard”. - The React and JSX section has a new line: “In JSX, work out a multi-way condition in a variable or helper above the
return, not in a chain of ternaries”.
Existing projects get the new wording by running
ultracite initagain. -
af73526:
ultracite initnow sets"javascript": { "jsxRuntime": "reactClassic" }in the Biome config of a project whosetsconfig.jsonorjsconfig.jsoncompiles JSX with the classic runtime ("jsx": "react", set there or inherited throughextends). Biome otherwise treatsimport React from "react"as unused in a file that only uses JSX, and since the core preset marks thenoUnusedImportsfix safe,ultracite fixdeleted an import that JSX needs (anduseImportTypeturned it intoimport type Reactwhere React was also used as a type). An existing config gets the setting added beside its otherjavascriptsettings, and ajsxRuntimeyou’ve set yourself is left alone.ultracite doctorwarns about a Biome config that is missing it, andultracite upgradeadds it. -
4ce8f28: The Biome core preset now sets
useImportTypeto theseparatedTypestyle, soultracite fixwrites a mixed import asimport type { A } from "x"plusimport { b } from "x". Biome’s default wroteimport { type A, b }, the inline form thatconsistent-type-specifier-stylereports in the Oxlint and ESLint presets, so the three linters disagreed about the same line. Expect existing inline type specifiers to be reported and rewritten on the nextultracite fix. -
372a182: Update Biome to 2.6.8. Biome 2.6.5 to 2.6.8 add 146 nursery rules, which the Biome presets leave off, and promote, rename or remove none, so the lint rules in the presets are unchanged.
Several rules the presets already turn on report more after upgrading.
useWhilereportsfor (;;)and fixes it towhile (true).noUselessStringConcatreports literals joined after another value, such asfoo + "a" + "b".noUnreachableSuperreportsthisin a constructor parameter’s default value.noVueDuplicateKeyschecks whatsetup()returns, andnoUnresolvedImports, whichbiome/type-awareturns on, reports a default import from a module that only hasexport *. The type-aware rules now narrow a variable after atypeof, equality, nullish or truthiness check and evaluate conditional types, so they report less on code that was already correct.The
useSortedPropertiesassist that core turns on now sorts each run of consecutive declarations on its own and keeps nested rules, at-rules and SCSS variable declarations where they are. The unsafe fix fornoDistractingElementsremoves the whole<marquee>element instead of only its opening tag, which left code that didn’t parse (biomejs/biome#13107). Linting is faster, by up to 61% on files without suppression comments.The Markdown formatter is now on in core, so
ultracite fixformats.mdfiles andultracite checkreports the ones that aren’t formatted. It was off only because earlier 2.6 releases changed the rendered text, rewriting a literal[ ]in prose to[], and 2.6.7 fixed the last of that. Expect a one-time reformat on upgrading: it pads tables, normalises emphasis markers and formats the code inside fences. To keep Markdown as it is, set"markdown": { "formatter": { "enabled": false } }in yourbiome.jsonc. See the release notes for 2.6.5, 2.6.6, 2.6.7 and 2.6.8.Requires @biomejs/biome >= 2.6.7
-
9e44f45: Update
eslint-plugin-unicornto 80. It needs Node.js 22.13, which is below the Node.js version Ultracite already asks for. The ESLint preset turns on its three new rules, like every other Unicorn rule:unicorn/require-spread-parenthesesasks for{...(enabled && overrides)}instead of{...enabled && overrides}. Prettier and Oxfmt already print the parentheses, so formatted code doesn’t change.unicorn/prefer-regexp-execreportstext.match(/uni(corn)/)on a string it can recognise without type information and fixes it to/uni(corn)/.exec(text). A regex with thegflag is left alone.unicorn/prefer-options-parameterreports optional positional parameters that could be properties of an options object, as inrun(input, verbose = false, options = {}). ItscheckWithoutOptionsObjectoption stays off, so a function with no options object isn’t asked to grow one. It has no fix, so expect new errors to work through by hand.
Unicorn 80 took
no-async-promise-finallyout of its recommended config. The preset turns on every Unicorn rule, so it stays on.prefer-ternary’s newcheckNestedTernariesoption stays off, because it asks for the nested ternary thatno-nested-ternaryreports.Rules that were already on report more:
no-useless-coercionreports a redundant!!,no-unnecessary-default-argumentschecks generic functions,prefer-json-importreports JSON loaded throughcreateRequire()and fixes it,prefer-simplified-conditionsfactors comparisons with any operator, andno-async-iterator-callbackandno-async-promise-finallyfollow a callback held in aletorvarthat is never reassigned. Others report less:no-useless-undefinedignoresreturn undefinedin a getter,prefer-moduleignores.ctsfiles andprefer-math-min-maxonly reports comparisons of known numbers in TypeScript. See the release notes. -
9e44f45: Update the ESLint packages
initinstalls: typescript-eslint 8.73,eslint-plugin-import-x4.18.1,eslint-plugin-solid0.20,@angular-eslint/eslint-plugin,@angular-eslint/eslint-plugin-templateand@angular-eslint/template-parser22.8,eslint-plugin-svelte3.24.1,eslint-plugin-vue10.12.1,eslint-plugin-jsdoc65.4.12,eslint-plugin-storybook10.6.7,@tanstack/eslint-plugin-query5.108,@next/eslint-plugin-next16.4.6,eslint-plugin-cypress7.0.5,eslint-plugin-jest29.17.1,eslint-plugin-playwright2.12.2,eslint-plugin-qwik1.20.4 and@darraghor/eslint-plugin-nestjs-typed7.5.10. The presets were checked against ESLint 10.15, and theeslintpeer range stays at^10.9.0.New rules the presets turn on:
ultracite/eslint/type-aware:@typescript-eslint/no-unsafe-class-instance-assignmentreports an object literal, or another value no constructor made, used where an instance of a class is expected, such asconst point: Point = { x: 1, y: 2 }.- Angular:
@angular-eslint/no-global-documentreports the globaldocumentin a component, directive, service or pipe, where server-side rendering has none. In templates,no-multi-token-class-keyreports a[class]object key with a space in it, which Angular drops, andprefer-let-for-async-pipereports the sameasyncpipe expression used twice in one view.prefer-style-bindingalso gets its newbindUnitsoption, so[style.height]="`${height()}em`"is reported in favour of[style.height.em]="height()". - Solid:
solid/validate-jsx-nestingreports JSX the HTML parser restructures, such as<p><div /></p>.solid/action-yield-after-awaitasks for a bareyieldafter eachawaitin a generator passed to Solid 2.0’saction().solid/no-unassigned-varsis the coreno-unassigned-varswithref={el}counted as an assignment; the Solid preset now turns the core rule off in.jsxand.tsxfiles, where it reported everylet el; <div ref={el} />.
eslint-plugin-import-x4.18 adds four rules about barrel files, and the preset leaves all of them off to keep the decisions it already has:avoid-barrel-filesandavoid-re-export-allreport what a package’s entry point has to do,avoid-namespace-importreports theimport * asthatno-namespaceallows, andavoid-importing-barrel-filesis a different check from the one the Oxlint preset runs.solid/removed-apiis now off in the Solid preset. It reports the APIs Solid 2.0 removed (onMount,batch,mergeProps, imports fromsolid-js/web) whichever version of Solid the project uses, so in a Solid 1.x project it reported correct code. The Oxlint Solid preset turns core’sno-unassigned-varsoff in.jsxand.tsxfiles as well, since Oxlint has no Solid rule to replace it.Some rules that were already on behave differently.
solid/reactivityagain reports a stale capture in a handler declared as a statement.eslint-plugin-import-xrewrote its module analysis:no-cyclenow reports cycles through side-effect imports, and manyno-duplicates,extensionsandorderfixes were corrected. ESLint 10.15 makesfunc-namesandaccessor-pairscheck a few more forms. -
ce98db5: Update oxfmt to 0.79.0. The release changes no options, and the
oxfmtpeer range stays at>=0.71.0 <1, butultracite fixcan reformat files it used to leave alone after upgrading:.htmlfiles (0.76.0) and.vuefiles (0.77.0) are now formatted by oxfmt’s own HTML formatter instead of the bundled Prettier, so their output can differ in places.- The files oxfmt still hands to Prettier, such as
.mdx,.astroand.svelte, are formatted by Prettier 3.10.1 instead of 3.9.10. - A parenthesised expression that is indexed, such as
(a ?? [])[1], breaks inside its parentheses the way(a ?? []).bdoes. - Tailwind class sorting now reaches calls printed as member chains and no longer sorts template literals inside calls that aren’t Tailwind functions.
It also fixes a run of formatting bugs, among them decorators dropped from rest parameters, parentheses dropped around a generic function type in a type assertion and around
<on the left of>, and TypeScript in.astrofiles, which is now formatted as TSX.ultracite initnow installs@astrojs/compiler-rs0.5.3 for Astro projects. See the release notes for 0.76.0, 0.77.0, 0.78.0 and 0.79.0. -
9013134: Update Oxlint to 1.94.0 and
oxlint-tsgolintto 7.0.2007, and turnunicorn/prefer-export-fromback on in the Oxlint core preset.The rule was off because its fix, applied by
ultracite fix --unsafe, dropped an export when oneexport { a, b }list re-exported names from two modules. Oxlint 1.94.0 no longer offers the fix in that case (oxc-project/oxc#29318), so the rule reports again and the ESLint and Oxlint presets agree.Oxlint 1.94.0 also fixes three things we reported while measuring the presets: plain
--fixno longer adds an empty dependency array to auseMemooruseCallbackthat has none,func-stylereports a function that shares its name with a type, andjsx-a11y/langno longer repeatshtml-has-lang’s report on a missinglang. The JSX accessibility rules that look at event handlers now match lowercaseonclick, as Solid allows; Solid’son:clickand Qwik’sonClick$are still not seen.Several fixes that plain
ultracite fixused to apply are now suggestions, which run only with--unsafe, among themno-useless-escape,no-useless-undefined,prefer-ts-expect-errorandno-import-type-side-effects.Requires oxlint >= 1.94.0
-
b71c0a6: Update
postcss-less, the syntax the Stylelint preset reads.lessfiles with, to 7.1.1. It parses more Less:@{var}interpolation in an at-rule’s prelude and in property names, function calls, lookup expressions, and mixins with a digit or a backslash in their name. It is ESM-only and needs Node.js 22, which Ultracite already requires. -
15722fc: Update
prettier-plugin-svelte, whichinitinstalls for Svelte projects on ESLint, to 4.2.0. It now puts an element’s content on its own lines instead of hugging>and</, because Svelte 5 removes whitespace at the start and end of an element, soultracite fixcan reformat.sveltefiles after upgrading. It also keeps an empty{:catch}block, respectssingleQuotein<svelte:element this={'tag'}>and no longer drops comments in an opening tag without attributes. See the changelog.The Prettier preset was checked against Prettier 3.10.1, which changes no option it sets. The
prettierpeer range stays at^3.5.3. -
dd312af: Update
eslint-plugin-react-doctorandoxlint-plugin-react-doctorto 0.9.23. The release adds, removes and renames no rule, so the React Doctor lists in the ESLint React preset and inultracite/oxlint/js-pluginsare unchanged. It fixes false positives, among them atype="Submit"button, a listener whose cleanup releases a renamed handle,useFocusEffectcallbacks whose cleanup the hook owns, and TanStack Table v9useTableoptions under the React Compiler.no-reset-all-state-on-prop-changeno longer crashes on a BigInt literal. One check reports more: a timer that an async function started byuseEffectcreates after anawaitis reported when nothing checks that the effect is still live. See the release notes. -
36b79d7: Update
@shadcn/lint, the plugin behindultracite/oxlint/shadcn, to 0.2.5. It has the same six rules and options, so the preset is unchanged. The release fixes false positives: a call to acvaortvresult defined in the same file is followed instead of reported as dynamic, a plain element that is therendertarget of a component that adds no classes is left alone,data-*andaria-*attributes are no longer read as class lists, andp-4stays a spacing when the theme resets--spacing-*. It also reads@import "tailwindcss"the way Tailwind does, reads tsconfigpathsfrom a roottsconfig.base.json, and no longer stalls or overflows the stack on very long class tokens, const chains and barrel chains. See the release notes for 0.2.4 and 0.2.5. -
95ca1d5: The
landminesOxlint preset now allows// SAFETY:comments, so it can be extended together withanti-slop.anti-slop/require-safety-comment-for-type-assertionrequires that comment on every type assertion andlandmines-style/no-commentsused to report it, which left no way for an assertion to pass both presets.@interfere/landmines0.1.1 added anallowoption for the comment prefixes to keep (interfere-inc/landmines#4), and the preset sets it to["WARNING", "SAFETY"]. If you turned one of the two rules off to work around the clash, you can turn it back on.Requires
@interfere/landmines>= 0.1.1.ultracite upgradeinstalls it, andultracite doctorreports an older version.The same release widens four testing rules, so a project on the preset may see new errors after upgrading:
no-fixed-sleepnow reports timer callbacks with a block body and sleeps insideact,waitForand promise callbacks,no-flake-maskingreportstestTimeoutandhookTimeoutin a Vitest config, andno-unsignaled-pollreportsexpect.pollchains that end in a spy matcher.strict-mswaccepts more valid setups than before. -
6c351c5: Three changes to what the Oxlint and ESLint presets report, each removing a report that had no good way to clear it.
consistent-type-importsno longer reportsimport()type annotations.typeof import("./module")is the only way to type a lazily or conditionally loaded module without loading it, and the report had no fix. An import that is only used as a type is still reported and still rewritten toimport type.On ESLint,
ultracite fixnow writes a leaked&&in JSX as{!!count && <List />}instead of{count ? <List /> : null}.react/jsx-no-leaked-renderis set to prefer the coercion, because its ternary fix turned{count && (a ? <b /> : <i />)}into a nested ternary, whichno-nested-ternarythen reported with no fix.Three rules that reported a problem another rule already reports are off, so each problem is reported once:
no-negated-conditionis off in the Oxlint and ESLint presets.unicorn/no-negated-conditionreports the same conditions at the same position and has a fix.sonarjs/no-nested-conditionalis off in the ESLint preset and the Oxlint JS plugins preset.no-nested-ternaryreports the same nesting. The SonarJS rule also reported a ternary nested through a template literal or a call argument, as ina ? `x${b ? 1 : 2}` : "z", and nothing reports that now.unicorn/no-useless-elseis off in the ESLint preset.no-else-returnreports the sameelse, and the Unicorn rule’s fix flattened anelse ifchain into separate guards, which the Oxlint preset keeps. Its reports on anelseafterthrow,breakorcontinuego with it, sinceno-else-returnonly looks atreturn.
-
af73526:
ultracite fixnow runs Oxlint’s fix pass a second time when the first one reports anything, and when the second still reports something it finishes with a pass that only checks, after Oxfmt, and reports what that found. Oxlint applies fixes in a single pass: some fixes only become possible after another has run (two imports of a module are merged, then split into values and types), and when one fix also settles what another rule reported, Oxlint still printed that diagnostic and exited non-zero, sofixfailed on a file it had just made clean and passed when run again.import { type Foo } from "./types"was enough to see it. A pass that changes nothing can’t report a problem it has just fixed, so whatfixprints and its exit code now describe the files as it left them, with positions from the formatted file. The same goes forfix --hook, which no longer hands the agent a problem that’s already gone, and the autofix pass offix --claudeandfix --codexruns twice in the same way before its report. A run with nothing to report costs one Oxlint pass, as before, and Oxfmt still runs after the last pass that changes files. That includes a run with-f json: a JSON report with no diagnostics is recognised as clean. -
0915670: Move the Stylelint preset to Stylelint 18.
ultracite initnow installsstylelint18,stylelint-config-standard41 andstylelint-order8, and no longer installsstylelint-config-idiomatic-order.stylelint-config-standard41 only supports Stylelint 18, so thestylelintpeer range moves from^17.0.0to^18.0.0. Runultracite upgradeto move a project across: it installs the three packages at these versions, and until thenultracite doctorreports Stylelint 17 as too old and Stylelint can stop withCould not find "stylelint-order".upgradeleavesstylelint-config-idiomatic-orderin yourpackage.json. Nothing loads it any more, so you can remove it.The property order is unchanged.
stylelint-config-idiomatic-orderhas had no release since 2023 and depends on astylelint-orderwhose fix Stylelint 18 no longer runs, so the preset now holds the same list of 64 properties itself and loadsstylelint-orderdirectly, with the sameorder/properties-orderoptions: positioning, then display and the box model, then every other property alphabetically.ultracite fixgives the same output on CSS, SCSS and Less as it did on Stylelint 17, apart from three thingsstylelint-order8 does differently:- A file with a
stylelint-disablecomment anywhere in it is now sorted. Before, its order was reported and never fixed. - A logical border shorthand now comes before its longhands, as the physical ones always did:
border-block-stylebeforeborder-block-start-style,border-inline-widthbeforeborder-inline-end-width, and so on. - A property name with capitals in it, such as
DISPLAY, is placed where its lowercase form goes.
Rule changes from Stylelint 18 and
stylelint-config-standard41:value-no-invalidis new and on for CSS. It reports a value that can’t be parsed and math that adds a number to a length or percentage, such ascalc(1px + 2).declaration-property-value-no-unknownreported these before, so CSS gets the same errors under a new rule name. It is off for SCSS and Less, whose values aren’t CSS until they’re compiled, and it accepts Tailwind’s--spacing(),--alpha()andtheme().at-charset-rule-no-invalidis new and on. It reports an@charsetthat isn’t at the very start of the file or doesn’t put its encoding in double quotes.declaration-property-value-no-unknownnow followsvar(). With--accent: reddeclared in the file,top: var(--accent)is reported, becauseredisn’t a valuetoptakes. Expect new errors where a custom property is used for a property its value doesn’t fit. Stylelint 18’sreferenceFilesoption tells it about custom properties declared in other files.declaration-block-single-line-max-declarationsis gone. Stylelint 18 removed the rule, and Prettier already puts each declaration on its own line.function-no-unknownno longer reports an unknown function with a vendor prefix, such as-webkit-unknown(). In CSS,declaration-property-value-no-unknownstill reports the value.
Stylelint 18 supports Node.js 22.22.2 and later, 24.15.0 and later, and 26. It leaves out Node.js 25, which Ultracite’s own range allows: it runs there, but your package manager warns about the engine when it installs it, and one set to enforce engines refuses. If your own Stylelint config sets
declaration-block-single-line-max-declarations, passespropertiesSyntaxortypesSyntaxtodeclaration-property-value-no-unknown, or names a plugin or config by a path with no file extension, see the migration guide.Requires stylelint >= 18.0.0
- A file with a