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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ npx case-police "**/*.md" path/to/file.html

### Ignores

You can add `@case-police-disable` in your file to disable the case check for the particular file, or add `@case-police-ignore xxx` to ignore certain words in that file.
You can add `@case-police-disable` in your file to disable the case check for the particular file, or add `@case-police-ignore xxx` to ignore certain words in that file (use comma to separate mutliple words).

For example:

Expand Down
2 changes: 1 addition & 1 deletion packages/case-police/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->


export const UTF8_RANGE = '[\u0080-\uFFFF]'

Expand Down