pageClass | sidebarDepth | title | description | since |
---|---|---|---|---|
rule-details |
0 |
regexp/use-ignore-case |
use the `i` flag if it simplifies the pattern |
v1.4.0 |
💼 This rule is enabled in the ✅ plugin:regexp/recommended
config.
🔧 This rule is automatically fixable by the --fix
CLI option.
use the
i
flag if it simplifies the pattern
This rule reports regular expressions that can be simplified by adding the i
flag.
/* eslint regexp/use-ignore-case: "error" */
/* ✓ GOOD */
var foo = /\w\d+a/;
var foo = /\b0x[a-fA-F0-9]+\b/;
/* ✗ BAD */
var foo = /[a-zA-Z]/;
var foo = /\b0[xX][a-fA-F0-9]+\b/;
Nothing.
This rule was introduced in eslint-plugin-regexp v1.4.0