eslint-plugin-apidoc
lint apidoc.json using API style rules (see http://apidoc.me/)
Installation
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-apidoc:
$ npm install eslint-plugin-apidoc --save-dev
Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-apidoc globally.
Usage
Add apidoc to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": [
"apidoc"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"apidoc/rule-name": 2
}
}
Finally be sure to include your apidoc.json file when running eslint:
eslint apidoc.json
Supported Rules
base-url - validates that a valid base_url is specified
- options can be used to force a domain (
[{"domain": "mydomain.com"}]) (any subdomain is allowed)
contact - validates contact (valid name and email)
description - validates a description exists for the API and for all resources.
For adding new rules, check rules README