JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 36997
  • Score
    100M100P100Q149684F
  • License MIT

Validates the presence of a license header

Package Exports

  • eslint-plugin-license-header
  • eslint-plugin-license-header/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-plugin-license-header) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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"
  ]
}

Header configuration

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

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

Alternatively, specify the license header as raw text:

{
  "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:

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

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

Autofix

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

eslint --fix .

Supported rules

License

MIT