Skip to content
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

[no-use-prefix-for-non-hook]: Fix allow call expression assignment #6

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

MattisAbrahamsson
Copy link
Member

This PR makes an adjustment to the no-use-prefix-for-non-hook rule.

I noticed when running this rule on the codebase that it warns on store hooks created by zustand,
they look like this:

const useUserStore = create(...);

To solve this I opted towards just allowing all function call expressions to be assigned to a variable with the use prefix. In the future we could possibly add a configuration option where you can send in a regex or something

@MattisAbrahamsson MattisAbrahamsson added the enhancement New feature or request label Aug 5, 2024
Copy link

@dennis-meitner dennis-meitner left a comment

Choose a reason for hiding this comment

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

Not bad

Copy link

@Kalle-Rei Kalle-Rei left a comment

Choose a reason for hiding this comment

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

Yay ✌️ ✌️

@MattisAbrahamsson MattisAbrahamsson merged commit 046865f into main Aug 5, 2024
2 checks passed
@MattisAbrahamsson MattisAbrahamsson deleted the fix/no-use-prefix-allow-call-expression branch August 5, 2024 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants