Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-regexp

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-regexp

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

  • 0.2.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

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

Keywords

FAQs

Package last updated on 27 Feb 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc