Skip to content

Commit 106bd4f

Browse files
committed
feat(linter): change react/rules-of-hooks category to pedantic
Although this rule is recommended by the React team, it does report incorrect or wrong code for the `correctness` category. When turned on by default, I find false positive warnings confusing, I cannot tell whether my code is wrong or the rule implementation is wrong - see examples in the affine repo. ``` x eslint-plugin-react-hooks(rules-of-hooks): React Hook "use" cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function. ,-[packages/backend/server/src/config/affine.self.ts:80:1] 79 | /* Captcha Plugin Default Config */ 80 | ,-> AFFiNE.use('captcha', { 81 | | turnstile: {}, 82 | | challenge: { 83 | | bits: 20, 84 | | }, 85 | `-> }); 86 | `---- ```
1 parent 7cee065 commit 106bd4f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

crates/oxc_linter/src/rules/react/rules_of_hooks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ declare_oxc_lint!(
104104
/// <https://reactjs.org/docs/hooks-rules.html>
105105
///
106106
RulesOfHooks,
107-
correctness
107+
pedantic
108108
);
109109

110110
impl Rule for RulesOfHooks {

0 commit comments

Comments
 (0)