You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It may be useful to be able to force the disjunction of string literals to use only strings that humans recognize as single characters.
Description
It is possible to use strings of two or more characters in the disjunction of string literals, but normal disjunction is also possible. (However, there are differences in the evaluation order.)
Forcing a single character to be used in the disjunction of string literals allows people to distinguish between uses.
I think it is better to implement the rule by using Intl.Segmenter and allowing it if it is recognized as one grapheme.
Examples
/* ✓ GOOD */varfoo=/[\p{RGI_Emoji}--\q{🇦🇨|🇦🇩|🇦🇪|🇦🇫|🇦🇬|🇦🇮|🇦🇱|🇦🇲|🇦🇴|🇦🇶|🇦🇷|🇦🇸|🇦🇹|🇦🇺|🇦🇼|🇦🇽|🇦🇿|🇧🇦|🇧🇧|🇧🇩|🇧🇪|🇧🇫|🇧🇬|🇧🇭|🇧🇮|🇧🇯}]/v/* ✗ BAD */varfoo=/[\q{abc|def}]/v
The text was updated successfully, but these errors were encountered:
Motivation
It may be useful to be able to force the disjunction of string literals to use only strings that humans recognize as single characters.
Description
It is possible to use strings of two or more characters in the disjunction of string literals, but normal disjunction is also possible. (However, there are differences in the evaluation order.)
Forcing a single character to be used in the disjunction of string literals allows people to distinguish between uses.
I think it is better to implement the rule by using
Intl.Segmenter
and allowing it if it is recognized as one grapheme.Examples
The text was updated successfully, but these errors were encountered: