File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
packages/eslint-plugin-react-hooks/src Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 77import type { Linter , Rule } from 'eslint' ;
88
99import ExhaustiveDeps from './rules/ExhaustiveDeps' ;
10- import { allRules } from './shared/ReactCompiler' ;
10+ import {
11+ allRules ,
12+ mapErrorSeverityToESlint ,
13+ recommendedRules ,
14+ } from './shared/ReactCompiler' ;
1115import RulesOfHooks from './rules/RulesOfHooks' ;
1216
1317// All rules
@@ -23,6 +27,15 @@ const rules = {
2327const ruleConfigs = {
2428 'react-hooks/rules-of-hooks' : 'error' ,
2529 'react-hooks/exhaustive-deps' : 'warn' ,
30+ // Compiler rules
31+ ...Object . fromEntries (
32+ Object . entries ( recommendedRules ) . map ( ( [ name , ruleConfig ] ) => {
33+ return [
34+ 'react-hooks/' + name ,
35+ mapErrorSeverityToESlint ( ruleConfig . severity ) ,
36+ ] ;
37+ } ) ,
38+ ) ,
2639} satisfies Linter . RulesRecord ;
2740
2841const plugin = {
You can’t perform that action at this time.
0 commit comments