Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
plugin
✓ const plugin = require('eslint-plugin-notice');
✗ import plugin from 'eslint-plugin-notice';
Package does not provide ESM exports; use CommonJS require().
rules['notice/notice']
✓ module.exports = { plugins: ['notice'], rules: { 'notice/notice': ['error', { ... }] } };
✗ module.exports = { rules: { 'notice/notice': ... } };
Must register the plugin (via 'plugins' key) before using the rule.
options.template
✓ const options = { template: 'Copyright (c) {{year}} {{author}}' };
✗ const options = { template: 'Copyright (c) 2022 My Company' };
Template supports {{year}} and {{author}} placeholders. Do not hardcode year as it won't update automatically.
Configures the plugin to enforce a copyright notice header using a template with placeholders for year and author.
// .eslintrc.js
module.exports = {
plugins: ['notice'],
rules: {
'notice/notice': ['error', {
template: '/* Copyright (c) {{year}} {{author}} */\n',
authors: ['John Doe'],
onNonMatchingHeader: 'prepend', // or 'replace', 'report'
var: { year: new Date().getFullYear().toString() }
}]
}
};
Errors
Common errors & fixes
Definition for rule 'notice/notice' was not found
The plugin is not registered in the ESLint config.
fixAdd 'plugins: ["notice"]' to your .eslintrc.
Cannot find module 'eslint-plugin-notice'
Package is not installed or missing from node_modules.
fixRun 'npm install eslint-plugin-notice --save-dev'.
Invalid option 'nonMatchingTolerance' for rule notice/notice
Misspelled or deprecated option name; use 'onNonMatchingHeader'.
fixReplace 'nonMatchingTolerance' with 'onNonMatchingHeader' in rule options.
Audit
Dependencies
eslintrequiredpeer dependency; the plugin requires ESLint >= 3.0.0 to run