compat-eslint: migrate 11 mechanical classes to SHAPES factory#92
Closed
johnsoncodehk wants to merge 1 commit into
Closed
compat-eslint: migrate 11 mechanical classes to SHAPES factory#92johnsoncodehk wants to merge 1 commit into
johnsoncodehk wants to merge 1 commit into
Conversation
Each class had only `type` plus simple convertChild/convertChildren slot getters — exactly the mechanical pattern the factory was designed to absorb. Migration eliminates 11 hand-written subclass + switch-case pairs and pushes them through the single-source-of-truth registry that both top-down getters and bottom-up materialise consult. Migrated: - Pure type tag: SuperNode, ThisExpressionNode, TSThisTypeNode, EmptyStatementNode, JSXOpeningFragmentNode, JSXClosingFragmentNode - defaults (static fields): NullLiteralNode (value/raw) - consts (derived from tsNode): PrivateIdentifierNode (name) - single-slot convertChild: JSXSpreadAttributeNode - slot via callback: JSXClosingElementNode (convertJSXTagName), StaticBlockNode (decorators default + body via callback for nested block.statements access) Hand-written class count 91 → 81; SHAPES entries 46 → 57. Net -56 lines. Tested: predicate-coverage / lazy-estree / scope-compat / selector-analysis / ts-ast-scan / compat-pipeline / jsx-react-x + dogfood (107 rules × 30 files clean) + Dify cold/warm bench (no regression).
6 tasks
Owner
Author
|
Superseded by #95 — squashed and consolidated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
11 hand-written subclasses migrated to the SHAPES factory. Each had only a
typefield plus mechanicalconvertChild/convertChildrenslot getters — exactly the pattern the factory absorbs. Migration eliminates the per-class top-down/bottom-up drift surface (the factory's single registry serves both directions).SuperNode,ThisExpressionNode,TSThisTypeNode,EmptyStatementNode,JSXOpeningFragmentNode,JSXClosingFragmentNodedefaults(static fields)NullLiteralNode(value,raw)consts(derived from tsNode)PrivateIdentifierNode(name)convertChildJSXSpreadAttributeNodeJSXClosingElementNode(convertJSXTagName),StaticBlockNode(default decorators + nestedbody.statementsaccess)Hand-written
*Node extends LazyNodecount: 91 → 81. SHAPES entries: 46 → 57. Net −56 lines.Test plan
predicate-coverage(152/152, 16 ignored)lazy-estree.test(parity sweep + factory tests + phantom-types invariant)scope-compat(24/24 clean)selector-analysis/ts-ast-scan/compat-pipeline/jsx-react-x(parity ✓)dogfood.js— 30 files × 107 rules, 0 divergences, 0 crashes