File tree Expand file tree Collapse file tree
packages/eslint-plugin-react-hooks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,7 +74,6 @@ export default [
7474 // React Compiler rules
7575 ' react-hooks/config' : ' error' ,
7676 ' react-hooks/error-boundaries' : ' error' ,
77- ' react-hooks/component-hook-factories' : ' error' ,
7877 ' react-hooks/gating' : ' error' ,
7978 ' react-hooks/globals' : ' error' ,
8079 ' react-hooks/immutability' : ' error' ,
@@ -108,7 +107,6 @@ export default [
108107 // React Compiler rules
109108 " react-hooks/config" : " error" ,
110109 " react-hooks/error-boundaries" : " error" ,
111- " react-hooks/component-hook-factories" : " error" ,
112110 " react-hooks/gating" : " error" ,
113111 " react-hooks/globals" : " error" ,
114112 " react-hooks/immutability" : " error" ,
Original file line number Diff line number Diff line change @@ -15,12 +15,29 @@ import {
1515} from './shared/ReactCompiler' ;
1616import RulesOfHooks from './rules/RulesOfHooks' ;
1717
18+ function makeDeprecatedRule ( version : string ) : Rule . RuleModule {
19+ return {
20+ meta : {
21+ type : 'suggestion' ,
22+ docs : {
23+ description : `Deprecated: this rule has been removed in ${ version } .` ,
24+ } ,
25+ schema : [ ] ,
26+ deprecated : true ,
27+ } ,
28+ create ( ) {
29+ return { } ;
30+ } ,
31+ } ;
32+ }
33+
1834const rules = {
1935 'exhaustive-deps' : ExhaustiveDeps ,
2036 'rules-of-hooks' : RulesOfHooks ,
2137 ...Object . fromEntries (
2238 Object . entries ( allRules ) . map ( ( [ name , config ] ) => [ name , config . rule ] ) ,
2339 ) ,
40+ 'component-hook-factories' : makeDeprecatedRule ( '7.1.0' ) ,
2441} satisfies Record < string , Rule . RuleModule > ;
2542
2643const basicRuleConfigs = {
You can’t perform that action at this time.
0 commit comments