Skip to content
Ultracite
Esc
↑↓navigate↵open⌘Jpreview
On this page

ultracite@8.3.1

Patch Changes

  • 6a8d57f: The prompt ultracite fix --claude and ultracite fix --codex give 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 require or import() 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 init writes (AGENTS.md, CLAUDE.md and 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 if body, 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 init again.

  • af73526: ultracite init now sets "javascript": { "jsxRuntime": "reactClassic" } in the Biome config of a project whose tsconfig.json or jsconfig.json compiles JSX with the classic runtime ("jsx": "react", set there or inherited through extends). Biome otherwise treats import React from "react" as unused in a file that only uses JSX, and since the core preset marks the noUnusedImports fix safe, ultracite fix deleted an import that JSX needs (and useImportType turned it into import type React where React was also used as a type). An existing config gets the setting added beside its other javascript settings, and a jsxRuntime you’ve set yourself is left alone. ultracite doctor warns about a Biome config that is missing it, and ultracite upgrade adds it.

  • 4ce8f28: The Biome core preset now sets useImportType to the separatedType style, so ultracite fix writes a mixed import as import type { A } from "x" plus import { b } from "x". Biome’s default wrote import { type A, b }, the inline form that consistent-type-specifier-style reports 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 next ultracite 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. useWhile reports for (;;) and fixes it to while (true). noUselessStringConcat reports literals joined after another value, such as foo + "a" + "b". noUnreachableSuper reports this in a constructor parameter’s default value. noVueDuplicateKeys checks what setup() returns, and noUnresolvedImports, which biome/type-aware turns on, reports a default import from a module that only has export *. The type-aware rules now narrow a variable after a typeof, equality, nullish or truthiness check and evaluate conditional types, so they report less on code that was already correct.

    The useSortedProperties assist 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 for noDistractingElements removes 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 fix formats .md files and ultracite check reports 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 your biome.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-unicorn to 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-parentheses asks for {...(enabled && overrides)} instead of {...enabled && overrides}. Prettier and Oxfmt already print the parentheses, so formatted code doesn’t change.
    • unicorn/prefer-regexp-exec reports text.match(/uni(corn)/) on a string it can recognise without type information and fixes it to /uni(corn)/.exec(text). A regex with the g flag is left alone.
    • unicorn/prefer-options-parameter reports optional positional parameters that could be properties of an options object, as in run(input, verbose = false, options = {}). Its checkWithoutOptionsObject option 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-finally out of its recommended config. The preset turns on every Unicorn rule, so it stays on. prefer-ternary’s new checkNestedTernaries option stays off, because it asks for the nested ternary that no-nested-ternary reports.

    Rules that were already on report more: no-useless-coercion reports a redundant !!, no-unnecessary-default-arguments checks generic functions, prefer-json-import reports JSON loaded through createRequire() and fixes it, prefer-simplified-conditions factors comparisons with any operator, and no-async-iterator-callback and no-async-promise-finally follow a callback held in a let or var that is never reassigned. Others report less: no-useless-undefined ignores return undefined in a getter, prefer-module ignores .cts files and prefer-math-min-max only reports comparisons of known numbers in TypeScript. See the release notes.

  • 9e44f45: Update the ESLint packages init installs: typescript-eslint 8.73, eslint-plugin-import-x 4.18.1, eslint-plugin-solid 0.20, @angular-eslint/eslint-plugin, @angular-eslint/eslint-plugin-template and @angular-eslint/template-parser 22.8, eslint-plugin-svelte 3.24.1, eslint-plugin-vue 10.12.1, eslint-plugin-jsdoc 65.4.12, eslint-plugin-storybook 10.6.7, @tanstack/eslint-plugin-query 5.108, @next/eslint-plugin-next 16.4.6, eslint-plugin-cypress 7.0.5, eslint-plugin-jest 29.17.1, eslint-plugin-playwright 2.12.2, eslint-plugin-qwik 1.20.4 and @darraghor/eslint-plugin-nestjs-typed 7.5.10. The presets were checked against ESLint 10.15, and the eslint peer range stays at ^10.9.0.

    New rules the presets turn on:

    • ultracite/eslint/type-aware: @typescript-eslint/no-unsafe-class-instance-assignment reports an object literal, or another value no constructor made, used where an instance of a class is expected, such as const point: Point = { x: 1, y: 2 }.
    • Angular: @angular-eslint/no-global-document reports the global document in a component, directive, service or pipe, where server-side rendering has none. In templates, no-multi-token-class-key reports a [class] object key with a space in it, which Angular drops, and prefer-let-for-async-pipe reports the same async pipe expression used twice in one view. prefer-style-binding also gets its new bindUnits option, so [style.height]="`${height()}em`" is reported in favour of [style.height.em]="height()".
    • Solid: solid/validate-jsx-nesting reports JSX the HTML parser restructures, such as <p><div /></p>. solid/action-yield-after-await asks for a bare yield after each await in a generator passed to Solid 2.0’s action(). solid/no-unassigned-vars is the core no-unassigned-vars with ref={el} counted as an assignment; the Solid preset now turns the core rule off in .jsx and .tsx files, where it reported every let el; <div ref={el} />.

    eslint-plugin-import-x 4.18 adds four rules about barrel files, and the preset leaves all of them off to keep the decisions it already has: avoid-barrel-files and avoid-re-export-all report what a package’s entry point has to do, avoid-namespace-import reports the import * as that no-namespace allows, and avoid-importing-barrel-files is a different check from the one the Oxlint preset runs.

    solid/removed-api is now off in the Solid preset. It reports the APIs Solid 2.0 removed (onMount, batch, mergeProps, imports from solid-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’s no-unassigned-vars off in .jsx and .tsx files as well, since Oxlint has no Solid rule to replace it.

    Some rules that were already on behave differently. solid/reactivity again reports a stale capture in a handler declared as a statement. eslint-plugin-import-x rewrote its module analysis: no-cycle now reports cycles through side-effect imports, and many no-duplicates, extensions and order fixes were corrected. ESLint 10.15 makes func-names and accessor-pairs check a few more forms.

  • ce98db5: Update oxfmt to 0.79.0. The release changes no options, and the oxfmt peer range stays at >=0.71.0 <1, but ultracite fix can reformat files it used to leave alone after upgrading:

    • .html files (0.76.0) and .vue files (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, .astro and .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 ?? []).b does.
    • 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 .astro files, which is now formatted as TSX. ultracite init now installs @astrojs/compiler-rs 0.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-tsgolint to 7.0.2007, and turn unicorn/prefer-export-from back on in the Oxlint core preset.

    The rule was off because its fix, applied by ultracite fix --unsafe, dropped an export when one export { 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 --fix no longer adds an empty dependency array to a useMemo or useCallback that has none, func-style reports a function that shares its name with a type, and jsx-a11y/lang no longer repeats html-has-lang’s report on a missing lang. The JSX accessibility rules that look at event handlers now match lowercase onclick, as Solid allows; Solid’s on:click and Qwik’s onClick$ are still not seen.

    Several fixes that plain ultracite fix used to apply are now suggestions, which run only with --unsafe, among them no-useless-escape, no-useless-undefined, prefer-ts-expect-error and no-import-type-side-effects.

    Requires oxlint >= 1.94.0

  • b71c0a6: Update postcss-less, the syntax the Stylelint preset reads .less files 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, which init installs 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, so ultracite fix can reformat .svelte files after upgrading. It also keeps an empty {:catch} block, respects singleQuote in <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 prettier peer range stays at ^3.5.3.

  • dd312af: Update eslint-plugin-react-doctor and oxlint-plugin-react-doctor to 0.9.23. The release adds, removes and renames no rule, so the React Doctor lists in the ESLint React preset and in ultracite/oxlint/js-plugins are unchanged. It fixes false positives, among them a type="Submit" button, a listener whose cleanup releases a renamed handle, useFocusEffect callbacks whose cleanup the hook owns, and TanStack Table v9 useTable options under the React Compiler. no-reset-all-state-on-prop-change no longer crashes on a BigInt literal. One check reports more: a timer that an async function started by useEffect creates after an await is reported when nothing checks that the effect is still live. See the release notes.

  • 36b79d7: Update @shadcn/lint, the plugin behind ultracite/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 a cva or tv result defined in the same file is followed instead of reported as dynamic, a plain element that is the render target of a component that adds no classes is left alone, data-* and aria-* attributes are no longer read as class lists, and p-4 stays a spacing when the theme resets --spacing-*. It also reads @import "tailwindcss" the way Tailwind does, reads tsconfig paths from a root tsconfig.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 landmines Oxlint preset now allows // SAFETY: comments, so it can be extended together with anti-slop. anti-slop/require-safety-comment-for-type-assertion requires that comment on every type assertion and landmines-style/no-comments used to report it, which left no way for an assertion to pass both presets. @interfere/landmines 0.1.1 added an allow option 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 upgrade installs it, and ultracite doctor reports an older version.

    The same release widens four testing rules, so a project on the preset may see new errors after upgrading: no-fixed-sleep now reports timer callbacks with a block body and sleeps inside act, waitFor and promise callbacks, no-flake-masking reports testTimeout and hookTimeout in a Vitest config, and no-unsignaled-poll reports expect.poll chains that end in a spy matcher. strict-msw accepts 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-imports no longer reports import() 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 to import type.

    On ESLint, ultracite fix now writes a leaked && in JSX as {!!count && <List />} instead of {count ? <List /> : null}. react/jsx-no-leaked-render is set to prefer the coercion, because its ternary fix turned {count && (a ? <b /> : <i />)} into a nested ternary, which no-nested-ternary then reported with no fix.

    Three rules that reported a problem another rule already reports are off, so each problem is reported once:

    • no-negated-condition is off in the Oxlint and ESLint presets. unicorn/no-negated-condition reports the same conditions at the same position and has a fix.
    • sonarjs/no-nested-conditional is off in the ESLint preset and the Oxlint JS plugins preset. no-nested-ternary reports the same nesting. The SonarJS rule also reported a ternary nested through a template literal or a call argument, as in a ? `x${b ? 1 : 2}` : "z", and nothing reports that now.
    • unicorn/no-useless-else is off in the ESLint preset. no-else-return reports the same else, and the Unicorn rule’s fix flattened an else if chain into separate guards, which the Oxlint preset keeps. Its reports on an else after throw, break or continue go with it, since no-else-return only looks at return.
  • af73526: ultracite fix now 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, so fix failed 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 what fix prints and its exit code now describe the files as it left them, with positions from the formatted file. The same goes for fix --hook, which no longer hands the agent a problem that’s already gone, and the autofix pass of fix --claude and fix --codex runs 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 init now installs stylelint 18, stylelint-config-standard 41 and stylelint-order 8, and no longer installs stylelint-config-idiomatic-order. stylelint-config-standard 41 only supports Stylelint 18, so the stylelint peer range moves from ^17.0.0 to ^18.0.0. Run ultracite upgrade to move a project across: it installs the three packages at these versions, and until then ultracite doctor reports Stylelint 17 as too old and Stylelint can stop with Could not find "stylelint-order". upgrade leaves stylelint-config-idiomatic-order in your package.json. Nothing loads it any more, so you can remove it.

    The property order is unchanged. stylelint-config-idiomatic-order has had no release since 2023 and depends on a stylelint-order whose fix Stylelint 18 no longer runs, so the preset now holds the same list of 64 properties itself and loads stylelint-order directly, with the same order/properties-order options: positioning, then display and the box model, then every other property alphabetically. ultracite fix gives the same output on CSS, SCSS and Less as it did on Stylelint 17, apart from three things stylelint-order 8 does differently:

    • A file with a stylelint-disable comment 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-style before border-block-start-style, border-inline-width before border-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-standard 41:

    • value-no-invalid is 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 as calc(1px + 2). declaration-property-value-no-unknown reported 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() and theme().
    • at-charset-rule-no-invalid is new and on. It reports an @charset that isn’t at the very start of the file or doesn’t put its encoding in double quotes.
    • declaration-property-value-no-unknown now follows var(). With --accent: red declared in the file, top: var(--accent) is reported, because red isn’t a value top takes. Expect new errors where a custom property is used for a property its value doesn’t fit. Stylelint 18’s referenceFiles option tells it about custom properties declared in other files.
    • declaration-block-single-line-max-declarations is gone. Stylelint 18 removed the rule, and Prettier already puts each declaration on its own line.
    • function-no-unknown no longer reports an unknown function with a vendor prefix, such as -webkit-unknown(). In CSS, declaration-property-value-no-unknown still 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, passes propertiesSyntax or typesSyntax to declaration-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

Last updated on

Was this page helpful?