diff --git a/.changeset/the_rule_useexhaustivedependencies_isnt_recommended_anymore.md b/.changeset/the_rule_useexhaustivedependencies_isnt_recommended_anymore.md new file mode 100644 index 000000000000..0865230938d5 --- /dev/null +++ b/.changeset/the_rule_useexhaustivedependencies_isnt_recommended_anymore.md @@ -0,0 +1,21 @@ +--- +cli: major +--- + +# The rule `useExhaustiveDependencies` isn't recommended anymore + +The rule `useExhaustiveDependencies` is not recommended anymore. If your codebase uses `react` and relies on that rule, you have to enable it: + + +```jsonc +// biome.json +{ + "linter": { + "rules": { + "correctness": { + "useExhaustiveDependencies": "error" + } + } + } +} +``` diff --git a/crates/biome_configuration/src/analyzer/linter/rules.rs b/crates/biome_configuration/src/analyzer/linter/rules.rs index d4d89f873fc2..e40632b0b72a 100644 --- a/crates/biome_configuration/src/analyzer/linter/rules.rs +++ b/crates/biome_configuration/src/analyzer/linter/rules.rs @@ -2354,7 +2354,6 @@ impl Correctness { "noUnusedLabels", "noVoidElementsWithChildren", "noVoidTypeReturn", - "useExhaustiveDependencies", "useIsNan", "useJsxKeyInIterable", "useValidForDirection", @@ -2396,7 +2395,6 @@ impl Correctness { RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[40]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[43]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[44]), - RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[46]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[49]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[50]), RuleFilter::Rule(Self::GROUP_NAME, Self::GROUP_RULES[51]), diff --git a/crates/biome_js_analyze/src/lint/correctness/use_exhaustive_dependencies.rs b/crates/biome_js_analyze/src/lint/correctness/use_exhaustive_dependencies.rs index 374fef031c55..f6e55ab304f9 100644 --- a/crates/biome_js_analyze/src/lint/correctness/use_exhaustive_dependencies.rs +++ b/crates/biome_js_analyze/src/lint/correctness/use_exhaustive_dependencies.rs @@ -247,7 +247,7 @@ declare_lint_rule! { name: "useExhaustiveDependencies", language: "jsx", sources: &[RuleSource::EslintReactHooks("exhaustive-deps")], - recommended: true, + recommended: false, } }