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: update @case-police-ignore regex #164

Merged
merged 5 commits into from
Nov 26, 2024
Merged

Conversation

OnkarRuikar
Copy link
Contributor

The regex needs to match multi-word terms.

I do not know what all the cases the (\S+) matches currently. So taking a safe bet to use the same in the new regex:

 `(\S+( \S+)?)`

@antfu antfu merged commit 3d1da98 into antfu:main Nov 26, 2024
@OnkarRuikar OnkarRuikar deleted the patch-1 branch November 26, 2024 07:21
@@ -11,7 +11,7 @@ export const DICT_FOLDER = dictDir
export const IGNORE_KEY = '@case-police-ignore'
export const DISABLE_KEY = '@case-police-disable'

export const IGNORE_REGEX = /@case-police-ignore\s+(\S+)/g
export const IGNORE_REGEX = /@case-police-ignore\s+(.*)/g
Copy link
Contributor Author

@OnkarRuikar OnkarRuikar Nov 26, 2024

Choose a reason for hiding this comment

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

@antfu This regex doesn't work with markdown comment <!-- @case-police-ignore App store -->. It matches App store --> and fails to ignore App store.

We need to find a better regex that would work with:

<!-- @case-police-ignore App store -->
<!-- @case-police-ignore App store,Github -->

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.

Can't inline ignore multi word case
2 participants