mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
feat(linter): move react/rules_of_hooks to nursery
This commit is contained in:
parent
44b16ef79d
commit
6edcae86cd
2 changed files with 3 additions and 3 deletions
|
|
@ -102,7 +102,7 @@ declare_oxc_lint!(
|
|||
/// <https://reactjs.org/docs/hooks-rules.html>
|
||||
///
|
||||
RulesOfHooks,
|
||||
correctness
|
||||
nursery
|
||||
);
|
||||
|
||||
impl Rule for RulesOfHooks {
|
||||
|
|
@ -846,7 +846,7 @@ fn test() {
|
|||
// This *must* be invalid.
|
||||
"
|
||||
function useHook() {
|
||||
if (a) return;
|
||||
if (a) return;
|
||||
useState();
|
||||
}
|
||||
",
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ expression: rules_of_hooks
|
|||
---
|
||||
× eslint-plugin-react-hooks(rules-of-hooks): React Hook "useState" is called conditionally. React Hooks must be called in the exact same order in every component render.
|
||||
╭─[rules_of_hooks.tsx:4:15]
|
||||
3 │ if (a) return;
|
||||
3 │ if (a) return;
|
||||
4 │ useState();
|
||||
· ──────────
|
||||
5 │ }
|
||||
|
|
|
|||
Loading…
Reference in a new issue