Registry /
testing / eslint-plugin-literal-blacklist
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.
default import of plugin
✓ module.exports = {
plugins: ['literal-blacklist'],
rules: { 'literal-blacklist/literal-blacklist': [2, ['bad']] }
};
✗ // Incorrect: missing quotes or wrong shape
module.exports = {
plugins: [literal-blacklist], // ReferenceError
rules: { 'literal-blacklist': [2, ['bad']] } // missing rule namespace
};
The plugin registers as 'literal-blacklist' and the rule must be referenced as 'literal-blacklist/literal-blacklist'.
Rules in flat config (ESLint 9+)
✓ import literalBlacklist from 'eslint-plugin-literal-blacklist';
export default [
{
plugins: { 'literal-blacklist': literalBlacklist },
rules: { 'literal-blacklist/literal-blacklist': ['error', ['bad']] }
}
];
✗ // Wrong: using plugins array instead of object
import literalBlacklist from 'eslint-plugin-literal-blacklist';
export default [
{ plugins: [literalBlacklist], rules: { ... } } // breaks ESLint 9+
];
ESLint flat config requires plugins to be an object with custom namespace. The plugin exports a single object, not an array.
Rule severity as string
✓ "literal-blacklist/literal-blacklist": ["error", ["bad"]]
✗ "literal-blacklist/literal-blacklist": [2, ["bad"]] // numeric severity works but string is preferred in modern ESLint
Both numeric (0,1,2) and string ('off','warn','error') severity levels work. Only 'error' (or 2) will block build.
Shows installation and ESLint rule configuration with string, regex, and object with custom message and ignoreCase.
// Install: npm install eslint-plugin-literal-blacklist --save-dev
// .eslintrc.js
module.exports = {
plugins: ['literal-blacklist'],
rules: {
'literal-blacklist/literal-blacklist': ['error', [
'badword',
/^secret_/,
{ term: 'password', message: 'Avoid using password literal', ignoreCase: true }
]]
}
};
Errors
Common errors & fixes
ESLintError: Failed to load plugin 'literal-blacklist': Cannot find module 'eslint-plugin-literal-blacklist'
Plugin not installed or installed as devDependency but not in right place.
fixRun `npm install eslint-plugin-literal-blacklist --save-dev` from project root.
Configuration for rule "literal-blacklist/literal-blacklist" is invalid: Severity should be one of the following: 0 = off, 1 = warn, 2 = error (you passed '"error"').
Using numeric severity as a string or vice versa in old ESLint versions.
fixUse integer severity: [2, ['bad']] or standard ESLint expects either 0/1/2 or 'off'/'warn'/'error'. Some config parsers may be picky. Try: ['error', ['bad']].
Error: Invalid term in literal-blacklist rule: expected a string or object with term property.
Passed something other than string, RegExp, or object.
fixEnsure each entry in the array is a string, a RegExp, or an object with a 'term' string property.
Audit
Dependencies
No dependency data recorded yet.