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 regexp/simplify-set-operations rule #595

Merged
merged 16 commits into from
Oct 2, 2023

Conversation

ota-meshi
Copy link
Owner

close #574

I found a bug in regexpp while implementing this rule. We need to fix that first.

eslint-community/regexpp#136

If you have an idea for a better rule name, please let me know. I can rename the rule name.

@changeset-bot
Copy link

changeset-bot bot commented Sep 11, 2023

🦋 Changeset detected

Latest commit: efca081

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

@ota-meshi
Copy link
Owner Author

Now that regexpp has been fixed, I think it's ready for review.

@ota-meshi ota-meshi marked this pull request as ready for review September 12, 2023 01:26
@RunDevelopment
Copy link
Collaborator

Also, the code for getting escapes right when inlining character classes looks very complex. Maybe we could say that this rule only removes negations and doesn't inline character classes? E.g. [[^a][^b]] -> [^[a][b]]. We would leave the inlining to no-useless-character-class. What do you think?

@ota-meshi
Copy link
Owner Author

We would leave the inlining to no-useless-character-class. What do you think?

I think that's a good idea! I will change the rule.

@ota-meshi ota-meshi changed the title Add regexp/require-reduce-negation rule Add regexp/simplify-set-operations rule Oct 1, 2023
docs/rules/simplify-set-operations.md Outdated Show resolved Hide resolved
docs/rules/simplify-set-operations.md Outdated Show resolved Hide resolved
docs/rules/simplify-set-operations.md Outdated Show resolved Hide resolved
docs/rules/simplify-set-operations.md Outdated Show resolved Hide resolved
docs/rules/simplify-set-operations.md Outdated Show resolved Hide resolved
lib/rules/simplify-set-operations.ts Outdated Show resolved Hide resolved
lib/rules/simplify-set-operations.ts Outdated Show resolved Hide resolved
ota-meshi and others added 2 commits October 2, 2023 08:20
Co-authored-by: Michael Schmidt <mitchi5000.ms@googlemail.com>
Copy link
Collaborator

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

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

Thank you @ota-meshi!

@RunDevelopment RunDevelopment merged commit 8d2fd5d into master Oct 2, 2023
5 checks passed
@RunDevelopment RunDevelopment deleted the require-reduce-negation branch October 2, 2023 10:42
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.

Simplify nested characters classes and expression character classes
2 participants