Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@

export default {
meta: {
type: 'suggestion',
docs: {
description:
'verifies the list of dependencies for Hooks like useEffect and similar',
category: 'Best Practices',
recommended: true,
url: 'https://github.com/facebook/react/issues/14920',
},
fixable: 'code',
schema: [
{
Expand Down
9 changes: 9 additions & 0 deletions packages/eslint-plugin-react-hooks/src/RulesOfHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@ function isInsideComponentOrHook(node) {
}

export default {
meta: {
type: 'problem',
docs: {
description: 'enforces the Rules of Hooks',
category: 'Possible Errors',
recommended: true,
url: 'https://reactjs.org/docs/hooks-rules.html',
},
},
create(context) {
const codePathReactHooksMapStack = [];
const codePathSegmentStack = [];
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin-react-hooks/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

'use strict';

import RuleOfHooks from './RulesOfHooks';
import RulesOfHooks from './RulesOfHooks';
import ExhaustiveDeps from './ExhaustiveDeps';

export const configs = {
Expand All @@ -21,6 +21,6 @@ export const configs = {
};

export const rules = {
'rules-of-hooks': RuleOfHooks,
'rules-of-hooks': RulesOfHooks,
'exhaustive-deps': ExhaustiveDeps,
};