pageClass | sidebarDepth | title | description | since |
---|---|---|---|---|
rule-details |
0 |
regexp/no-useless-range |
disallow unnecessary character ranges |
v0.3.0 |
💼 This rule is enabled in the ✅ plugin:regexp/recommended
config.
🔧 This rule is automatically fixable by the --fix
CLI option.
disallow unnecessary character ranges
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]/
Nothing.
This rule was introduced in eslint-plugin-regexp v0.3.0