ESLint plugin that disallows potentially unsafe regular expressions. Version 1.0.0, stable. Uses the `safe-regex` library to detect regex patterns vulnerable to ReDoS attacks, such as nested quantifiers. Integrates as an ESLint plugin with a single rule `no-unsafe-regex/no-unsafe-regex`. Differentiates from other regex linting by focusing solely on security/performance, not style. Only validates regex literals and RegExp constructor with literal arguments. Regular maintenance, no known issues.
npm install eslint-plugin-no-unsafe-regexVerified import paths — ran on the pinned version, not inferred.
Configures ESLint to use the no-unsafe-regex plugin and enable its rule as an error.
Ensure that unsafe patterns are not built dynamically or manually review dynamic regex.
If a false positive is encountered, consider disabling the rule for that specific line using an ESLint comment.
Consider using eslint-plugin-security instead which also covers unsafe regex.
Run 'npm install safe-regex' or check node_modules.
Use 'no-unsafe-regex/no-unsafe-regex' and add 'no-unsafe-regex' to plugins.
Install via npm and use short name 'no-unsafe-regex' in plugins.