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

fix(linter): Don't check for multiple bits at once. #1688

Conversation

AndyA
Copy link
Contributor

@AndyA AndyA commented Dec 15, 2023

Fixes: #1687

The check

    if regexp_lit.regex.flags.contains(RegExpFlags::I | RegExpFlags::M) {
        return None;
    }

checks for both I and M being set. To catch them individually we need:

    if regexp_lit.regex.flags.contains(RegExpFlags::I) || regexp_lit.regex.flags.contains(RegExpFlags::M) {
        return None;
    }

Copy link
Collaborator

@camc314 camc314 left a comment

Choose a reason for hiding this comment

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

Thanks!

@camc314 camc314 enabled auto-merge (squash) December 15, 2023 13:18
@Dunqing Dunqing changed the title Don't check for multiple bits at once. fix(linter): Don't check for multiple bits at once. Dec 15, 2023
auto-merge was automatically disabled December 15, 2023 14:27

Head branch was pushed to by a user without write access

@Dunqing Dunqing enabled auto-merge (squash) December 15, 2023 14:28
auto-merge was automatically disabled December 15, 2023 14:29

Head branch was pushed to by a user without write access

@Dunqing
Copy link
Member

Dunqing commented Dec 15, 2023

Why does this PR contain an unrelated commit?

@camc314
Copy link
Collaborator

camc314 commented Dec 15, 2023

Why does this PR contain an unrelated commit?

Might Need rebasing?

@camc314 camc314 force-pushed the 1687-prefer-string-starts-ends-with-ignores-case branch from 0c51389 to 5ef2c43 Compare December 15, 2023 16:56
@camc314 camc314 enabled auto-merge (squash) December 15, 2023 16:56
@camc314 camc314 merged commit d101acf into oxc-project:main Dec 15, 2023
15 checks passed
Copy link

codspeed-hq bot commented Dec 15, 2023

CodSpeed Performance Report

Merging #1688 will improve performances by 5.22%

Comparing AndyA:1687-prefer-string-starts-ends-with-ignores-case (5ef2c43) with main (9f990ce)

Summary

⚡ 1 improvements
✅ 19 untouched benchmarks

Benchmarks breakdown

Benchmark main AndyA:1687-prefer-string-starts-ends-with-ignores-case Change
semantic[vue.js] 80.4 ms 76.4 ms +5.22%

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

Successfully merging this pull request may close these issues.

prefer-string-starts-ends-with ignores /i case insensitive modifier
3 participants