-
-
Notifications
You must be signed in to change notification settings - Fork 791
fix(core): parse astro script as TS #7878
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: 324fff3 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 |
WalkthroughThe change maps Astro HTML sources to a TypeScript/JS file source with an Astro embedding kind so Biome parses <script> tags in Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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). (8)
Comment |
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: 1
🧹 Nitpick comments (1)
.changeset/ten-hoops-unite.md (1)
5-5: Remove article "the" before "Biome"."Now Biome parses" reads better than "Now the Biome parses".
Apply this diff:
-Fixed [#7857](https://github.com/biomejs/biome/issues/7857). Now the Biome parses `<script>` tags as TypeScript when analysing a `.astro` file. +Fixed [#7857](https://github.com/biomejs/biome/issues/7857). Now Biome parses `<script>` tags as TypeScript when analysing a `.astro` file.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/format_astro_with_typescript_script_tag.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (3)
.changeset/ten-hoops-unite.md(1 hunks)crates/biome_cli/tests/cases/handle_astro_files.rs(2 hunks)crates/biome_service/src/file_handlers/html.rs(1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
crates/biome_*/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place core crates under /crates/biome_*/
Files:
crates/biome_cli/tests/cases/handle_astro_files.rscrates/biome_service/src/file_handlers/html.rs
**/tests/**
📄 CodeRabbit inference engine (CLAUDE.md)
Place test files under a tests/ directory in each crate
Files:
crates/biome_cli/tests/cases/handle_astro_files.rs
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Format Rust files before committing (e.g., viajust fwhich formats Rust)
Document rules, assists, and options with inline rustdoc in source
Files:
crates/biome_cli/tests/cases/handle_astro_files.rscrates/biome_service/src/file_handlers/html.rs
.changeset/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
.changeset/*.md: In changesets, only use #### or ##### headers; other header levels are not allowed
Changesets should cover user-facing changes only; internal changes do not need changesets
Use past tense for what you did and present tense for current Biome behavior in changesets
When fixing a bug in a changeset, start with an issue link (e.g., “Fixed #1234: …”)
When referencing a rule or assist in a changeset, include a link to its page on the website
Include code blocks in changesets when applicable to illustrate changes
End every sentence in a changeset with a period
Files:
.changeset/ten-hoops-unite.md
🧠 Learnings (1)
📚 Learning: 2025-10-15T09:22:46.002Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_formatter/CONTRIBUTING.md:0-0
Timestamp: 2025-10-15T09:22:46.002Z
Learning: Applies to crates/biome_js_formatter/**/*.rs : Import and use the `FormatNode` trait for AST nodes
Applied to files:
crates/biome_cli/tests/cases/handle_astro_files.rs
🧬 Code graph analysis (2)
crates/biome_cli/tests/cases/handle_astro_files.rs (2)
crates/biome_cli/tests/main.rs (1)
run_cli(332-347)crates/biome_cli/tests/snap_test.rs (1)
assert_cli_snapshot(407-409)
crates/biome_service/src/file_handlers/html.rs (2)
packages/@biomejs/backend-jsonrpc/src/workspace.ts (2)
JsFileSource(9483-9492)EmbeddingKind(9510-9510)crates/biome_js_syntax/src/file_source.rs (1)
ts(173-180)
🪛 LanguageTool
.changeset/ten-hoops-unite.md
[uncategorized] ~5-~5: Possible missing comma found.
Context: .../github.com//issues/7857). Now the Biome parses <script> tags as Typ...
(AI_HYDRA_LEO_MISSING_COMMA)
⏰ 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). (7)
- GitHub Check: Documentation
- GitHub Check: Check Dependencies
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: autofix
- GitHub Check: Test Node.js API
🔇 Additional comments (2)
crates/biome_service/src/file_handlers/html.rs (1)
491-492: LGTM!The logic correctly ensures all script tags in Astro files are parsed as TypeScript with the appropriate embedding kind, consistent with how Svelte and Vue are handled above.
crates/biome_cli/tests/cases/handle_astro_files.rs (1)
638-669: Test structure looks good.The test follows the established pattern and correctly validates formatting with the
--writeflag. However, see the concern about test content above.
13245d3 to
838a287
Compare
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: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
crates/biome_cli/tests/snapshots/main_cases_handle_astro_files/format_astro_with_typescript_script_tag.snapis excluded by!**/*.snapand included by**
📒 Files selected for processing (3)
.changeset/ten-hoops-unite.md(1 hunks)crates/biome_cli/tests/cases/handle_astro_files.rs(2 hunks)crates/biome_service/src/file_handlers/html.rs(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- crates/biome_service/src/file_handlers/html.rs
- crates/biome_cli/tests/cases/handle_astro_files.rs
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/*.md
📄 CodeRabbit inference engine (CONTRIBUTING.md)
.changeset/*.md: In changesets, only use #### or ##### headers; other header levels are not allowed
Changesets should cover user-facing changes only; internal changes do not need changesets
Use past tense for what you did and present tense for current Biome behavior in changesets
When fixing a bug in a changeset, start with an issue link (e.g., “Fixed #1234: …”)
When referencing a rule or assist in a changeset, include a link to its page on the website
Include code blocks in changesets when applicable to illustrate changes
End every sentence in a changeset with a period
Files:
.changeset/ten-hoops-unite.md
🪛 LanguageTool
.changeset/ten-hoops-unite.md
[uncategorized] ~5-~5: Possible missing comma found.
Context: .../github.com//issues/7857). Now the Biome parses <script> tags as Typ...
(AI_HYDRA_LEO_MISSING_COMMA)
⏰ 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 (depot-ubuntu-24.04-arm-16)
- GitHub Check: End-to-end tests
- GitHub Check: Documentation
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Check Dependencies
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Test Node.js API
- GitHub Check: autofix
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Summary
Closes #7857
The test case was generated with AI
Test Plan
Added one
Docs