Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: forbid direct react import #5658

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

Merged
merged 1 commit into from
Jan 10, 2023
Merged

Conversation

Kira-Pilot
Copy link
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, kylecarbs and jsjoeio and removed request for a team January 10, 2023 17:30
Copy link
Contributor

@jsjoeio jsjoeio left a comment

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