1.0.23 • Published 5 years ago
eslint-rule-documentation v1.0.23
eslint-rule-documentation
Find the url for the documentation of an ESLint rule
Install
$ npm install --save eslint-rule-documentation
Usage
const getRuleURI = require('eslint-rule-documentation');
// find url for core rules
getRuleURI('no-var');
// => { found: true, url: 'https://eslint.org/docs/rules/no-var' }
// find url for known plugins
getRuleURI('import/no-unresolved');
// => { found: true, url: 'https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-unresolved.md' }
// If the plugin is not known, get a link to help improve this
getRuleURI('unknown-foo/bar');
// => { found: false, url: 'https://github.com/jfmengels/eslint-rule-documentation/blob/master/contributing.md' }
Contributing
If you find a plugin that you use is not in the list of supported plugins, please consider adding it to the project by following the instructions here.
API
getRuleURI(ruleId)
ruleId
Type: string
Id of an ESLint rule.
Examples:
- core rule:
no-var
- plugin rule:
import/no-unresolved
(from the eslint-plugin-import plugin).
returns
Type: object
{
found: <boolean>,
url: <string>
}
found
:true
if the rule is an ESLint core rule, or a rule of a known plugin,false
otherwise.url
: iffound
istrue
, url of the documentation of a rule. Iffound
isfalse
, url of the contribution guidelines.
Thanks
Special thanks to the team behind linter-eslint for the original work, and the people who contributed there.
License
MIT © Jeroen Engels
1.0.23
5 years ago
1.0.22
5 years ago
1.0.21
6 years ago
1.0.20
6 years ago
1.0.19
6 years ago
1.0.18
7 years ago
1.0.17
7 years ago
1.0.16
7 years ago
1.0.15
7 years ago
1.0.14
7 years ago
1.0.13
7 years ago
1.0.12
7 years ago
1.0.11
7 years ago
1.0.10
7 years ago
1.0.9
7 years ago
1.0.8
7 years ago
1.0.7
7 years ago
1.0.6
7 years ago
1.0.5
7 years ago
1.0.4
7 years ago
1.0.3
7 years ago
1.0.2
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago