-
-
Notifications
You must be signed in to change notification settings - Fork 485
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
feat(useExhaustiveDependencies): add option to disable errors for unecessary dependencies #4135
feat(useExhaustiveDependencies): add option to disable errors for unecessary dependencies #4135
Conversation
CodSpeed Performance ReportMerging #4135 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Just need to fix the defaults a bit.
...s_analyze/tests/specs/correctness/useExhaustiveDependencies/reportUnnecessaryDependencies.js
Outdated
Show resolved
Hide resolved
crates/biome_js_analyze/src/lint/correctness/use_exhaustive_dependencies.rs
Outdated
Show resolved
Hide resolved
@arendjr Thanks, all fixed |
Just realized we forgot a CHANGELOG entry. Feel free to add it in the next PR or do a separate one. |
Closes #630
Summary
This adds an option to suppress errors for dependencies that are in the dependencies array but not used in the hook function.
The option schema is below. It could also have the new field inside the hooks array but I think you'd generally want to use this for every hook type.
Additionally, the options struct for this rule was originally designed to be reused, but at some point it was removed from useHookAtTopLevel here, now it's not actually reused anywhere. Since this PR adds an option field specific to this rule, I've renamed the options struct to indicate that it's non-reusable.
Test Plan
A unit test is included