eslint-rule-documentation

Find the url for the documentation of an ESLint rule

MIT 24 个版本
安装
npm install eslint-rule-documentation
yarn add eslint-rule-documentation
pnpm add eslint-rule-documentation
bun add eslint-rule-documentation
README

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

版本列表
1.0.23 2019-04-12
1.0.22 2019-01-25
1.0.21 2018-02-23
1.0.20 2018-01-08
1.0.19 2018-01-07
1.0.18 2017-09-04
1.0.17 2017-08-27
1.0.16 2017-08-15
1.0.15 2017-08-03
1.0.14 2017-07-20
1.0.13 2017-07-10
1.0.12 2017-06-26
1.0.11 2017-05-12
1.0.10 2017-04-19
1.0.9 2017-04-18
1.0.8 2017-04-14
1.0.7 2017-04-14
1.0.6 2017-02-12
1.0.5 2017-02-01
1.0.4 2016-12-11
1.0.3 2016-12-07
1.0.2 2016-09-20
1.0.1 2016-09-19
1.0.0 2016-08-01