pageClass | sidebarDepth | title | description | since |
---|---|---|---|---|
rule-details |
0 |
regexp/no-empty-group |
disallow empty group |
v0.1.0 |
💼 This rule is enabled in the ✅ plugin:regexp/recommended
config.
disallow empty group
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 = /(?:|)/;
Nothing.
This rule was introduced in eslint-plugin-regexp v0.1.0