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

Rename regex-shorthand rule? #469

Closed
fisker opened this issue Dec 3, 2019 · 8 comments · Fixed by #522
Closed

Rename regex-shorthand rule? #469

fisker opened this issue Dec 3, 2019 · 8 comments · Fixed by #522

Comments

@fisker
Copy link
Collaborator

fisker commented Dec 3, 2019

regex-shorthand do more than just shorthand now, should we rename it?
also no-unsafe-regex is buggy and already off by default, and I looked around, didn't found a better solution, maybe we can remove it, if we found a better way to do it, maybe we can add a option to regex-shorthand rule.

@fisker fisker changed the title Rename regex-shorthand? Rename regex-shorthand rule? Dec 3, 2019
@sindresorhus
Copy link
Owner

Some name suggestions:

  • better-regex
  • improved-regex
  • optimized-regex

@yakov116
Copy link
Contributor

yakov116 commented Dec 6, 2019

Optimized-regex

@fisker
Copy link
Collaborator Author

fisker commented Dec 21, 2019

for now optimized-regex sounds reasonable, if we try combine no-unsafe-regex with this one later, I perfer better-regex

@sindresorhus
Copy link
Owner

Let's go with better-regex.

@fisker
Copy link
Collaborator Author

fisker commented Feb 11, 2020

Need a better rule description

Enforce the use of regex shorthands to improve readability (old)

and error message

Use regex shorthands to improve readability. (old)

@sindresorhus
Copy link
Owner

Let's first summarize what the rule does now:

  • Enforces shorthands readability
  • Sorts character classes for consistency
  • What else?

@fisker
Copy link
Collaborator Author

fisker commented Feb 12, 2020

@sindresorhus
Copy link
Owner

We don't need to mention all of those though. We can link to it in the docs.

So in summary:

  • Enforces shorthands readability
  • Sorts character classes for consistency
  • Makes regexes safer

So for description, maybe:

Improve regexes by making them shorter, consistent, and safer.

As for the error message, that really depends on the transformation being done though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants