Skip to content

Files

Latest commit

 

History

History
20 lines (14 loc) · 295 Bytes

no-useless-range.md

File metadata and controls

20 lines (14 loc) · 295 Bytes

Pattern: Unnecessary character range

Issue: -

Description

This rule reports unnecessary character ranges. E.g. [a-a].

Examples

/* eslint regexp/no-useless-range: "error" */
/* ✓ GOOD */
var foo = /[a]/
var foo = /[ab]/

/* ✗ BAD */
var foo = /[a-a]/
var foo = /[a-b]/