-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
bug(linter): some text in js file cause panic (byte index 8 is not a char boundary) #1671
Comments
run with thread '<unnamed>' panicked at crates/oxc_linter/src/rules/unicorn/escape_case.rs:67:45:
byte index 55 is not a char boundary; it is inside '交' (bytes 54..57) of `'\x1B[41;37mpackage.json文件没有改动,禁止提交package-lock.json \x1B[0m'`
stack backtrace:
0: 0x1005e447c - __mh_execute_header
1: 0x10037dfec - __mh_execute_header
2: 0x1005c3650 - __mh_execute_header
3: 0x1005e7ce8 - __mh_execute_header
4: 0x1005e7910 - __mh_execute_header
5: 0x1005e87d8 - __mh_execute_header
6: 0x1005e8370 - __mh_execute_header
7: 0x1005e82dc - __mh_execute_header
8: 0x1005e82d0 - __mh_execute_header
9: 0x10064432c - __mh_execute_header
10: 0x10038344c - __mh_execute_header
11: 0x1006447e4 - __mh_execute_header
12: 0x1004469ac - __mh_execute_header
13: 0x100485618 - __mh_execute_header
14: 0x100464948 - __mh_execute_header
15: 0x10046104c - __mh_execute_header
16: 0x100461240 - __mh_execute_header
17: 0x10045eeac - __mh_execute_header
18: 0x100461240 - __mh_execute_header
19: 0x10045eeac - __mh_execute_header
20: 0x100461240 - __mh_execute_header
21: 0x10045eeac - __mh_execute_header
22: 0x100461240 - __mh_execute_header
23: 0x10045eeac - __mh_execute_header
24: 0x1003df664 - __mh_execute_header
25: 0x100658744 - __mh_execute_header
26: 0x1005153ec - __mh_execute_header
27: 0x1005150e4 - __mh_execute_header
28: 0x1005e9a6c - __mh_execute_header
29: 0x185f65034 - __pthread_joiner_wake |
Marking as good first issue for anyone who wants to write this using proper Rust iterators, probably with oxc/crates/oxc_linter/src/rules/unicorn/escape_case.rs Lines 55 to 63 in d719af4
|
I should use index in bytes instead of in char, just calculate it in another variable. |
Do you wanna give it a try and fix the panic? |
a js file contains line
console.error('\x1B[41;37mpackage.json文件没有改动,禁止提交package-lock.json \x1B[0m');
, the file is utf-8 and has ANSI escape sequences and zh-cn characters.when execute the oxlint command:
it panic with message:
oxlint version is
0.0.20
The text was updated successfully, but these errors were encountered: