You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeScript ui_framework fires on type assertions (<NamedTypeNode>expr) via the JSX-component alternative #8011
bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing enginepriority: lowUI tweaks, documentation, and minor optimizationsscope:sweepCompletes a class the burned estates already touch (siblings); blocks no program
The TypeScript ui_framework rule is a JSX-component pattern: (?<!\w)<[A-Z]\w+|className=|use(State|Effect|…)|…. In TypeScript, <Foo>expr is an old-style type assertion, so the rule fires on non-UI code. Repro on main0fddad9:
const x = <E1>node; -> ['<E1']
return <NamedTypeNode>factory.create(); -> ['<NamedTypeNode']
On language-crucible TS files, the rule's most frequent matches were <e1, <e2 and <namedtypenode, from compiler code. This inflates arch_ui_framework (1.4% of functions in the v2.12.0 population DB) for compiler and AST code.
Class
typescript: affected. .ts cannot contain JSX, so <Upper there is an assertion. .tsx can contain JSX, and is fine if mapped to typescript.
javascript: same pattern, but there is no type-assertion syntax, so <Upper is JSX. Not affected.
No other language's ui_framework uses the <[A-Z] alternative.
Fix idea
Treat <Upper…> as JSX only when followed by an attribute, />, or a closing tag, or apply it only to .tsx sources. Add rule tests for an assertion, a generic call and a real component. Goldens may move for TS fixtures.
bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing enginepriority: lowUI tweaks, documentation, and minor optimizationsscope:sweepCompletes a class the burned estates already touch (siblings); blocks no program
Activity