Skip to content

Commit 66ae640

Browse files
authored
[eprh] fix react-compiler rules missing meta.docs.url property (facebook#35258)
## Summary To help people access the documentation easier, we can [add `meta.docs.url`](https://eslint.org/docs/latest/extend/custom-rules#:~:text=Specifies%20the%20URL) to the new react-compiler rules. This allows IDEs to make the rule name a clickable link. ## How did you test this change? `yarn test`, `yarn prettier`, `yarn lint` and in a separate project [using file:// URLs](https://stackoverflow.com/a/38417065)
1 parent bf1afad commit 66ae640

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/eslint-plugin-react-hooks/src/shared/ReactCompiler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ function makeRule(rule: LintRule): Rule.RuleModule {
151151
docs: {
152152
description: rule.description,
153153
recommended: rule.preset === LintRulePreset.Recommended,
154+
url: `https://react.dev/reference/eslint-plugin-react-hooks/lints/${rule.name}`,
154155
},
155156
fixable: 'code',
156157
hasSuggestions: true,

0 commit comments

Comments
 (0)