{"id":19916,"library":"eslint-plugin-regexp","title":"eslint-plugin-regexp","description":"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).","status":"active","version":"3.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/ota-meshi/eslint-plugin-regexp","tags":["javascript","eslint","eslintplugin","eslint-plugin","regexp","regex","typescript"],"install":[{"cmd":"npm install eslint-plugin-regexp","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-regexp","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-regexp","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for plugin to function","package":"eslint","optional":false}],"imports":[{"note":"ESM-only since v3.0.0; default export named 'regexp' but can be imported with any name.","wrong":"const regexpPlugin = require('eslint-plugin-regexp')","symbol":"regexpPlugin (default)","correct":"import regexpPlugin from 'eslint-plugin-regexp'"},{"note":"Use within flat config array. Legacy .eslintrc configs dropped in v3.","wrong":"require('eslint-plugin-regexp').configs.recommended","symbol":"configs (recommended)","correct":"regexpPlugin.configs.recommended"},{"note":"Plugin must be registered under 'plugins' key in flat config before using rules.","wrong":"rules: { 'regexp/no-useless-escape': 'error' } without plugins","symbol":"rules","correct":"plugins: { regexp: regexpPlugin }, rules: { 'regexp/no-useless-escape': 'error' }"}],"quickstart":{"code":"// eslint.config.js\nimport regexpPlugin from 'eslint-plugin-regexp';\n\nexport default [\n  regexpPlugin.configs.recommended,\n  {\n    rules: {\n      'regexp/prefer-regexp-exec': 'warn',\n      'regexp/no-useless-escape': 'error',\n    },\n  },\n];","lang":"javascript","description":"Setup ESLint flat config with recommended regexp rules and custom overrides."},"warnings":[{"fix":"Migrate to ESLint v9 and use eslint.config.js with import statement.","message":"v3.0.0: Dropped support for ESLint v8 and Legacy Config (.eslintrc). Only Flat Config (eslint.config.js) is supported.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use 'recommended' config for stable rule set.","message":"The 'all' config changes with every minor/major version. Not suitable for production.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Update to v3 and follow flat config patterns.","message":"v2.10.0: Deprecated old rule 'regexp/...' without explicit notice.","severity":"deprecated","affected_versions":">=2.10.0 <3.0.0"},{"fix":"Use full rule name including prefix.","message":"Rule names must be prefixed with 'regexp/' in config, e.g., 'regexp/no-useless-escape'.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Update Node.js to supported version.","message":"v3.0.0: Minimum Node.js version bumped to 20.19.0, 22.13.0, or >=24.","severity":"breaking","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install --save-dev eslint-plugin-regexp' and ensure import path is correct.","cause":"Package not installed or incorrect import path.","error":"Error: Cannot find module 'eslint-plugin-regexp'"},{"fix":"Use full rule name like 'regexp/no-useless-escape'.","cause":"Rule name missing 'regexp/' prefix.","error":"Configuration for rule \"regexp/...\" is invalid: Value \"error\" is unexpected."},{"fix":"Add 'plugins: { regexp: regexpPlugin }' to your config object.","cause":"Plugin not registered in flat config 'plugins' array.","error":"ESLint couldn't find the plugin \"eslint-plugin-regexp\"."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}