Registry /
testing / eslint-plugin-literal-blacklist
An ESLint micro plugin (v1.2.0) that allows you to define a blacklist of strings (string or regex) or objects with custom messages and ignoreCase option in literal expressions. No recent updates, simple rule set. Differentiators: lightweight, supports regex and custom messages per rule, minimal configuration.
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.
The plugin registers as 'literal-blacklist' and the rule must be referenced as 'literal-blacklist/literal-blacklist'.
module.exports = {
plugins: ['literal-blacklist'],
rules: { 'literal-blacklist/literal-blacklist': [2, ['bad']] }
};
ESLint flat config requires plugins to be an object with custom namespace. The plugin exports a single object, not an array.
import literalBlacklist from 'eslint-plugin-literal-blacklist';
export default [
{
plugins: { 'literal-blacklist': literalBlacklist },
rules: { 'literal-blacklist/literal-blacklist': ['error', ['bad']] }
}
];
Both numeric (0,1,2) and string ('off','warn','error') severity levels work. Only 'error' (or 2) will block build.
"literal-blacklist/literal-blacklist": ["error", ["bad"]]
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 }
]]
}
};
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.