Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 985 Bytes

no-empty-group.md

File metadata and controls

51 lines (35 loc) · 985 Bytes
pageClass sidebarDepth title description since
rule-details
0
regexp/no-empty-group
disallow empty group
v0.1.0

regexp/no-empty-group

💼 This rule is enabled in the ✅ plugin:regexp/recommended config.

disallow empty group

📖 Rule Details

This rule reports empty groups.

/* eslint regexp/no-empty-group: "error" */

/* ✓ GOOD */
var foo = /(a)/;
var foo = /(?:a)/;

/* ✗ BAD */
// capturing group
var foo = /()/;
var foo = /(|)/;
// non-capturing group
var foo = /(?:)/;
var foo = /(?:|)/;

🔧 Options

Nothing.

🚀 Version

This rule was introduced in eslint-plugin-regexp v0.1.0

🔍 Implementation