TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

Provide User-Friendly Message for Extended Unicode Escapes in Regular Expressions in Non-Unicode Modes

Open graphemecluster opened this issue 1 year ago • 1 comments

This replaces the error message of /\u{10000}/ from Hexadecimal digit expected. to Unicode escape sequences are only available when the Unicode (u) flag or the Unicode Sets (v) flag is set. (message analogous to TS1530), as @k1tikurisu pointed out in his article [in Japanese] that it’s hard to understand the intention of the message.

graphemecluster avatar Jun 23 '24 21:06 graphemecluster

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

typescript-bot avatar Jun 23 '24 21:06 typescript-bot

I’ve reordered the commits and let the checks perform both before and after your suggested change to ensure everything works as expected. (But I don‘t understand why there’s an unrelated assertion error before the rerun.)

graphemecluster avatar Jul 17 '24 21:07 graphemecluster