Rule Proposal: require-unicode-regexp #9961
Labels
accepted
There is consensus among the team that this change meets the criteria for inclusion
archived due to age
This issue has been archived; please open a new issue for any further discussion
feature
This change adds a new feature to ESLint
rule
Relates to ESLint's core rules
Please describe what the rule should do:
This rule enforces people to use RegExp
u
flag.Because of Annex B.1.4 Regular Expressions Patterns, regular expressions have different between
u
flag or not. For example:This is similar to
"use strict"
.The
u
flag makes clearer syntax and helps to catch mistakes early.What category of rule is this? (place an "X" next to just one item)
[X] Enforces code style
[ ] Warns about a potential error
[ ] Suggests an alternate way of doing something
[ ] Other (please specify:)
Provide 2-3 code examples that this rule will warn about:
Why should this rule be included in ESLint (instead of a plugin)?
We have
strict
rule for"use strict"
.This rule is similar to the
strict
rule, disabling legacy syntax to catch mistakes early.The text was updated successfully, but these errors were encountered: