-
-
Notifications
You must be signed in to change notification settings - Fork 720
fix(formatter): patch ID_Continue to omit U+30FB and U+FF65 added in Unicode 15.1 #7350
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
Conversation
🦋 Changeset detectedLatest commit: 35a3e23 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughAdds a patch changeset for @biomejs/biome documenting a bug fix: U+30FB (KATAKANA MIDDLE DOT) and U+FF65 (HALFWIDTH KATAKANA MIDDLE DOT) are no longer treated as JS identifier-continue characters, so property keys containing them are preserved as string literals. Adds a formatter test with such keys and updates is_js_id_continue in biome_unicode_table to explicitly reject those two code points. No public APIs changed. Suggested labels
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
.changeset/clever-worlds-heal.md (1)
5-5
: Tighten wording and make JS scope explicit; add example per guidelines.Minor grammar, explicit “JavaScript identifier-continue”, and clearer behaviour statement.
Apply this diff to reword the description:
-Fixed [#7261](https://github.com/biomejs/biome/issues/7261): two characters `・` (KATAKANA MIDDLE DOT, U+30FB) and `・` (HALFWIDTH KATAKANA MIDDLE DOT, U+FF65) are no longer considered as valid characters. A string literal property key including these character(s) is now preserved as-is. +Fixed [#7261](https://github.com/biomejs/biome/issues/7261). Do not treat U+30FB (KATAKANA MIDDLE DOT, `・`) and U+FF65 (HALFWIDTH KATAKANA MIDDLE DOT, `・`) as JavaScript identifier-continue characters. Property keys containing these characters are preserved as string literals.Suggested representative example for the changeset body (not a diff):
// Input ({ "実用文・会話文": "長文読解" }); // Output (unchanged) ({ "実用文・会話文": "長文読解" });crates/biome_unicode_table/src/lib.rs (2)
68-70
: Prefer code point match to avoid look‑alike glyph confusion.Sticks with the file’s existing
matches!
style and is crystal clear in reviewers’ editors.- if c == '・' || c == '・' { - return false; - } + if matches!(c as u32, 0x30FB | 0xFF65) { + return false; + }
63-73
: Add a focused unit test in this crate.A tiny crate-level test will catch regressions even if formatter behaviour changes.
Proposed test file (crates/biome_unicode_table/tests/js_id_continue.rs):
use biome_unicode_table::is_js_id_continue; #[test] fn rejects_katakana_middle_dot_variants() { assert!(!is_js_id_continue('・')); // U+30FB assert!(!is_js_id_continue('・')); // U+FF65 } #[test] fn still_allows_common_continue_chars() { assert!(is_js_id_continue('0')); assert!(is_js_id_continue('_')); assert!(is_js_id_continue('$')); }crates/biome_js_formatter/tests/specs/js/module/object/property_key.js (1)
8-10
: Also cover the HALFWIDTH variant (U+FF65).You cover U+30FB; add U+FF65 to lock both down.
// https://github.com/biomejs/biome/issues/7261 "実用文・会話文": "長文読解", + // Also cover U+FF65 HALFWIDTH KATAKANA MIDDLE DOT. + "実用文・会話文": "長文読解",
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
crates/biome_js_formatter/tests/specs/js/module/object/property_key.js.snap
is excluded by!**/*.snap
and included by**
📒 Files selected for processing (3)
.changeset/clever-worlds-heal.md
(1 hunks)crates/biome_js_formatter/tests/specs/js/module/object/property_key.js
(1 hunks)crates/biome_unicode_table/src/lib.rs
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
.changeset/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
.changeset/*.md
: Create changesets withjust new-changeset
; store them in.changeset/
with correct frontmatter (package keys and change type).
In changeset descriptions, follow content conventions: user-facing changes only; past tense for what you did; present tense for current behavior; link issues for fixes; link rules/assists; include representative code blocks; end every sentence with a period.
When adding headers in a changeset, only use #### or ##### levels.
Files:
.changeset/clever-worlds-heal.md
crates/biome_*_{syntax,parser,formatter,analyze,factory,semantic}/**
📄 CodeRabbit inference engine (CLAUDE.md)
Maintain the per-language crate structure: biome_{lang}_{syntax,parser,formatter,analyze,factory,semantic}
Files:
crates/biome_js_formatter/tests/specs/js/module/object/property_key.js
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_js_formatter/tests/specs/js/module/object/property_key.js
crates/biome_unicode_table/src/lib.rs
**/tests/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place test files under a tests/ directory in each crate
Files:
crates/biome_js_formatter/tests/specs/js/module/object/property_key.js
**/*.{rs,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Format Rust and TOML files before committing (use
just f
/just format
).
Files:
crates/biome_unicode_table/src/lib.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
- GitHub Check: Test Node.js API
- GitHub Check: autofix
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: End-to-end tests
- GitHub Check: Check Dependencies
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Documentation
🔇 Additional comments (2)
.changeset/clever-worlds-heal.md (1)
1-3
: Frontmatter looks correct.Package and bump type are properly declared.
crates/biome_unicode_table/src/lib.rs (1)
64-71
: Good defensive guard against Unicode 15.1 drift.Early-returning for U+30FB and U+FF65 keeps behaviour aligned with ECMAScript regardless of ID_Continue updates.
Summary
These two characters have been added to the
ID_Continue
property in Unicode 15.1, but they're not supported in ECMAScript. To avoid an syntax error, Biome will omit these on checking if a character is inID_Continue
.・
・
Test Plan
Added a snapshot test.
Docs
N/A