# biome style/useNodeAssertStrict: fix changes program behavior

Internal evidence sheet generated by fixhunt. Not an issue text. A human re-verifies, checks the duplicates
below, and writes the upstream report in their own words following the project's AI policy.

- Tool: biome 2.5.15
- Rule: style/useNodeAssertStrict (tool labels the fix: safe, this fix reported as safe)
- Oracle: fix-changes-behavior
- Judge (Nemotron 3 Ultra, advisory): intended-change, severity low. The rule intentionally changes the import from `node:assert` to `node:assert/strict` to enable stricter assertions. The observed difference in error messages (loose equality vs strict equality) is exactly the semantic change the rule documents, demonstrating that the stricter assertion behavior is now active.
- Program: minimized from 8 to 6 lines

## Reproducer

```js
const obj = {};
Object.defineProperty(obj, 'prop', {
  set(v) { assert.equal(v, 42); }
});
obj.prop = 99;
import * as assert from "node:assert";
```

## Commands

```sh
node prog.js
bunx @biomejs/biome lint --only=style/useNodeAssertStrict --write prog.js
node prog.js
```

## Observed

```
stderr before: AssertionError [ERR_ASSERTION]: 99 == 42
stderr after: AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
```

## Diff applied by the fix

```diff
--- orig.js	2026-10-22 13:35:18.864898538 -0400
+++ fixed.js	2026-10-22 13:35:20.835931790 -0400
@@ -3,4 +3,4 @@
   set(v) { assert.equal(v, 42); }
 });
 obj.prop = 99;
-import * as assert from "node:assert";
+import * as assert from "node:assert/strict";
```

## Why the rewrite is not equivalent (model draft, verify before use)

The original import uses `node:assert`, which provides loose equality checks (`==`) in methods like `equal`. The rewritten import uses `node:assert/strict`, which enforces strict equality (`===`). Since `99` (number) and `42` (number) are not strictly equal—though they are loosely equal only if type-coerced, which they aren’t here—the assertion fails with a different error message and failure mode. The change alters the semantics of the assertion, making it stricter, so the program’s behavior differs despite both throwing. This is not semantics-preserving because the condition for failure and the error details changed.

## Upstream search

Queries: "useNodeAssertStrict fix", "style/useNodeAssertStrict setter assertion", "style/useNodeAssertStrict Object.defineProperty set", "style/useNodeAssertStrict import node:assert"

- related: https://github.com/biomejs/biome/issues/11455
  Same rule area (node:assert imports) but different rule (noConditionalExpect) and different defect (import allowlist vs strict mode rewrite)

<details><summary>All hits</summary>

- [github, open] Extension chokes on large files — https://github.com/biomejs/biome/issues/3860
- [github, closed] 💅 `useSimplifiedLogicExpression` "safe" fix breaks code — https://github.com/biomejs/biome/issues/11351
- [github, closed] 💅 `useExplicitLengthCheck` false positive and broken fix — https://github.com/biomejs/biome/issues/11558
- [github, closed] 💅 `useExplicitLengthCheck` false positive — https://github.com/biomejs/biome/issues/11352
- [github, closed] 💅 Corrupted CLI safe fix for `useConsistentArrowReturn` — https://github.com/biomejs/biome/issues/8347
- [github, closed] 💅 lint/nursery/noUselessUndefined fix is unsafe for functions with union return types — https://github.com/biomejs/biome/issues/6906
- [github, closed] 💅 `noLeakedRender` false positives — https://github.com/biomejs/biome/issues/10514
- [github, closed] 💅 `useFilenamingConvention` override not applying to TanStack Start splat route files ($.ts, rpc.$.ts) — https://github.com/biomejs/biome/issues/9082
- [github, closed] 💅 false positive of `noUnresolvedImports` with `io-ts/Decoder` — https://github.com/biomejs/biome/issues/11013
- [github, closed] 💅 `noUselessUndefined` conflicts with `ts(7030)` — https://github.com/biomejs/biome/issues/11017
- [tavily] noConditionalExpect: reports a non-test `assert` function (matches callee by name, ignores the import) · Issue #11455 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/11455
- [tavily] 💅 noParametersOnlyUsedInRecursion false positives · Issue #8004 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/8004
- [tavily] 💅 `useJsxKeyInIterable` shows warning even key is specified · Issue #3020 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/3020
- [tavily] 💅 `useDestructuring` doesn't work with type annotations · Issue #8478 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/8478
- [tavily] 💅 false positive with `noUndeclaredVariables` in `*.d.ts` files · Issue #4526 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/4526
- [tavily] 💅 Incorrectly suggest to discard redundant terms (useSimplifiedLogicExpression) · Issue #8577 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/8577
- [tavily] 📝 Biome does not respect license headers when sorting imports · Issue #4210 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/4210
- [tavily] 🐛 OOM when using certain rules after 2.1.x · Issue #7179 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/7179
- [tavily] 💅 noUnsafeOptionalChaining misses optional chain used as constructor target through TypeScript `as` assertion · Issue #10698 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/10698
- [tavily] 📎 Add ability to configure (dis)allowed assertion function name patterns for `lint/nursery/useExpect` · Issue #9218 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/9218
- [tavily] 💅 Assertion Failed in Text Range Calculation · Issue #7932 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/7932
- [tavily] 💅 useNamingConvention is a bit too aggressive · Issue #7575 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/7575

</details>
