Skip to content

feat(rule): add React type exports to prefer-named-react-imports#9

Merged
spawnia merged 1 commit into
masterfrom
add-react-type-exports
Feb 5, 2026
Merged

feat(rule): add React type exports to prefer-named-react-imports#9
spawnia merged 1 commit into
masterfrom
add-react-type-exports

Conversation

@spawnia

@spawnia spawnia commented Feb 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Add 22 TypeScript type exports to the REACT_EXPORTS set so the rule catches usages like React.CSSProperties, React.FC, React.ReactNode, etc.
  • Handle TSQualifiedName AST nodes to detect type annotation usages (e.g., const style: React.CSSProperties) in addition to runtime member expressions

Test plan

  • Added test case for React.CSSProperties type annotation
  • All existing tests pass
  • Build succeeds

🤖 Generated with Claude Code

Add TypeScript type exports to the REACT_EXPORTS set so the rule catches
usages like React.CSSProperties, React.FC, React.ReactNode, etc.

Also handle TSQualifiedName AST nodes to detect type annotation usages
in addition to runtime member expressions.

Added types: ButtonHTMLAttributes, ChangeEvent, ComponentProps,
ComponentType, CSSProperties, Dispatch, FC, FocusEvent, FormEvent,
FunctionComponent, HTMLAttributes, InputHTMLAttributes, JSX,
KeyboardEvent, MouseEvent, MutableRefObject, PropsWithChildren,
ReactElement, ReactNode, Ref, RefObject, SetStateAction

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@spawnia spawnia merged commit 7165b20 into master Feb 5, 2026
4 checks passed
@spawnia spawnia deleted the add-react-type-exports branch February 5, 2026 15:49
@github-actions

github-actions Bot commented Feb 5, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants