node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



lint apidoc.json using API style rules (see


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.


Add apidoc to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

    "plugins": [

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": ""}]) (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