Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#11949·biome

`noSelfAssign` misses self-assignment across dot and bracket notation

Author: AlbinoGeekCreated Sep 24, 2026Updated Sep 29, 2026
LabelsA-LinterL-JavaScriptS-Bug-confirmed

Environment information

bash
CLI:
  Version:                      2.5.14

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_DISTRIBUTION:           npm
  JS_RUNTIME_NAME:              node

Rule name

correctness/noSelfAssign

Playground link

https://biomejs.dev/playground/?lintRules=noSelfAssign#files.noSelfAssign.js=ZQB4AHAAbwByAHQAIABmAHUAbgBjAHQAaQBvAG4AIABmACgAbwApACAAewAKACAAIABvAC4AeAAgAD0AIABvAC4AeAA7ACAALwAvACAAcgBlAHAAbwByAHQAZQBkAAoAIAAgAG8AWwAiAHgAIgBdACAAPQAgAG8AWwAiAHgAIgBdADsAIAAvAC8AIAByAGUAcABvAHIAdABlAGQACgAgACAAbwBbACIAeAAiAF0AIAA9ACAAbwAuAHgAOwAgAC8ALwAgAG4AbwB0ACAAcgBlAHAAbwByAHQAZQBkAAoAIAAgAG8AWwAwAF0AIAA9ACAAbwBbACIAMAAiAF0AOwAgAC8ALwAgAG4AbwB0ACAAcgBlAHAAbwByAHQAZQBkAAoAfQAKAA%3D%3D

javascript
export function f(o) {
  o.x = o.x; // reported
  o["x"] = o["x"]; // reported
  o["x"] = o.x; // not reported
  o[0] = o["0"]; // not reported
}

o.x = o.x and o["x"] = o["x"] are reported, but o["x"] = o.x and o[0] = o["0"] are not, although each pair names the same property. ESLint's no-self-assign reports o["x"] = o.x.

Reproduced with the 2.5.14 CLI and in the playground (f74eb38).

Expected result

Static member names are compared by property name, so dot notation, string literal and numeric literal keys that resolve to the same property are treated as equal.

Code of Conduct

  • I agree to follow Biome's Code of Conduct

Tool Use Disclaimer: Claude Code using Anthropic Opus 5.5 helped build the reproduction.

Source: biomejs/biome

View original on GitHubView discussion on GitHub