github-pages-deploy-action/node_modules/eslint-rule-documentation
2020-03-31 08:40:00 -04:00
..
index.js Dependencies 2020-03-06 22:45:40 -05:00
license Dependencies 2020-03-06 22:45:40 -05:00
package.json 3.4.3 2020-03-31 08:40:00 -04:00
plugins.json Dependencies 2020-03-06 22:45:40 -05:00
readme.md Dependencies 2020-03-06 22:45:40 -05:00

eslint-rule-documentation Build Status

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:

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: if found is true, url of the documentation of a rule. If found is false, 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