Skip to content

Conversation

@RunDevelopment
Copy link
Collaborator

Resolves #581.

The implementation of the rule is fairly simple right now. It just goes through all elements of an alternative and tries to find the pattern (?=a)b or a(?<=b). So it won't attempt to do clever things like assertions reordering (e.g. (?!a)(?=bcd)e == (?=bcd)(?!a)e == (?=bcd)[e--a]) and partial application (e.g. (?!a|bcd)e == (?!bcd)(?!a)e == (?!bcd)[e--a]). I think it should be okay. Adjacent assertions are rare in practice, and partial application has the issue that it might make the intent of the author less clear.

@changeset-bot
Copy link

changeset-bot bot commented Sep 24, 2023

🦋 Changeset detected

Latest commit: 47bcc63

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 Major

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

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

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.

Use expression character class instead of lookaround

3 participants