# eslint-plugin-license-header

> Validates the presence of a license header

Latest version **0.9.0** (published 2026-02-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-license-header
pnpm add eslint-plugin-license-header
yarn add eslint-plugin-license-header
bun add eslint-plugin-license-header
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities.

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

## Facts

| | |
|---|---|
| Version | 0.9.0 |
| Published | 2026-02-09 |
| First published | 2019-02-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 12.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 31 |
| Author | Nico Rehwaldt |
| Maintainers | nikku |
| Keywords | eslint, eslintplugin, eslint-plugin |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-license-header
- Repository: https://github.com/nikku/eslint-plugin-license-header
- Homepage: https://github.com/nikku/eslint-plugin-license-header#readme
- Issues: https://github.com/nikku/eslint-plugin-license-header/issues
- npm.io page: https://npm.io/package/eslint-plugin-license-header

## Dependencies (1)

- [requireindex](https://npm.io/package/requireindex.md) ^1.2.0

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 0.9.0 (latest) — 2026-02-09
- 0.8.0 — 2025-02-20
- 0.7.0 — 2025-02-16
- 0.6.1 — 2024-03-25
- 0.6.0 — 2022-06-23
- 0.5.0 — 2022-06-21
- 0.4.0 — 2022-01-13
- 0.3.0 — 2021-12-17
- 0.2.1 — 2021-09-15
- 0.2.0 — 2019-09-04
- 0.1.3 — 2019-09-04
- 0.1.2 — 2019-03-04
- 0.1.1 — 2019-02-20
- 0.1.0 — 2019-02-20

## README

# eslint-plugin-license-header

[![CI](https://github.com/nikku/eslint-plugin-license-header/actions/workflows/CI.yml/badge.svg)](https://github.com/nikku/eslint-plugin-license-header/actions/workflows/CI.yml)
[![Code coverage](https://img.shields.io/codecov/c/github/nikku/eslint-plugin-license-header.svg)](https://codecov.io/gh/nikku/eslint-plugin-license-header)

Rules to validate the presence of license headers in source files.

## Installation

```sh
npm install eslint-plugin-license-header --save-dev
```

## Usage

Add `license-header` to the plugins section of your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix:

```json
{
  "plugins": [
    "license-header"
  ]
}
```

### Header configuration

When enabling the rule specify the license header template as a path:

```json
{
  "rules": {
    "license-header/header": [ "error", "./resources/license-header.js" ]
  }
}
```

Alternatively, specify the license header as raw text:

```js
{
  "rules": {
    "license-header/header": [
      "error",
      [
          "/***********************************************",
          " * Copyright My Company",
          " * Copyright " + new Date().getFullYear(),
          " ***********************************************/",
      ]
    ]
  }
}
```

### Flat config

In `eslint@9` you can consume the library using a flat configuration, too:

```js
import licenseHeader from "eslint-plugin-license-header";

export default [
  {
    files: '**/*.js',
    plugins: {
      'license-header': licenseHeader
    },
    rules: {
      "license-header/header": ...
    }
  }
];
```

### Autofix

You may [auto-fix](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) your source files, adding or updating a given license header:

```sh
eslint --fix .
```

## Supported rules

* [`license-header/header`](./docs/rules/header.md): checks a source file for the presence of a license header

## License

[MIT](./LICENSE)

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