Skip to content

Latest commit

 

History

History
49 lines (32 loc) · 1.17 KB

use-ignore-case.md

File metadata and controls

49 lines (32 loc) · 1.17 KB
pageClass sidebarDepth title description since
rule-details
0
regexp/use-ignore-case
use the `i` flag if it simplifies the pattern
v1.4.0

regexp/use-ignore-case

💼 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

📖 Rule Details

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/;

🔧 Options

Nothing.

🚀 Version

This rule was introduced in eslint-plugin-regexp v1.4.0

🔍 Implementation