- Error
- Reported by the lexer and parser
TS1502
The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously.
A regular expression literal has both the `u` and `v` flags. Keep one; `v` includes everything `u` does.
What it means
The v (Unicode Sets) flag is an extended form of u, and the two can't be set together.
Example
export const re = /[a-z]/uv;
ts-r-check -p tsconfig.json --pretty false ts-r outputindex.ts(1,27): error TS1502: The Unicode (u) flag and the Unicode Sets (v) flag cannot be set simultaneously.
Recorded by node scripts/verify-examples.mjs with ts-r built from commit 6deaf01. The example uses the default tsconfig: strict, target: es2022, module: esnext, moduleResolution: bundler.
How to fix
- Use
valone if you need set operations, otherwiseualone.