Files
Giancarmine SalucciandClaude Opus 4.8 8324dde1a2 fix(rules): make magic-number detection far less noisy
Real-world test on a 321-file TS/Svelte monorepo flagged 454 magic-number
findings, ~82% of them noise: literals already assigned to a named const/field
and numbers merely buried under a binary expression (e.g. a call arg inside a
string concat). Tighten all 5 languages to: (1) require the literal be a DIRECT
operand of a binary/comparison expression, and (2) exclude initializers of a
named binding (const/var/let/field). Cuts magic-number ~67% with no loss on
fixtures (each language still detects its genuine `x > 5000` case).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 01:32:33 +02:00
..