Skip to content

Latest commit

 

History

History
24 lines (12 loc) · 367 Bytes

optimize-regex.md

File metadata and controls

24 lines (12 loc) · 367 Bytes

Optimize regex literals (optimize-regex)

This rule enforces an idiomatic and sometimes clearer usage of regexes.

Rule Details

Examples of incorrect code for this rule:

const re = /[a-zA-Z_0-9][A-Z_\da-z]*\e{1,}/

Examples of correct code for this rule:

const re = /\w+e+/

The two regexes have the exact same functionality.