@infctr/eslint-docs
Version:
Keep your rule names and descriptions up-to-date across your repo
71 lines (53 loc) • 2.07 kB
Markdown
# eslint-docs
[](https://npmjs.org/package/eslint-docs)

[](https://travis-ci.org/j-f1/eslint-docs)
[](https://codecov.io/gh/j-f1/eslint-docs)
[](https://greenkeeper.io/)
[](https://github.com/semantic-release/semantic-release)
> Keep your rule names and descriptions up-to-date across your repo
[](https://nodei.co/npm/eslint-docs/)
## Installation
```console
$ npm install --save-dev eslint-docs
```
## Usage
In the shell
```console
$ eslint-docs
✔ docs/rules/no-insecure-random.md is up-to-date
✔ docs/rules/no-stateless-class.md is up-to-date
✔ docs/rules/promise-must-complete.md is up-to-date
✔ README.md is up-to-date
$ eslint-docs check # Run this in CI!
✔ docs/rules/no-insecure-random.md is valid
✔ docs/rules/no-stateless-class.md is valid
✔ docs/rules/promise-must-complete.md is valid
✔ The README is valid
```
In package.json:
```json
{
"scripts": {
"docs": "eslint-docs",
"docs:check": "eslint-docs check"
}
}
```
In a Node.js script
```js
const eslintDocs = require('eslint-docs')
eslintDocs(yourProjectDirectory).then(
() => {
// Everything went OK!
},
() => {
// Something went wrong!
// Currently, you’ll have to ask the user to look at the terminal. sorry :(
}
)
```
`yourProjectDirectory` defaults to the closest directory above `process.cwd()`
that includes a `package.json`
## License
ISC © [Jed Fox](https://j-f1.github.io)