Skip to content
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

Merged
merged 3 commits into from
Apr 1, 2020

Conversation

ghmcadams
Copy link
Contributor

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 and docs properties to the meta 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, and docs.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:

@sizebot
Copy link

sizebot commented Aug 29, 2019

Details of bundled changes.

Comparing: 996acf9...418f4ee

eslint-plugin-react-hooks

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
eslint-plugin-react-hooks.development.js +0.6% +1.0% 75.25 KB 75.71 KB 17.31 KB 17.47 KB NODE_DEV
eslint-plugin-react-hooks.production.min.js 🔺+1.8% 🔺+2.4% 20.14 KB 20.5 KB 6.9 KB 7.06 KB NODE_PROD
ESLintPluginReactHooks-dev.js +0.6% +0.9% 80.82 KB 81.29 KB 17.83 KB 18 KB FB_WWW_DEV

Generated by 🚫 dangerJS

Copy link

@jadamsss jadamsss left a 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.

@stale
Copy link

stale bot commented Feb 17, 2020

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.

@stale stale bot added the Resolution: Stale Automatically closed due to inactivity label Feb 17, 2020
@stale stale bot removed the Resolution: Stale Automatically closed due to inactivity label Feb 23, 2020
@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 23, 2020

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:

Sandbox Source
reverent-shamir-nlkxd Configuration

@sizebot
Copy link

sizebot commented Feb 23, 2020

Details of bundled changes.

Comparing: 3e94bce...9d2320c

eslint-plugin-react-hooks

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
eslint-plugin-react-hooks.development.js +0.6% +0.9% 80.92 KB 81.38 KB 18.48 KB 18.65 KB NODE_DEV
eslint-plugin-react-hooks.production.min.js 🔺+1.6% 🔺+2.2% 22.1 KB 22.45 KB 7.46 KB 7.63 KB NODE_PROD

Size changes (experimental)

Generated by 🚫 dangerJS against 9d2320c

@sizebot
Copy link

sizebot commented Feb 23, 2020

Details of bundled changes.

Comparing: 3e94bce...9d2320c

eslint-plugin-react-hooks

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
eslint-plugin-react-hooks.development.js +0.6% +0.9% 80.9 KB 81.37 KB 18.48 KB 18.64 KB NODE_DEV
eslint-plugin-react-hooks.production.min.js 🔺+1.6% 🔺+2.2% 22.08 KB 22.44 KB 7.46 KB 7.62 KB NODE_PROD

Size changes (stable)

Generated by 🚫 dangerJS against 9d2320c

@ghmcadams
Copy link
Contributor Author

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.

@gaearon gaearon merged commit 3f46844 into facebook:master Apr 1, 2020
@gaearon
Copy link
Collaborator

gaearon commented Apr 1, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants