Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New rule: Disallow characters which are made with multiple code points in character class syntax (no-misleading-character-class) #1311

Closed
feross opened this issue Jul 5, 2019 · 1 comment

Comments

@feross
Copy link
Member

feross commented Jul 5, 2019

https://eslint.org/docs/rules/no-misleading-character-class

This prevents a really tricky Unicode regex edge case that always results in a bug. Let's include it in standard 13. Part of the eslint recommended set.

0% ecosystem impact, so it's a no brainer.

@joshgoebel
Copy link

joshgoebel commented Dec 11, 2020

Is there some other name I could google to read up more on this I'm really failing to understand this rule.

> /[\u0300–\u036F]/u.exec("\u0302")
null
> /[\u2020–\u2027]/u.exec("\u2026")
null

The linter will flag the former, but not the latter, yet neither seem to work as I'd hope. So I'm wondering if there are some cases this rule doesn't catch but are also problematic?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

No branches or pull requests

2 participants