Skip to content

Conversation

@Rel1cx
Copy link
Owner

@Rel1cx Rel1cx commented Dec 6, 2025

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • Test
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • I have added a convincing reason for adding this feature, if necessary

Other information

@vercel
Copy link

vercel bot commented Dec 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
eslint-react Ready Ready Preview Comment Dec 6, 2025 3:56pm

Copy link
Contributor

Copilot AI left a 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 refactors the AST utilities package structure by removing intermediate re-export files and fixes a bug where isNodeEqual did not correctly handle TypeScript type expressions (such as as expressions).

  • Consolidated exports by removing intermediate re-export files (node.ts, function.ts, expression.ts, array.ts, traverse-up.ts)
  • Fixed isNodeEqual to unwrap type expressions before comparison, allowing it to correctly handle cases like handleResize vs handleResize as EventListener
  • Added comprehensive test coverage for the bug fix with three test scenarios

Reviewed changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/utilities/ast/src/index.ts Removes re-exports of intermediate files and exports directly from source files
packages/utilities/ast/src/traverse.ts Consolidates findParentNode function from deleted traverse-up.ts
packages/utilities/ast/src/traverse-up.ts Deleted - functionality moved to traverse.ts
packages/utilities/ast/src/node.ts Deleted - exports moved to index.ts
packages/utilities/ast/src/function.ts Deleted - exports moved to index.ts
packages/utilities/ast/src/expression.ts Deleted - exports moved to index.ts
packages/utilities/ast/src/array.ts Deleted - exports moved to index.ts
packages/utilities/ast/src/node-equal.ts Adds logic to unwrap type expressions before comparison, fixing the as expression bug
packages/utilities/ast/src/property-name.ts Updates imports to reference expression-base and node-is directly
packages/utilities/ast/src/misc.ts Updates import to reference node-is directly
packages/utilities/ast/src/function-is.ts Updates import to reference node-types directly
packages/utilities/ast/src/function-init-path.ts Updates import to reference node-types directly
packages/utilities/ast/src/function-id.ts Updates imports to reference node-is and node-types directly
packages/utilities/ast/src/expression-nested.ts Updates import to reference node-is directly
packages/utilities/ast/src/expression-is.ts Minor formatting change in imports
packages/utilities/ast/src/expression-base.ts Updates imports to reference node-is and node-types directly
packages/utilities/ast/src/class-id.ts Updates import to reference node-types directly and adjusts import order
packages/utilities/ast/src/vitest-mock.ts Adds blank line for consistency
packages/utilities/ast/src/process-env-node-env.ts Adds blank line for consistency
packages/plugins/eslint-plugin-react-web-api/src/rules/no-leaked-event-listener.spec.ts Adds three test cases covering the bug fix for as expressions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

isNodeEqual did not handle TypeScript expressions correctly, closes #1340
@Rel1cx Rel1cx merged commit 8bd5f8e into main Dec 6, 2025
11 of 12 checks passed
@Rel1cx Rel1cx deleted the ast-utilities branch December 6, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants