Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

Latest commit

 

History

History
31 lines (21 loc) · 824 Bytes

simple-constant-quantifier.md

File metadata and controls

31 lines (21 loc) · 824 Bytes

simple-constant-quantifier 🔧

Prefer simple constant quantifiers over the range form.

configuration in plugin:clean-regex/recommended: "warn"

Source file
Test file

Description

This rule enforces the usage from simple constant quantifiers (e.g. a{2}) instead of their more verbose range form (e.g. a{2,2}).

Examples

Examples of valid code for this rule:

/a+b*c?/
/a{2,}b{2,6}c{2}/

Examples of invalid code for this rule:

/a{2,2}/
/a{100,100}?/