Giter VIP home page Giter VIP logo

eslint-rule-documentation's Introduction

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

eslint-rule-documentation's People

Contributors

absentsemicolon avatar alaycock avatar amercier avatar apexskier avatar arcanemagus avatar benjaminpearson avatar j-f1 avatar jfmengels avatar josh avatar macklinu avatar mastilver avatar michalsnik avatar mjomble avatar mozfreddyb avatar mrsalieri avatar saladfork avatar simenb avatar sonicdoe avatar standard8 avatar touzoku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

eslint-rule-documentation's Issues

Begin the mourning process ๐ŸŽ‰

Once eslint/eslint#9788 is released the contributing document should be modified to direct people to encourage rule authors to supply their own URL in the rule's metadata so that eventually this package can be put to rest ๐Ÿ˜›.

non-existent core rules and contribution link

When specifying a non-existent core rule, a link to a non-existent page will be generated, e.g.

getRuleURI('foo-bar');
// => { found: true, url: 'http://eslint.org/docs/rules/foo-bar' }

Would it be viable to use eslint-find-rule (as a lib) or just use similar means to check if there's an actual rule by that name and print a help otherwise?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.