# biome style/useTrimStartEnd: 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/useTrimStartEnd (tool labels the fix: safe, this fix reported as safe)
- Oracle: fix-changes-behavior
- Judge (Nemotron 3 Ultra, advisory): introspection-only, severity low. The program throws a TypeError because `s` is null, and the error message includes the method name that was called. The fix changes `trimLeft` to its alias `trimStart`, so the only difference is the method name quoted in the error message, which is source-text introspection.
- Program: minimized from 6 to 6 lines

## Reproducer

```js
let s = null;
try {
  console.log(s.trimLeft());
} catch (e) {
  console.log(e.name + ': ' + e.message);
}
```

## Commands

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

## Observed

```
stdout before:
TypeError: Cannot read properties of null (reading 'trimLeft')
stdout after:
TypeError: Cannot read properties of null (reading 'trimStart')
```

## Diff applied by the fix

```diff
--- orig.js	2026-10-22 13:36:16.114864845 -0400
+++ fixed.js	2026-10-22 13:36:18.670908010 -0400
@@ -1,6 +1,6 @@
 let s = null;
 try {
-  console.log(s.trimLeft());
+  console.log(s.trimStart());
 } catch (e) {
   console.log(e.name + ': ' + e.message);
 }
```

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

The original call `s.trimLeft()` attempts to access property `trimLeft` on `null`, causing a TypeError with message mentioning `trimLeft`. After rewriting to `s.trimStart()`, the same error occurs but now references `trimStart` in the message string (`Cannot read properties of null (reading 'trimStart')`). Although both throw identical exception types, the error message differs because it includes the accessed property name. Since observable output (the printed message) changes, the transformation alters program behavior and is not semantics‑preserving.

## Upstream search

Queries: "useTrimStartEnd fix", "style/useTrimStartEnd trimLeft method call", "biome lint rule trimStart replacement", "null object method invocation error"

- no duplicate or related report found among 18 hits

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

- [github, open] 💅 `lint/correctness/noUnusedImports` does not consider uses inside comments that precede non-declaration statements (start/end of file, etc.) — https://github.com/biomejs/biome/issues/8762
- [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] 💅 Corrupted CLI safe fix for `useConsistentArrowReturn` — https://github.com/biomejs/biome/issues/8347
- [github, closed] 💅 `useExplicitLengthCheck` false positive — https://github.com/biomejs/biome/issues/11352
- [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] 💅 New rule for `noDeprecatedImports` not working with declarations — https://github.com/biomejs/biome/issues/7635
- [tavily] 💅 `useDestructuring` doesn't work with type annotations · Issue #8478 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/8478
- [tavily] 💅 `lint/correctness/useSingleJsDocAsterisk` false positive when attempting to start with italics · Issue #7603 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/7603
- [tavily] 💅 noParametersOnlyUsedInRecursion false positives · Issue #8004 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/8004
- [tavily] 💅 Incorrectly suggest to discard redundant terms (useSimplifiedLogicExpression) · Issue #8577 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/8577
- [tavily] 💅 `nusery/noShadow` should not flag parameter names of function types · Issue #9482 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/9482
- [tavily] 🐛 Regression: VS Code extension crashes with `@biomejs/biome@2.3.10` server · Issue #8635 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/8635
- [tavily] 🐛 Unable to migrate ESLint configuration that extends @antfu/eslint-config · Issue #4802 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/4802
- [tavily] 💅 `noThisInStatic` safe fix is not safe · Issue #10011 · biomejs/biome · GitHub — https://github.com/biomejs/biome/issues/10011

</details>
