ultracite@8.3.2
Patch Changes
-
07d61dc: On Biome,
ultracite fixno longer adds theuflag to regexes.useUnicodeRegexis still on and still reports, but its fix is now marked unsafe in the Biome preset, so onlyultracite fix --unsafeapplies it.The
uflag changes what a regex matches. With it,/k/ialso matches the Kelvin sign (U+212A),/^\w+$/ialso 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
fixused to add it silently. Before adding it, check a regex that usesi,.,\w,\bor 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/biomepeer range stays at^2.6.7.Biome 2.6.9 fixes a false syntax error we reported. An import that mixes an inline
typespecifier with a value and carries import attributes, such asimport { type A, b } from "./m" with { … }, is no longer reported as a type-only import (biomejs/biome#13304). An import whose specifiers are all inlinetypeis still reported, though TypeScript accepts it.Several rules the presets already turn on change after upgrading.
noDescendingSpecificityno longer reports nested selectors that style different elements, and now reportsa:hover { … }followed bya { … }, as Stylelint does.noDuplicateSelectorsfinds duplicates it missed, such as a repeated attribute selector with a quoted value. The test rulesnoIdenticalTestTitle,useTestHooksOnTopanduseTestHooksInOrdernow check the tests insidedescribe.todo,describe.skipIf(…)and Playwright’stest.describe.serialblocks.useFilenamingConventionreports once per HTML, Vue, Svelte or Astro file instead of once per embedded script, and in Astro filesuseImportType,noUndeclaredVariablesandnoUnusedVariablesfollow what the template uses.The HTML formatter now collapses whitespace in a static
classattribute, formats a validstyleattribute 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
oxfmtpeer 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
extendsorimplementsclause the way any other class does, and CSS, HTML and Markdown each get formatting fixes. If you set your ownsortImports.groupsand 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-tsgolintto 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-eslintrule of the same name that the ESLint type-aware preset already enables. Like the other type-aware rules, it only runs withoxlint --type-awareandoxlint-tsgolintinstalled, and Oxlint 1.95.0 needsoxlint-tsgolint7.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-ternarykeeps the parentheses a nested ternary or an arrow function needs, where it used to writex || y ? a : b(oxc-project/oxc#29877).no-unneeded-ternaryleavesf() ? true : truealone instead of deleting the call (oxc-project/oxc#29878), and turnsa + b ? true : falseinto!!(a + b), nota + b.The rewrites for
no-unsafe-negation,jest/prefer-to-containandvitest/prefer-to-containare now suggestions, so plainultracite fixreports them and--unsafeapplies them.Requires oxlint >= 1.95.0
-
972f6c9: The agent rules that
ultracite initwrites (AGENTS.md,CLAUDE.mdand 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 thegoryflag keeps its position between calls, so moving one to the top level and sharing it changes whattestandexecreturn, and no lint rule reports that. The line now leaves those regexes out, as Biome’suseTopLevelRegexalready does. -
de8593e:
sonarjs/comment-regexis now off in the ESLint preset and the Oxlint JS plugins preset. The rule reports comments that match aregularExpressionoption 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-fileno longer reports every source file witheslint-plugin-sonarjs4.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-spacesthrew “Expected regexp or string literal” on a pattern with two spaces that isn’t written in theRegExpcall itself, such asconst pattern = "a b"followed bynew RegExp(pattern), or a concatenation. On ESLint that stopped the whole run. On Oxlint the file lost every report from the JS plugins. The coreno-regex-spacesrule still reports repeated spaces in regex literals and string arguments.sonarjs/concise-regexsaid to replace[\w\W]and[\d\D]with.. Those classes match any character, line breaks included, and.doesn’t without thesflag, so following the message changed what the regex matched. Its other advice, such as\dfor[0-9]and+for{1,}, was style only and goes with it.sonarjs/no-invalid-regexpreported each invalidRegExpcall a second time, next to the coreno-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-classandsonarjs/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.