Skip to content

Files

Latest commit

 

History

History
20 lines (14 loc) · 375 Bytes

use-ignore-case.md

File metadata and controls

20 lines (14 loc) · 375 Bytes

Pattern: Missing i flag where it would simplify pattern

Issue: -

Description

This rule reports regular expressions that can be simplified by adding the i flag.

Examples

/* eslint regexp/use-ignore-case: "error" */
/* ✓ GOOD */
var foo = /\w\d+a/;
var foo = /\b0x[a-f0-9]+\b/;

/* ✗ BAD */
var foo = /[a-zA-Z]/;
var foo = /\b0[xX][a-fA-F0-9]+\b/;