Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/npmlint
[DEPRECATED] Lint your npm package
https://github.com/sindresorhus/npmlint
deprecated javascript lint nodejs npm npm-package
Last synced: 24 days ago
JSON representation
[DEPRECATED] Lint your npm package
- Host: GitHub
- URL: https://github.com/sindresorhus/npmlint
- Owner: sindresorhus
- Archived: true
- Created: 2015-11-27T08:46:03.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2021-01-23T18:01:02.000Z (about 4 years ago)
- Last Synced: 2024-04-13T16:33:28.553Z (10 months ago)
- Topics: deprecated, javascript, lint, nodejs, npm, npm-package
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 57
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Deprecated
This is a code dump of something I made a long time ago, but never had the time to finish. There are lots of things that could have been done better.
---
# npmlint [![Build Status](https://travis-ci.org/sindresorhus/npmlint.svg?branch=master)](https://travis-ci.org/sindresorhus/npmlint)
> Lint your npm package
Makes sure your package is unicorn good.
## Install
```
$ npm install --global npmlint
```## Usage
Go to the package you want to lint and run `npmlint`.
## API
```
$ npm install --save npmlint
``````js
const npmlint = require('npmlint');console.log(npmlint());
//=> ['suggestion', 'another suggestion']
```## Dev
You can try it out by `cd`'ing into the `test` folder and running `../cli.js`
### Creating rules
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.jsonIt'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## License
MIT © [Sindre Sorhus](http://sindresorhus.com)