πŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more β†’

eslint-plugin-regexp

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
e

eslint-plugin-regexp

ESLint plugin for finding RegExp mistakes and RegExp style guide violations.

2.7.0
latest
99

Supply Chain Security

100

Vulnerability

100

Quality

81

Maintenance

100

License

Version published
Weekly downloads
573K
-12.81%
Maintainers
2
Weekly downloads
 
Created
Issues
19

What is eslint-plugin-regexp?

eslint-plugin-regexp is an ESLint plugin that provides linting rules for regular expressions. It helps developers write more efficient, readable, and secure regular expressions by catching common mistakes and suggesting improvements.

What are eslint-plugin-regexp's main functionalities?

No Unnecessary Escape

This rule disallows unnecessary escape characters in regular expressions. In the example, the backslash before the dot is unnecessary and should be removed.

/* eslint regexp/no-useless-escape: 'error' */
const regex = /\./;

No Obscure Character Class

This rule disallows obscure character class ranges that can be confusing or error-prone. In the example, the character class is clear and does not contain obscure ranges.

/* eslint regexp/no-obscure-range: 'error' */
const regex = /[a-zA-Z]/;

No Unnecessary Quantifier

This rule disallows unnecessary quantifiers in regular expressions. In the example, the quantifier {1} is unnecessary and should be removed.

/* eslint regexp/no-useless-quantifier: 'error' */
const regex = /a{1}/;

No Empty Character Class

This rule disallows empty character classes in regular expressions. In the example, the character class is empty and should be corrected.

/* eslint regexp/no-empty-character-class: 'error' */
const regex = /[]/;

Other packages similar to eslint-plugin-regexp

FAQs

Package last updated on 15 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts