# @hannohealth/lint-docs

> A linter for xxxComments fields in package.json files

Latest version **1.0.4** (published 2021-02-01) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @hannohealth/lint-docs
pnpm add @hannohealth/lint-docs
yarn add @hannohealth/lint-docs
bun add @hannohealth/lint-docs
```

Provides the command `lint-docs`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2021-02-01 |
| First published | 2021-01-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 16.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Hanno |
| Maintainers | hanno-bot |

## Links

- npm: https://www.npmjs.com/package/@hannohealth/lint-docs
- Repository: https://github.com/wearehanno/lint-docs
- Homepage: https://github.com/wearehanno/lint-docs#readme
- Issues: https://github.com/wearehanno/lint-docs/issues
- npm.io page: https://npm.io/package/@hannohealth/lint-docs

## Dependencies (4)

- [chalk](https://npm.io/package/chalk.md) ^4.1.0
- [yargs](https://npm.io/package/yargs.md) ^16.2.0
- [json-diff](https://npm.io/package/json-diff.md) ^0.5.4
- [read-pkg-up](https://npm.io/package/read-pkg-up.md) ^7.0.1

## Recent versions

- 1.0.4 (latest) — 2021-02-01
- 1.0.3 — 2021-01-29
- 1.0.1 — 2021-01-29

## README

# lint-docs

A linter for our `package.json` files - part of [Hanno](https://hanno.co)'s standard project workflow. 

Since most of our client projects built to be handed over to a client's own engineering team once up and running, we aspire to make them as self-documenting as possible. This plugin helps us to enforce this quite opinionated approach and cuts down on the need to try and reverse engineer why a script or dependency was introduced.

Inside our `package.json` files, we require that all dependencies and scripts are documented via inside a corresponding `...Comments` object:

```
{
  "dependencies": {
     "some-dependency": "^4.3.8"
  },
  "dependenciesComments": {
     "some-dependency": "Here, we will explain what the dependency does on the current project so that it's easier for future maintainers to understand"
  }
}
```

By default, the fields to be linted are:

- `scripts`
- `dependencies`
- `devDependencies`
- `resolutions`

Any of these fields can be empty or non-existent. A field can be ignored as well - see [Usage](#Usage).

## Installation

To install the package locally:

```
yarn add -D @hannohealth/lint-docs
npm install --save-dev @hannohealth/lint-docs
```

## Usage

Lint your repository's `package.json` by running:

```
yarn run lint-docs
npm run lint-docs
```

To ignore specific fields (e.g. if you don't want to have to document your `scripts`), you can pass in the `ignoredFields` flag:

```
yarn run lint-docs --ignoredFields scripts
```

## Development

- Run `yarn start` to scan this module's own package.json.
- Run `yarn test` to run unit tests.

## License

MIT

---
_Source: https://npm.io/package/@hannohealth/lint-docs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
