-
-
Notifications
You must be signed in to change notification settings - Fork 32
refactor: reorganize AST and utilities structure #1199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Rename and restructure AST utility modules for better organization - Consolidate expression, function, and node utilities into logical groups - Remove deprecated var collection and scope utilities - Add new traversal utilities for AST navigation - Update package.json files across all packages - Migrate JSX attribute and detection improvements - Enhance React hooks and web API rule implementations - Improve variable handling and declaration utilities
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR reorganizes the AST and utilities structure by renaming modules, consolidating functions into logical groups, and updating imports throughout the codebase.
- Renames function and variable utilities with clearer names (e.g.,
getVariableInitNode→getVariableDefinitionNode) - Consolidates AST utilities into logical groups like
expression,function,node, andtraverse - Removes deprecated utilities and creates new traversal helpers for AST navigation
Reviewed Changes
Copilot reviewed 63 out of 74 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/utilities/var/src/variable-resolver.ts | Renames getVariableInitNode to getVariableDefinitionNode |
| packages/utilities/var/src/variable-extractor.ts | New file extracting variable collection functions from deprecated modules |
| packages/utilities/var/src/variable-assignment.ts | Renames getVariableDeclaratorId to findAssignmentTarget |
| packages/utilities/var/src/misc.ts | New file consolidating scope and property utilities |
| packages/utilities/ast/src/traverse-up.ts | New AST traversal utility for finding parent nodes |
| packages/utilities/ast/src/expression-*.ts | Refactored expression utilities into separate modules |
| packages/utilities/ast/src/function-*.ts | Enhanced function utilities with better documentation |
| Multiple plugin files | Updates imports and function calls to use renamed utilities |
| Multiple package.json files | Bumps @types/react version from 19.1.11 to 19.1.12 |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
packages/utilities/ast/src/function-is.ts:1
- The comment placement is confusing. The comment about 'const whatever = function MaybeComponent() {}' should be moved before line 24 where the corresponding case is handled, not after the return statement for the previous case.
import { AST_NODE_TYPES as T } from "@typescript-eslint/types";
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
Checklist
fix: remove a typo, closes #___, #___)Other information