Registry / testing / eslint-plugin-regexp

eslint-plugin-regexp

JSON →
library3.1.0jsnpmunverified

ESLint plugin for finding RegExp mistakes and enforcing style guide violations. Current stable version is v3.1.0 (requires ESLint >=9.38.0 and Node.js >=20.19.0). Released regularly with minor and patch updates. Key differentiators: 80+ rules covering regex syntax, optimization, and style; TypeScript type declarations included; supports ES2025 features like duplicate named capturing groups; provides recommended and all configs; exclusively supports ESLint Flat Config since v3.0.0 (drops Legacy Config).

npm install eslint-plugin-regexp
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-REGE
E
eslint-plugin-regexp
testingjavascriptv3.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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.

regexpPlugin (default)
import regexpPlugin from 'eslint-plugin-regexp'
const regexpPlugin = require('eslint-plugin-regexp')
ESM-only since v3.0.0; default export named 'regexp' but can be imported with any name.
configs (recommended)
regexpPlugin.configs.recommended
require('eslint-plugin-regexp').configs.recommended
Use within flat config array. Legacy .eslintrc configs dropped in v3.
rules
plugins: { regexp: regexpPlugin }, rules: { 'regexp/no-useless-escape': 'error' }
rules: { 'regexp/no-useless-escape': 'error' } without plugins
Plugin must be registered under 'plugins' key in flat config before using rules.

Setup ESLint flat config with recommended regexp rules and custom overrides.

// eslint.config.js import regexpPlugin from 'eslint-plugin-regexp'; export default [ regexpPlugin.configs.recommended, { rules: { 'regexp/prefer-regexp-exec': 'warn', 'regexp/no-useless-escape': 'error', }, }, ];
Debug
Known issues
breakingv3.0.0: Dropped support for ESLint v8 and Legacy Config (.eslintrc). Only Flat Config (eslint.config.js) is supported.
fix
Migrate to ESLint v9 and use eslint.config.js with import statement.
affects: >=3.0.0
gotchaThe 'all' config changes with every minor/major version. Not suitable for production.
fix
Use 'recommended' config for stable rule set.
affects: >=2.0.0
deprecatedv2.10.0: Deprecated old rule 'regexp/...' without explicit notice.
fix
Update to v3 and follow flat config patterns.
affects: >=2.10.0 <3.0.0
gotchaRule names must be prefixed with 'regexp/' in config, e.g., 'regexp/no-useless-escape'.
fix
Use full rule name including prefix.
affects: >=1.0.0
breakingv3.0.0: Minimum Node.js version bumped to 20.19.0, 22.13.0, or >=24.
fix
Update Node.js to supported version.
affects: >=3.0.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint-plugin-regexp'
Package not installed or incorrect import path.
fix
Run 'npm install --save-dev eslint-plugin-regexp' and ensure import path is correct.
Configuration for rule "regexp/..." is invalid: Value "error" is unexpected.
Rule name missing 'regexp/' prefix.
fix
Use full rule name like 'regexp/no-useless-escape'.
ESLint couldn't find the plugin "eslint-plugin-regexp".
Plugin not registered in flat config 'plugins' array.
fix
Add 'plugins: { regexp: regexpPlugin }' to your config object.
Upgrade
Version history
3.1.0latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required for plugin to function
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-regexp — npm install eslint-plugin-regexp · libregistry