You may have arrived here after clicking on a rule name from a linting error message or a different tool. If so, you may have expected to find the documentation of a rule. Unfortunately, it is likely that the rule originated from an ESLint plugin that doesn't specify where it's own documentation is, or that is unknown to this tool.
In order to improve the tool you were using and improve others, your help would be very valuable.
The best way you can help is to file an issue or submit a PR to the rule in
question asking them to support the rule.meta.docs.url
property on their rule.
This was added in ESLint v4.15.0
and provides a location where the entire ESLint ecosystem can get to the location
of the rule's documentation.
This package will continue to be maintained for rules that haven't updated to
specify their own location though, so if you would like to add support here in
eslint-rule-documentation
you can submit a pull request.
You'll need a GitHub account!
- Find out where the documentation for the rules of the plugin are located. Find the plugin on
npm
, then the location of the repository, then try to find out the generic URL for rule documentation. Very often, it is athttps://github.com/USERNAME/eslint-plugin-PLUGINNAME/blob/master/docs/rules/RULENAME.md
. - Edit
plugins.json
, the file containing the list of supported plugins, by clicking this link. - Add a new entry for your plugin, using the link found in step 1, containing
RULENAME
as a placeholder for the name of the rule.- If the author uses the standard convention of hosting the documentation at
https://github.com/USERNAME/eslint-plugin-PLUGINNAME/blob/master/docs/rules/RULENAME.md
, then you can just put"PLUGINNAME": "USERNAME",
inplugins.json
. (Example) - If the author did not follow the repository naming convention outlined above, but still puts the rule documentation in
docs/rules/RULENAME.md
, then you can put"PLUGINNAME": "USERNAME/REPONAME",
inplugins.json
. (Example) - If the author does not follow the convention for rule placement, then you must specify the path for the documentation.
For example, if the rules foreslint-plugin-foo
are documented under headings inREADME.md
, you should specify that withhttps://github.com/author/eslint-plugin-foo#RULENAME
, whereRULENAME
will get replaced with the name of the rule to open. (Example)
- If the author uses the standard convention of hosting the documentation at
- In the bottom-field, add a title like
Add support for eslint-plugin-XYZ
, maybe add a little message, and then click on submit.
Thanks a lot for doing this! If you have any trouble with these steps, please describe your problem in a new Issue, and we'll try to help you for the last bit, or do it ourselves.