Skip to content

fix(core): review fixes for component, hook and api modules#1660

Merged
Rel1cx merged 1 commit intomainfrom
refactor/core-review-fixes
Mar 29, 2026
Merged

fix(core): review fixes for component, hook and api modules#1660
Rel1cx merged 1 commit intomainfrom
refactor/core-review-fixes

Conversation

@Rel1cx
Copy link
Copy Markdown
Owner

@Rel1cx Rel1cx commented Mar 29, 2026

  • fix(component-collector): reuse computed id instead of calling getFunctionComponentId twice
  • fix(hook-semantic-node): unify directives type to ast.TSESTreeDirective[]
  • fix(is-react-api): correct suffix matching logic with endsWith
  • fix(component-collector-legacy): correct typo in JSDoc
  • fix(component-detection-legacy): cover ClassExpression in isRenderMethodLike
  • fix(find-import-source): guard against circular references with visited Set
  • fix(component-detection-legacy): validate class component import source from react (optional context param)
  • refactor(component-wrapper): keep isComponentWrapperCallLoose for useCallback support
  • refactor(hook-is): rename isHook to isHookDefinition
  • refactor(component-detection-legacy): rename isThisSetState to isThisSetStateCall
  • refactor(hook-is): un-export isHookCallWithName

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Perf
  • Docs
  • Test
  • Chore
  • Enhancement
  • 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

- fix(component-collector): reuse computed id instead of calling getFunctionComponentId twice
- fix(hook-semantic-node): unify directives type to ast.TSESTreeDirective[]
- fix(is-react-api): correct suffix matching logic with endsWith
- fix(component-collector-legacy): correct typo in JSDoc
- fix(component-detection-legacy): cover ClassExpression in isRenderMethodLike
- fix(find-import-source): guard against circular references with visited Set
- fix(component-detection-legacy): validate class component import source from react (optional context param)
- refactor(component-wrapper): keep isComponentWrapperCallLoose for useCallback support
- refactor(hook-is): rename isHook to isHookDefinition
- refactor(component-detection-legacy): rename isThisSetState to isThisSetStateCall
- refactor(hook-is): un-export isHookCallWithName
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

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

Project Deployment Actions Updated (UTC)
eslint-react Ready Ready Preview, Comment Mar 29, 2026 5:37pm

Request Review

@Rel1cx Rel1cx marked this pull request as ready for review March 29, 2026 17:37
@Rel1cx Rel1cx changed the title refactor(core): review fixes for component, hook and api modules fix(core): review fixes for component, hook and api modules Mar 29, 2026
@Rel1cx Rel1cx merged commit e7dd646 into main Mar 29, 2026
14 checks passed
@Rel1cx Rel1cx deleted the refactor/core-review-fixes branch March 29, 2026 17:37
Rel1cx added a commit that referenced this pull request Mar 31, 2026
Cover the following changes introduced in PR #1660:
- find-import-source: circular reference guard with visited Set
- is-react-api: correct suffix matching with endsWith
- component-detection-legacy: isRenderMethodLike covers ClassExpression,
  isClassComponent with optional context, isThisSetState -> isThisSetStateCall
- hook-is: isHook -> isHookDefinition rename, isHookCallWithName un-exported

Cover the following changes introduced in PR #1662:
- function-init-path: support ClassExpression in addition to ClassDeclaration
- node-equality: handle JSXNamespacedName in JSXAttribute comparison

New test files:
- packages/core/src/api/find-import-source.test.ts (6 tests)
- packages/core/src/api/is-react-api.test.ts (32 tests)
- packages/core/src/component/component-detection-legacy.test.ts (13 tests)
- packages/core/src/hook/hook-is.test.ts (20 tests)
- packages/utilities/ast/src/function-init-path.test.ts (6 tests)
- packages/utilities/ast/src/node-equality.test.ts (16 tests)
Rel1cx added a commit that referenced this pull request Mar 31, 2026
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.

1 participant