You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

eslint-plugin-apidoc

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-apidoc

lint apidoc.json using API style rules

0.0.7
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

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

Keywords

eslint

FAQs

Package last updated on 09 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts