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

Use React Hooks by ESLint hooks rule #621

Merged
merged 1 commit into from
Jan 5, 2022

Conversation

saulipurhonen
Copy link
Contributor

Description

Introduced ESLint rule for use of React Hooks. This rule ensures hooks are always called in same exact order and should prevent possible memory leaks.

Related issues

Closes #561

Type of change

  • New feature (non-breaking change which adds functionality)

Changes Made

  • Added rules-of-hooks rule to ESLint configuration
  • Added static type for templates
  • Transformed callback and conditional Hook calls to fit Hooks guidelines (see Rules of Hooks)

Testing

  • Tests do not apply

@saulipurhonen saulipurhonen marked this pull request as ready for review January 3, 2022 14:10
Copy link
Contributor

@hannyle hannyle left a comment

Choose a reason for hiding this comment

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

LGTM! It's good we could enable this rule now.

@saulipurhonen saulipurhonen merged commit 8f1d632 into develop Jan 5, 2022
@saulipurhonen saulipurhonen deleted the feature/use-hooks-by-eslint-rule branch January 5, 2022 07:27
@blankdots blankdots mentioned this pull request Apr 7, 2022
6 tasks
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.

3 participants