Registry / testing / eslint-plugin-regex

eslint-plugin-regex

JSON →
library1.10.0jsnpmunverified

ESLint plugin that provides custom rules using regular expressions, allowing developers to quickly define custom lint rules without writing full ESLint rules. Version 1.10.0, actively maintained. Key differentiator: enables inline regex-based checks (invalid/required patterns) with rich options (file filters, auto-fix for invalid, custom messages). No TypeScript support. Minimal learning curve.

testingdevops
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
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

This is an ESLint plugin, not a module. It is loaded via the 'plugins' field in .eslintrc.*

/* no import needed; plugins are added via eslint config */

Shows how to configure eslint-plugin-regex to disallow console.log and debugger, and require 'use strict'.

// .eslintrc.json { "plugins": ["regex"], "rules": { "regex/invalid": [ "error", [ "console\\.log", "debugger" ] ], "regex/required": [ "error", [ "\\"use strict\\"" ] ] } }
Debug
Known footguns
gotchaPatterns are case-sensitive by default; no flag to make case-insensitive.
gotchaThe 'regex' plugin name is taken, so you cannot use it alongside another plugin with the same name.
gotchaThe 'replacement' option for regex/invalid only works with literal strings; cannot use functions.
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.

Agent activity
9 hits · last 30 days
gptbot
4
ahrefsbot
4
script
1
Resources