Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Shinigami92 <chrissi92@hotmail.de>
- Loading branch information
1 parent
5e0578a
commit e51d5d7
Showing
9 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* Eslint ReactHooks extensions. | ||
* | ||
* @see [Eslint ReactHooks extensions](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks) | ||
*/ | ||
export type ReactHooksExtensions = 'plugin:react-hooks/recommended'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import type { RuleConfig } from '../rule-config'; | ||
|
||
/** | ||
* Option. | ||
*/ | ||
export interface ExhaustiveDepsOption { | ||
additionalHooks?: string; | ||
enableDangerousAutofixThisMayCauseInfiniteLoops?: boolean; | ||
} | ||
|
||
/** | ||
* Options. | ||
*/ | ||
export type ExhaustiveDepsOptions = [ExhaustiveDepsOption?]; | ||
|
||
/** | ||
* Verifies the list of dependencies for Hooks like useEffect and similar. | ||
* | ||
* @see [exhaustive-deps](https://github.com/facebook/react/issues/14920) | ||
*/ | ||
export type ExhaustiveDepsRuleConfig = RuleConfig<ExhaustiveDepsOptions>; | ||
|
||
/** | ||
* Verifies the list of dependencies for Hooks like useEffect and similar. | ||
* | ||
* @see [exhaustive-deps](https://github.com/facebook/react/issues/14920) | ||
*/ | ||
export interface ExhaustiveDepsRule { | ||
/** | ||
* Verifies the list of dependencies for Hooks like useEffect and similar. | ||
* | ||
* @see [exhaustive-deps](https://github.com/facebook/react/issues/14920) | ||
*/ | ||
'react-hooks/exhaustive-deps': ExhaustiveDepsRuleConfig; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type { ExhaustiveDepsRule } from './exhaustive-deps'; | ||
import type { RulesOfHooksRule } from './rules-of-hooks'; | ||
|
||
/** | ||
* All ReactHooks rules. | ||
*/ | ||
export type ReactHooksRules = RulesOfHooksRule & ExhaustiveDepsRule; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { RuleConfig } from '../rule-config'; | ||
|
||
/** | ||
* Enforces the Rules of Hooks. | ||
* | ||
* @see [rules-of-hooks](https://reactjs.org/docs/hooks-rules.html) | ||
*/ | ||
export type RulesOfHooksRuleConfig = RuleConfig<[]>; | ||
|
||
/** | ||
* Enforces the Rules of Hooks. | ||
* | ||
* @see [rules-of-hooks](https://reactjs.org/docs/hooks-rules.html) | ||
*/ | ||
export interface RulesOfHooksRule { | ||
/** | ||
* Enforces the Rules of Hooks. | ||
* | ||
* @see [rules-of-hooks](https://reactjs.org/docs/hooks-rules.html) | ||
*/ | ||
'react-hooks/rules-of-hooks': RulesOfHooksRuleConfig; | ||
} |