Skip to content

Latest commit

 

History

History
49 lines (32 loc) · 1.1 KB

no-useless-range.md

File metadata and controls

49 lines (32 loc) · 1.1 KB
pageClass sidebarDepth title description since
rule-details
0
regexp/no-useless-range
disallow unnecessary character ranges
v0.3.0

regexp/no-useless-range

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

🔧 This rule is automatically fixable by the --fix CLI option.

disallow unnecessary character ranges

📖 Rule Details

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

/* eslint regexp/no-useless-range: "error" */

/* ✓ GOOD */
var foo = /[a]/
var foo = /[ab]/

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

🔧 Options

Nothing.

🚀 Version

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

🔍 Implementation