Registry Mirror
Skip to content

File tree

‎packages/eslint-plugin-react-hooks/README.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff 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",

‎packages/eslint-plugin-react-hooks/src/index.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,29 @@ import {
1515
} from './shared/ReactCompiler';
1616
import 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+
1834
const 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

2643
const basicRuleConfigs = {

0 commit comments

Comments
 (0)