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

refactor: biome linter updates #1226

Merged
merged 7 commits into from
Jun 14, 2024
Merged

refactor: biome linter updates #1226

merged 7 commits into from
Jun 14, 2024

Conversation

setchy
Copy link
Member

@setchy setchy commented Jun 12, 2024

A selection of updates to remove biome warnings, including:

  • ensure all callbacks specify their dependencies
  • enable noUnusedFunctionParamaters nursery rule and fix lint errors
  • enable useDefaultSwitchClause nursery rule and fix lint errors

@setchy setchy added the refactor Refactoring of existing feature label Jun 12, 2024
@setchy setchy changed the title Refactor/biome updates refactor: biome linter updates Jun 12, 2024
@setchy setchy added this to the Release 5.9.0 milestone Jun 13, 2024
@setchy setchy marked this pull request as ready for review June 13, 2024 17:21
Copy link
Collaborator

@bmulholland bmulholland left a comment

Choose a reason for hiding this comment

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

Seems more explicit now, which is good. Just some risk in introducing state issues :)

@setchy
Copy link
Member Author

setchy commented Jun 13, 2024

@afonsojramos - appreciate your feedback on this too when you get a chance 🙏

Copy link
Member

@afonsojramos afonsojramos left a comment

Choose a reason for hiding this comment

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

As most are dependency arrays for callbacks I think it should be fine!

@setchy setchy merged commit ba0a493 into main Jun 14, 2024
7 checks passed
@setchy setchy deleted the refactor/biome-updates branch June 14, 2024 01:14
@afonsojramos
Copy link
Member

According to React docs:

dependencies: The list of all reactive values referenced inside of the fn code. Reactive values include props, state, and all the variables and functions declared directly inside your component body. If your linter is configured for React, it will verify that every reactive value is correctly specified as a dependency. The list of dependencies must have a constant number of items and be written inline like [dep1, dep2, dep3]. React will compare each dependency with its previous value using the Object.is comparison algorithm.

https://react.dev/reference/react/useCallback

Seems to me that passing these functions as dependencies won't have any impact tbh...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Refactoring of existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants