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

Add suggestions for regexp/no-lazy-ends #624

Merged
merged 5 commits into from
Oct 1, 2023
Merged

Conversation

RunDevelopment
Copy link
Collaborator

I added 2 suggestions to every report:

  1. The first will transform the regex into what it is. E.g. /a+?/ -> /a/, because these 2 regexes are equivalent.
  2. The second will make the quantifier greedy. E.g. /a+?/ -> /a+/. I thought that this might be useful.

@changeset-bot
Copy link

changeset-bot bot commented Sep 26, 2023

🦋 Changeset detected

Latest commit: cb3c0b9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
eslint-plugin-regexp Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@RunDevelopment
Copy link
Collaborator Author

Okay, how should I fix this? Our tests seem to require that all messages end with a dot, but my suggestion messages end with a sentence in parentheses, so it ends with .).

@ota-meshi
Copy link
Owner

That message should be allowed, so I fixed the testcase for messages 😄

Copy link
Owner

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

@ota-meshi ota-meshi merged commit d690a91 into master Oct 1, 2023
5 checks passed
@ota-meshi ota-meshi deleted the no-lazy-ends-suggest branch October 1, 2023 08:09
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 this pull request may close these issues.

2 participants