A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://ota-meshi.github.io/eslint-plugin-regexp/rules/no-empty-alternative.html below:

Website Navigation


regexp/no-empty-alternative | eslint-plugin-regexp

regexp/no-empty-alternative

⚠️ This rule warns in the following configs: 🟢 flat/recommended, 🔵 recommended.

💡 This rule is manually fixable by editor suggestions.

disallow alternatives without elements

📖 Rule Details

While (re-)writing long regular expressions, it can happen that one forgets to remove the | character of a former alternative. This rule tries to point out these potential mistakes by reporting all empty alternatives.

If the empty alternative is supposed to match the empty string, then use a quantifier instead. For example, a| should be written as a?.

🔧 Options

Nothing.

❤️ Compatibility

This rule was taken from eslint-plugin-clean-regex.
This rule is compatible with clean-regex/no-empty-alternative rule.

🚀 Version

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

🔍 Implementation

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4