-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Information:
- ESLint version: 9.21.0
eslint-plugin-regexp
version: 2.7.0
See https://github.com/fabian-hiller/valibot/blob/main/library/package.json and https://github.com/fabian-hiller/valibot/blob/main/pnpm-lock.yaml
Description
When both i
and u
flags are set, \w
matches U+017F & U+212A, too. This plugin must not emit prefer-w on just [0-9a-z_]
under that condition.
const ex1 = /^[0-9A-Z_]+$/iu;
const ex2 = /^\w+$/iu;
const str = "\u017f\u212a";
// ESLint expected: true / actual: false
console.log(ex1.test(str) === ex2.test(str));
If the regex is Unicode-aware and the i flag is set, it also matches other Unicode characters that get canonicalized to one of the characters above through case folding.
↑This makes U+017F and U+212A matches \w
in iu
flag.
fisker
Metadata
Metadata
Assignees
Labels
No labels