WIP - Lint your npm package


Lint your npm package

Makes sure your package is unicorn good.


npm install -g npmlint

Go to the package you want to lint and run npmlint.

You can also use it programmatically.

Install it locally npm install --save npmlint.

const npmlint = require('npmlint');
//=> ['suggestion', 'another suggestion'] 

You can try it out by cd'ing into the test folder and running ../cli.js

Rules are located in a rules directory. These are loaded automatically.

A rule is initiated with an object containing:

  • cwd: the current working directory
  • pkg: the target package' package.json

It's expected to return an object or an array of object containing:

  • name: a slug name for the rule
  • severity: info, warn, error. Use your best judgement
  • message: a message describing the violation

MIT © Sindre Sorhus