Skip to content

Commit 3d70bef

Browse files
committed
compat-eslint: SyntheticLazyNode base — architectural boundary for synthetic intermediates
Synthetic intermediate classes (TSTypeAnnotation, ClassBody, ChainExpression wrapper, etc.) opted out of map registration via a `registerInMaps=false` constructor arg. Easy to forget — and a forgotten synthetic class produces silently-wrong parents on bottom-up materialise because the wrapper-route tables don't see it. Replace the boolean param with a `SyntheticLazyNode` abstract base. The 14 synthetic-creating classes now `extend SyntheticLazyNode` instead of `extend LazyNode`; the base overrides `_registersInMaps()` to return false. Adding a 15th synthetic class is now a visible architectural act in code review (extends a different base + needs a navigation-table entry). Grep `extends SyntheticLazyNode` to find all current synthetic classes. JSXOpeningElementNode is hybrid (synthetic only when wrapping a JsxSelfClosingElement); keeps the LazyNode base but overrides `_registersInMaps()` to dispatch on `this._ts.kind`. Drops the now-unneeded `synthetic` constructor arg. Also drops a dead `registerInMaps` param on JSXIdentifierNode (all 6 call sites passed `true`) and stale comments referencing the removed flag. Tested: predicate-coverage / lazy-estree / scope-compat / selector-analysis / ts-ast-scan / compat-pipeline + dogfood (107 rules × 30 files clean) + Dify cold/warm bench (no regression vs master).
1 parent 9c0a2e8 commit 3d70bef

1 file changed

Lines changed: 89 additions & 59 deletions

File tree

0 commit comments

Comments
 (0)