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
I am willing to submit a pull request to implement this rule.
Additional comments
The Zero-Width Joiner (\u200d) is a valid identifier character, even though some parsers like the ones used by typescript or Webpack fail to parse correctly.
Cyrillic characters in the example code is one case of confusable unicode character with latin character, but there are a lot of other possibilities, including confusion between non-latin characters. Unicode defines an algorithm to compute the skeleton of text, which we could apply to identifiers, and base the comparison on the skeleton instead of the identifier string.
Rule details
Compute the Unicode skeleton of declared identifiers and disallow if similar to an identifier already in scope
Related CVE
CVE-2021-42694
Example code
Participation
Additional comments
The Zero-Width Joiner (
\u200d
) is a valid identifier character, even though some parsers like the ones used by typescript or Webpack fail to parse correctly.Cyrillic characters in the example code is one case of confusable unicode character with latin character, but there are a lot of other possibilities, including confusion between non-latin characters. Unicode defines an algorithm to compute the skeleton of text, which we could apply to identifiers, and base the comparison on the skeleton instead of the identifier string.
First reported in eslint/eslint#15240 (comment)
The text was updated successfully, but these errors were encountered: