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
(v14): Make character class sorting in regex-shorthand
optional or at least documented
#453
Comments
regex-shorthand
optional or at least reported
regex-shorthand
optional or at least reportedregex-shorthand
optional or at least documented
We are using I guess we can document this. |
Yes, let's document it. |
@fisker : Thank you for the background info. I've filed DmitrySoshnikov/regexp-tree#199 in the hopes it may be possible to configure in the future. |
I agree that this is problematic. One part of it is that different languages sort characters in different ways. Eg. in Swedish I've now disabled this rule on our projects, which is a pity, because it has lots of other nice things to it than the sorting. |
May I suggest to disable character class sorting by default ? The optimisation seems unnecessary and it makes regexps less readable. |
Hi,
With the latest 14.0.0, I'm getting the following false positive for
regex-shorthand
(besides those reported).The rule is expecting sorting within character classes, though this is not advertised as being part of the rule in the docs. E.g.,
/#([^)'"]+)/
can be optimized to/#([^"')]+)/
. I think this should be either advertised as such, or, better yet, made into an option, since it is sometimes clearer to make one's own groupings without sorting, e.g.,[AaQqTt]
.Thanks!
The text was updated successfully, but these errors were encountered: