This rule validates the presence of a license header
This rule aims to support you by ensuring that all files in your project have a uniform license header.
Assuming the file ./resources/license-header.js
contains the following contents (whitespace around comment will be trimmed):
/**
* Copyright (c) Foo Corp.
*
* This source code is licensed under the WTFPL license found in the
* LICENSE file in the root of this projects source tree.
*/
Examples of incorrect code for this rule:
/** missing header */
module.exports = function hello() {
return 'hello';
};
/**
* Copyright (c) Foo Corp.
*
* This source code is licensed under the WTFPL license found in the
* LICENSE file in the root of this projects source tree.
*
* Modified header, incorrect spacing.
*/
module.exports = function hello() {
return 'hello';
};
Examples of correct code for this rule:
/**
* Copyright (c) Foo Corp.
*
* This source code is licensed under the WTFPL license found in the
* LICENSE file in the root of this projects source tree.
*/
module.exports = function hello() {
return 'hello';
};
The rule takes one option, the location of the license header template, relative to your cwd
.
"license-header/header": [ "error", "./resources/license-header.js" ]
If you do not want a unified license header to be present in all your source files.