Skip to content

Commit acfac68

Browse files
committed
refactor(oxlint): adjust ignore patterns by counting bytes instead of chars (#12209)
`split_at` accepts the offset by bytes. Could not create a test where the chars vs bytes could matter: https://github.com/oxc-project/oxc/blob/29516454d52d2197f9332b39162d27c913f31af6/apps/oxlint/src/lint.rs#L1026-L1039
1 parent 2951645 commit acfac68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/oxlint/src/lint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ impl LintRunner {
532532
ignore_patterns
533533
.into_iter()
534534
.map(|pattern| {
535-
let prefix_len = pattern.chars().take_while(|&c| c == '!').count();
535+
let prefix_len = pattern.bytes().take_while(|&c| c == b'!').count();
536536
let (prefix, pattern) = pattern.split_at(prefix_len);
537537

538538
let adjusted_path = relative_ignore_path.join(pattern);

0 commit comments

Comments
 (0)