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

ultracite@8.3.2

Patch Changes

  • 07d61dc: On Biome, ultracite fix no longer adds the u flag to regexes. useUnicodeRegex is still on and still reports, but its fix is now marked unsafe in the Biome preset, so only ultracite fix --unsafe applies it.

    The u flag changes what a regex matches. With it, /k/i also matches the Kelvin sign (U+212A), /^\w+$/i also matches the long s (U+017F), and . or a negated class takes a whole emoji instead of half of one. The fix added the flag to every regex that still parsed with it and left nothing to review. Oxlint has no fix for the same rule and ESLint only offers a suggestion, so the three presets now agree.

    In a Biome project, a regex without the flag now stays reported as an error until someone adds it, where fix used to add it silently. Before adding it, check a regex that uses i, ., \w, \b or a negated class, and suppress the rule where the regex has to stay as it is.

  • 1c27fdf: Update Biome to 2.6.9. The release adds 28 nursery rules, which the Biome presets leave off, and promotes, renames or removes none, so the presets are unchanged and the @biomejs/biome peer range stays at ^2.6.7.

    Biome 2.6.9 fixes a false syntax error we reported. An import that mixes an inline type specifier with a value and carries import attributes, such as import { type A, b } from "./m" with { … }, is no longer reported as a type-only import (biomejs/biome#13304). An import whose specifiers are all inline type is still reported, though TypeScript accepts it.

    Several rules the presets already turn on change after upgrading. noDescendingSpecificity no longer reports nested selectors that style different elements, and now reports a:hover { … } followed by a { … }, as Stylelint does. noDuplicateSelectors finds duplicates it missed, such as a repeated attribute selector with a quoted value. The test rules noIdenticalTestTitle, useTestHooksOnTop and useTestHooksInOrder now check the tests inside describe.todo, describe.skipIf(…) and Playwright’s test.describe.serial blocks. useFilenamingConvention reports once per HTML, Vue, Svelte or Astro file instead of once per embedded script, and in Astro files useImportType, noUndeclaredVariables and noUnusedVariables follow what the template uses.

    The HTML formatter now collapses whitespace in a static class attribute, formats a valid style attribute as CSS declarations, and no longer adds a line break, which rendered as a space, between elements that touch in the source. See the 2.6.9 release notes.

  • c4a76b5: Update oxfmt to 0.80.0. The release changes no options, so the preset is unchanged and the oxfmt peer range stays at >=0.71.0 <1.

    It is mostly bug fixes. oxfmt no longer hangs when it runs with a single worker thread, an assigned class breaks a long extends or implements clause the way any other class does, and CSS, HTML and Markdown each get formatting fixes. If you set your own sortImports.groups and wrap groups in an array, the order inside the array now breaks ties between imports from the same source; the preset sets no groups, so its import order is the same. See the 0.80.0 release notes.

  • 517d36e: Update Oxlint to 1.95.0 and oxlint-tsgolint to 7.0.2008, and enable Oxlint’s new type-aware rule, typescript/no-unsafe-class-instance-assignment, in the core Oxlint preset.

    The rule reports a value used where an instance of a class is expected when it wasn’t created by that class’s constructor, such as const user: User = { name: "a" }. It matches the @typescript-eslint rule of the same name that the ESLint type-aware preset already enables. Like the other type-aware rules, it only runs with oxlint --type-aware and oxlint-tsgolint installed, and Oxlint 1.95.0 needs oxlint-tsgolint 7.0.2008 or later.

    Oxlint 1.95.0 also repairs two fixes we reported, both applied by ultracite fix --unsafe. unicorn/prefer-logical-operator-over-ternary keeps the parentheses a nested ternary or an arrow function needs, where it used to write x || y ? a : b (oxc-project/oxc#29877). no-unneeded-ternary leaves f() ? true : true alone instead of deleting the call (oxc-project/oxc#29878), and turns a + b ? true : false into !!(a + b), not a + b.

    The rewrites for no-unsafe-negation, jest/prefer-to-contain and vitest/prefer-to-contain are now suggestions, so plain ultracite fix reports them and --unsafe applies them.

    Requires oxlint >= 1.95.0

  • 972f6c9: 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 when not to hoist a regex. The line was “Use top-level regex literals instead of creating them in loops”, with no exception. A regex with the g or y flag keeps its position between calls, so moving one to the top level and sharing it changes what test and exec return, and no lint rule reports that. The line now leaves those regexes out, as Biome’s useTopLevelRegex already does.

  • de8593e: sonarjs/comment-regex is now off in the ESLint preset and the Oxlint JS plugins preset. The rule reports comments that match a regularExpression option and does nothing without one, so it was listed as on and never reported. Nothing changes in what gets reported. To use the rule, turn it on in your own config with a pattern.

  • 86f7964: sonarjs/no-empty-test-file no longer reports every source file with eslint-plugin-sonarjs 4.2.3 or later (#885). That release removed the rule’s own check for test files and leaves picking them to SonarQube, which the standalone plugin doesn’t have. The ESLint preset and the Oxlint JS plugins preset now turn the rule off everywhere and back on for files named *.test.*, *.spec.* and *.cy.*, the files the plugin checked before. Helpers and fixtures under __tests__ and type-test files (*.test-d.ts) are still not reported.

  • de8593e: Three SonarJS regex rules are now off in the ESLint preset and the Oxlint JS plugins preset.

    • sonarjs/no-regex-spaces threw “Expected regexp or string literal” on a pattern with two spaces that isn’t written in the RegExp call itself, such as const pattern = "a b" followed by new RegExp(pattern), or a concatenation. On ESLint that stopped the whole run. On Oxlint the file lost every report from the JS plugins. The core no-regex-spaces rule still reports repeated spaces in regex literals and string arguments.
    • sonarjs/concise-regex said to replace [\w\W] and [\d\D] with .. Those classes match any character, line breaks included, and . doesn’t without the s flag, so following the message changed what the regex matched. Its other advice, such as \d for [0-9] and + for {1,}, was style only and goes with it.
    • sonarjs/no-invalid-regexp reported each invalid RegExp call a second time, next to the core no-invalid-regexp, which reports everything it does and an invalid pair of flags as well.

    The other SonarJS rules that overlap a core regex rule (sonarjs/no-control-regex, sonarjs/no-empty-character-class and sonarjs/no-misleading-character-class) stay on. They also check a pattern held in a constant, which a core rule misses in ESLint, Oxlint or both.

Last updated on

Was this page helpful?