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 support for v flag to regexp/negation rule #560

Merged
merged 5 commits into from
Sep 14, 2023

Conversation

ota-meshi
Copy link
Owner

related to #545

@changeset-bot
Copy link

changeset-bot bot commented Aug 16, 2023

🦋 Changeset detected

Latest commit: 27f8c28

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

Relevant: https://bugs.chromium.org/p/chromium/issues/detail?id=1474268

@ota-meshi ota-meshi marked this pull request as ready for review September 8, 2023 00:23
@ota-meshi
Copy link
Owner Author

Thank you for sharing the link, and making some fixes!
It looks like the Chrome bug you shared hasn't been fixed yet, but I think that ready to review this rule.

@RunDevelopment
Copy link
Collaborator

The fix for the bug has been merged yesterday and will be part of Chrome 118. 118 will only be released starting on Oct 10 though, so it will take some time until we see the fix. But that's fine, we can release the rule.

Comment on lines 66 to 69
// since we know that the property doesn't contain strings,
// we can just get the characters of the character class
// without worrying about the strings
const ccSet = toUnicodeSet(ccNode, flags).chars
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would like to get rid of the .chars here. The reasoning explained in the comment isn't trivial, so I would like to simplify it to the code I suggested.

Unfortunately, we can't compare a UnicodeSet to a CharSet right now, but I'm currently working on that. I'm currently working on a patch for refa and RAA which will include some fixes + more ergonomics for UnicodeSets. So my suggested code will work then.

Suggested change
// since we know that the property doesn't contain strings,
// we can just get the characters of the character class
// without worrying about the strings
const ccSet = toUnicodeSet(ccNode, flags).chars
const ccSet = toUnicodeSet(ccNode, flags)

@RunDevelopment RunDevelopment merged commit fb75351 into master Sep 14, 2023
5 checks passed
@RunDevelopment RunDevelopment deleted the negation-with-v-flag branch September 14, 2023 10:37
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.

None yet

2 participants