Skip to content

chore: forbid direct react import#5658

Merged
Kira-Pilot merged 1 commit into
mainfrom
forbid-import-react/kira-pilot
Jan 10, 2023
Merged

chore: forbid direct react import#5658
Kira-Pilot merged 1 commit into
mainfrom
forbid-import-react/kira-pilot

Conversation

@Kira-Pilot

Copy link
Copy Markdown
Member

We should flag React namespace imports and instead import only what we're using. This is recommended by React, cleaner, and takes less time to compile.
Added a custom lint rule to accomplish this and cleaned up any instances we had in our codebase.

Here's the lint rule in action:
Screen Shot 2023-01-10 at 11 56 36 AM

And here is a cleanup:
Screen Shot 2023-01-10 at 11 56 56 AM

@Kira-Pilot Kira-Pilot requested a review from a team as a code owner January 10, 2023 17:30
@Kira-Pilot Kira-Pilot requested review from code-asher, jsjoeio and kylecarbs and removed request for a team January 10, 2023 17:30

@jsjoeio jsjoeio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea!

@Kira-Pilot Kira-Pilot merged commit 0171ccb into main Jan 10, 2023
@Kira-Pilot Kira-Pilot deleted the forbid-import-react/kira-pilot branch January 10, 2023 18:30
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants