# eslint-plugin-hash-exempt

> ESlint rules to require/verify file hashes for disable directives

Latest version **1.0.1** (published 2018-08-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-hash-exempt
pnpm add eslint-plugin-hash-exempt
yarn add eslint-plugin-hash-exempt
bun add eslint-plugin-hash-exempt
```

Provides the command `hash-exempt`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-08-29 |
| First published | 2018-08-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 0 |
| Unpacked size | 30.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Christopher Karper |
| Maintainers | ckarper |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-hash-exempt
- Repository: https://github.com/ckarper/eslint-plugin-hash-exempt
- Homepage: https://github.com/ckarper/eslint-plugin-hash-exempt#readme
- Issues: https://github.com/ckarper/eslint-plugin-hash-exempt/issues
- npm.io page: https://npm.io/package/eslint-plugin-hash-exempt

## Recent versions

- 1.0.1 (latest) — 2018-08-29
- 1.0.0 — 2018-08-29

## README

# eslint-plugin-hash-exempt

This plugin supports exempting a file from linting based on a hash of its contents.  This is useful
for legacy code, or in cases where you may want to apply conflicting eslint standards to files from
a scaffold or generator.

> You break it, you buy it.

Once the content of the file changes, the exemption is invalidated.  The hash will have to be
updated, or the file corrected to current eslint standards.  This can allow organizations to
progressively update files without forcing a wholesale refactoring.

## Installation

```sh
npm install --save-dev eslint-plugin-hash-exempt
```

** Note:** If you want to install ESLint globally, then the plugin must also be installed globally.

## Usage

The rule to verify hashes is on by default. You may add further configuration in your 
.eslintrc.(yml|json|js):

```yaml
---
plugins:
  - hash-exempt

rules:
  hash-exempt/no-hash-mismatch: [error, { hashRequired: true }]
  # etc...
```

### Options
* **`hashRequired`**: If this is `false`, only files that have a directive with hash will be
verified. If it's `true`, any files with a directive at the top will require a hash.  This is
`false` by default.

## Hash Creation

In order to insert hashed eslint directives in your files, run the command `hash-exempt` in your
folder.

```sh
hash-exempt [--exempt-all] *.js
```

By default, `hash-exempt` will only insert directives into files that are currently failing lint.

### Flags
* **`--exempt-all`**: Insert a hashed eslint directive in all files matching the supplied glob,
regardless of whether or not they contain lint errors.

---
_Source: https://npm.io/package/eslint-plugin-hash-exempt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
