{"id":19915,"library":"eslint-plugin-regex","title":"eslint-plugin-regex","description":"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.","status":"active","version":"1.10.0","language":"javascript","source_language":"en","source_url":"https://github.com/gmullerb/eslint-plugin-regex","tags":["javascript","eslint-plugin-regex","eslint","regex-rule","regex","regexp","eslint-regex","eslint-rule","eslint-regex-rule"],"install":[{"cmd":"npm install eslint-plugin-regex","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-regex","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-regex","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: required to run the plugin","package":"eslint","optional":false}],"imports":[{"note":"This is an ESLint plugin, not a module. It is loaded via the 'plugins' field in .eslintrc.*","wrong":"import { regex } from 'eslint-plugin-regex'","symbol":"regex","correct":"/* no import needed; plugins are added via eslint config */"}],"quickstart":{"code":"// .eslintrc.json\n{\n  \"plugins\": [\"regex\"],\n  \"rules\": {\n    \"regex/invalid\": [\n      \"error\", [\n        \"console\\\\.log\",\n        \"debugger\"\n      ]\n    ],\n    \"regex/required\": [\n      \"error\", [\n        \"\\\\\"use strict\\\\\"\"\n      ]\n    ]\n  }\n}","lang":"javascript","description":"Shows how to configure eslint-plugin-regex to disallow console.log and debugger, and require 'use strict'."},"warnings":[{"fix":"Write patterns with both cases, e.g., /[Ff]oo/ or use (?i) syntax if supported by JS regex engine.","message":"Patterns are case-sensitive by default; no flag to make case-insensitive.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Prefix with npm scope, e.g., '@scope/eslint-plugin-regex' if needed.","message":"The 'regex' plugin name is taken, so you cannot use it alongside another plugin with the same name.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use a custom ESLint rule if function replacement is required.","message":"The 'replacement' option for regex/invalid only works with literal strings; cannot use functions.","severity":"gotcha","affected_versions":">=1.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 eslint-plugin-regex --save-dev' and ensure it is in node_modules.","cause":"Plugin not installed or eslint cannot resolve it.","error":"Error: Failed to load plugin 'regex': Cannot find module 'eslint-plugin-regex'"},{"fix":"Set config as [\"error\", [\"pattern\"]].","cause":"Rule config must be an array with severity and options.","error":"ESLint: Configuration for rule \"regex/invalid\" is invalid: value is not an array."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}