-
Notifications
You must be signed in to change notification settings - Fork 46.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[eslint-plugin-react-hooks] Added meta property (including docs) #16607
Conversation
Details of bundled changes.Comparing: 996acf9...418f4ee eslint-plugin-react-hooks
Generated by 🚫 dangerJS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Hopefully this can get merged in.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution. |
418f4ee
to
292d2a1
Compare
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 9d2320c:
|
Details of bundled changes.Comparing: 3e94bce...9d2320c eslint-plugin-react-hooks
Size changes (experimental) |
Details of bundled changes.Comparing: 3e94bce...9d2320c eslint-plugin-react-hooks
Size changes (stable) |
It has been a long time since this was submitted. Can someone look at it? I believe it will help users understand the eslint rules better. |
Thanks! |
ESLint v4.15.0 added an official location for rules to store metadata such as a URL to their documentation (see eslint/eslint#9788). This adds the URL to all the existing rules so anything consuming them can know where their documentation is without having to resort to external packages to guess. Plugins such as this one can also help the ESLint ecosystem benefit from the same information by adding the
type
anddocs
properties to themeta
object in their rule definitions.In order to allow my vscode extension lintlens to direct users to the right documentation, this PR adds/updates the meta property (in accordance with ESLint's Rule Basics) to each of the rules in the
eslint-plugin-react-hooks
package.I tried my best to determine the correct values for
type
,docs.description
,docs.category
, anddocs.url
. Usually, plugins would place a markdown file under/docs/rules
(EX: ESLint Rules) for each rule and use that as the url property value. I did not include such documentation myself. Rather, I pointed to existing documentation for each rule: