Skip to content

Improve regex in @commitlint/load #4114

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

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

filipw01
Copy link
Contributor

@filipw01 filipw01 commented Aug 6, 2024

Description

  1. Removed unnecessary case insensitivity flag
  2. Removed unnecessary capturing group
  3. Replaced String.match with RegExp.exec https://ota-meshi.github.io/eslint-plugin-regexp/rules/prefer-regexp-exec.html#regexp-prefer-regexp-exec

Motivation and Context

It slightly improves performance and removes redundancy

How Has This Been Tested?

It's a pretty local change, I just looked at it

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

codesandbox-ci bot commented Aug 6, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@filipw01 filipw01 changed the title Improve regex in plugin-naming.ts Improve regex in @commitlint/load Aug 6, 2024
@escapedcat
Copy link
Member

Thanks @filipw01 !

@escapedcat escapedcat merged commit 2fc6db1 into conventional-changelog:master Aug 7, 2024
7 checks passed
@escapedcat
Copy link
Member

Damn, need to adjust the commit title :P

escapedcat pushed a commit that referenced this pull request Aug 7, 2024
@filipw01 filipw01 deleted the patch-1 branch August 7, 2024 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants