Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eslint-plugin-license-header

nikku100.8kMIT0.6.1

Validates the presence of a license header

eslint, eslintplugin, eslint-plugin

readme

eslint-plugin-license-header

CI Code coverage

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

Installation

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:

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

Then configure the rules you want to use under the rules section.

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

You may auto-fix your source files, adding or updating a given license header:

eslint --fix .

Supported Rules

License

MIT

changelog

Changelog

All notable changes to eslint-plugin-license-header are documented here. We use semantic versioning for releases.

Unreleased

_Note: Yet to be released changes appear here._

0.6.1

  • FIX: play nicely with Svelte and Vue components (#16, #6)

0.6.0

  • FEAT: make ESLint@8 compatible

0.5.0

  • FEAT: add ability to provide header via configuration (#11)

0.4.0

  • FEAT: trim newline around parsed license (#8)

0.3.0

  • FEAT: mark rule as type=layout (#7)

0.2.1

  • CHORE: limit amout of published files

0.2.0

  • FEAT: completely replace whitespace only file contents when adding license
  • FEAT: report license errors on closed next sibling node (or program)
  • CHORE: retrieve leading comments in a eslint@6 compatible way

0.1.3

  • FIX: correct eslint@5+ error when checking empty files

0.1.2

  • FIX: check and add license using existing line separator (#1)

0.1.1

  • FIX: correct rules/header to properly handle replacement of outdated licenses

0.1.0

Initial implementation.