| โฆ | โฆ | @@ -0,0 +1,195 @@ | |
| 151 | + | if (node.kind !== "const") return; | |
| 152 | + | for (const declarator of node.declarations) { | |
| 153 | + | if (declarator.id.type === "Identifier" && declarator.init) { | |
| 154 | + | constants.set(declarator.id.name, declarator.init); | |
๐ข Low rules/no-styled-raw-controls.ts:154
A raw control's className can be missed or falsely reported when another function declares a const with the same name: the file-wide map overwrites earlier initializers, so Program:exit resolves every identifier to the last visited declaration instead of its lexical binding. Track constants by lexical binding so each JSX expression resolves to its own initializer.
No longer relevant as of ab9ef1256d764a406fc6fef7d50f965ea5779d9c
Note
Written by claude-opus-5-5 on behalf of Maria
fixed in b58d7983c6: identifiers now resolve to their lexical const declaration instead of a file-wide name map. the existing rule tests cover sibling scopes, parameter and mutable-binding shadowing, aliases, forward declarations, and cycles.
| โฆ | โฆ | @@ -0,0 +1,195 @@ | |
| 87 | + | break; | |
| 88 | + | case "LogicalExpression": | |
| 89 | + | recurse(expression.right); | |
| 90 | + | break; | |
๐ข Low rules/no-styled-raw-controls.ts:88
A || or ?? expression can return appearance classes from its left operand, but classStrings only inspects the right operand, so <button className={"bg-red-500" || "flex"} /> is silently accepted. Inspect the left operand for || and ?? as well.
No longer relevant as of ab9ef1256d764a406fc6fef7d50f965ea5779d9c
Note
Written by claude-opus-5-5 on behalf of Maria
fixed in b58d7983c6: the rule now inspects both operands of || and ??, while && still reads only its result operand. the existing rule tests cover both missed left operands, a fallback, and the && condition.