biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
https://biomejs.dev
Apache License 2.0
15.6k stars 486 forks source link

šŸ› Panic `byte index 6 is not a char boundary; it is inside '\u{96}' (bytes 5..7) of \u0E0Ā–` when linting js file #4587

Closed qarmin closed 1 week ago

qarmin commented 1 week ago

Environment information

CLI:
  Version:                      0.0.0 (self compiled d1ab6c54874d820be017d957c78808cbbd2333f7)
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           unset
  JS_RUNTIME_NAME:              unset
  NODE_PACKAGE_MANAGER:         unset

Biome Configuration:
  Status:                       unset

Workspace:
  Open Documents:               0

What happened?

File content(at the bottom should be attached raw, not formatted file - github removes some non-printable characters, so copying from here may not work):

/[\u0E0Ā–]

command

timeout -v 150 biome lint TEST___FILE.js

cause this

Biome encountered an unexpected error

This is a bug in Biome, not an error in your code, and we would appreciate it if you could report it to https://github.com/biomejs/biome/issues/ along with the following information to help us fixing the issue:

Source Location: crates/biome_js_analyze/src/lint/suspicious/no_misleading_character_class.rs:513:46
Thread Name: biome::worker_2
Message: byte index 6 is not a char boundary; it is inside '\u{96}' (bytes 5..7) of `\u0E0Ā–`

##### Automatic Fuzzer note, output status "None", output signal "Some(6)"

Expected result

No crash

Code of Conduct