-
Notifications
You must be signed in to change notification settings - Fork 2
chore: use biome for astro #1070
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
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughRestores a top-level Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
💤 Files with no reviewable changes (2)
🧰 Additional context used📓 Path-based instructions (1)biome.json📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
🧠 Learnings (13)📓 Common learnings📚 Learning: 2025-09-27T11:50:55.637ZApplied to files:
📚 Learning: 2025-09-27T11:50:55.637ZApplied to files:
📚 Learning: 2025-09-27T11:50:55.637ZApplied to files:
📚 Learning: 2025-09-27T11:50:55.637ZApplied to files:
📚 Learning: 2025-09-27T11:50:55.637ZApplied to files:
📚 Learning: 2025-09-27T11:50:55.637ZApplied to files:
📚 Learning: 2025-09-27T11:50:55.637ZApplied to files:
📚 Learning: 2025-09-27T11:50:55.637ZApplied to files:
📚 Learning: 2025-09-27T11:50:55.637ZApplied to files:
📚 Learning: 2025-09-27T11:50:55.637ZApplied to files:
📚 Learning: 2025-09-27T11:50:55.637ZApplied to files:
📚 Learning: 2025-09-27T11:50:55.637ZApplied to files:
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @Omochice, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request transitions the project's code formatting and linting for Astro files from Prettier to Biome. By leveraging Biome's newly introduced support for Astro, the change aims to streamline the development workflow, consolidate tooling, and remove redundant configurations and dependencies previously used for Prettier. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Pull Request Overview
This PR migrates from Prettier to Biome for formatting Astro files, taking advantage of Biome v2.3's new Astro support. The change consolidates formatting tools by removing Prettier dependencies and configuration while extending Biome's configuration to handle Astro files.
Key changes:
- Removed Prettier and prettier-plugin-astro dependencies
- Deleted prettier.config.ts configuration file
- Updated biome.json with comprehensive formatting rules for JavaScript, HTML, and Astro files
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| prettier.config.ts | Removed entire Prettier configuration file as it's no longer needed |
| package.json | Removed Prettier dependencies and related npm scripts for checking/formatting Astro files |
| biome.json | Expanded configuration with detailed formatter settings, JavaScript/HTML rules, and Astro file overrides |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
| "useSingleVarDeclarator": "error" | ||
| } | ||
| }, | ||
| "includes": ["**", "!**/*.astro"] |
Copilot
AI
Oct 28, 2025
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.
Astro files are excluded from linting (line 41) but included in the overrides section (line 61). This configuration is contradictory - if Astro files should be formatted but not linted, this should be documented, otherwise the exclusion should be removed.
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.
Code Review
This pull request migrates the project from Prettier to Biome for formatting and linting Astro files. The changes to package.json and the removal of Prettier's configuration are correct. However, the new biome.json configuration contains a few issues that need to be addressed for Biome to work correctly with Astro files. I've left specific comments on the biome.json file with suggestions for fixes.
| "useSingleVarDeclarator": "error" | ||
| } | ||
| }, | ||
| "includes": ["**", "!**/*.astro"] |
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.
The linter is configured to ignore .astro files with !**/*.astro. This contradicts the goal of this pull request, which is to use Biome for Astro files. To enable linting for .astro files, you should remove this exclusion. The overrides section will then correctly apply Astro-specific parsing.
| "includes": ["**", "!**/*.astro"] | |
| "includes": ["**"] |
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.
currently, the check raises
╰─→ $ pnpm biome check --reporter summary
reporter/violations ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Some lint rules or assist actions reported some violations.
ℹ The following files have violations:
- src/components/BaseHead.astro (5 warnings)
- src/components/Footer.astro (3 warnings)
- src/components/FormattedDate.astro (3 warnings)
- src/components/Header.astro (4 warnings)
- src/components/HeaderLink.astro (4 warnings)
- src/components/LinkToGitHub.astro (2 warnings)
- src/components/OldPostWarning.astro (4 warnings)
- src/components/PostLists.astro (5 warnings)
- src/layouts/BaseLayout.astro (6 warnings)
- src/layouts/BlogPost.astro (8 warnings)
- src/pages/index.astro (2 warnings)
- src/pages/posts/[...slug].astro (4 warnings)
- src/pages/posts/index.astro (2 warnings)
ℹ The following lint rules have violations:
Rule Name Diagnostics
lint/correctness/noUnusedVariables 30 (30 warnings)
lint/correctness/noUnusedImports 22 (22 warnings)
Checked 28 files in 8ms. No fixes applied.
Found 52 warnings.
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: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (3)
biome.json(1 hunks)package.json(0 hunks)prettier.config.ts(0 hunks)
💤 Files with no reviewable changes (2)
- package.json
- prettier.config.ts
🧰 Additional context used
📓 Path-based instructions (1)
biome.json
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
biome.json defines JS/TS linting and formatting rules and must be kept in sync with project standards
Files:
biome.json
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: Omochice/blog#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-27T11:50:55.637Z
Learning: Applies to biome.json : biome.json defines JS/TS linting and formatting rules and must be kept in sync with project standards
📚 Learning: 2025-09-27T11:50:55.637Z
Learnt from: CR
PR: Omochice/blog#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-27T11:50:55.637Z
Learning: Applies to biome.json : biome.json defines JS/TS linting and formatting rules and must be kept in sync with project standards
Applied to files:
biome.json
🔇 Additional comments (3)
biome.json (3)
8-22: Files configuration and formatter options look good.The
files.includesapplies to all of Biome's tools, and excluding onlypackage.jsonis a sensible default. Formatter settings are appropriate for a Prettier migration.
24-42: Linter configuration aligns with Biome v2.3 Astro support.Biome v2.3 supports Astro files out of the box for formatting and linting HTML, CSS and JavaScript parts. Excluding
.astrofrom the main linter while keeping formatter enabled is a reasonable interim approach while Astro support is still experimental. The added linter rules are sensible style checks.
43-58: Language-specific formatter configurations are well-structured.The JavaScript and HTML formatter options follow standard conventions and are appropriate for a Prettier→Biome migration. Settings like
indentScriptAndStyle: falsematch Prettier defaults.
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
♻️ Duplicate comments (2)
biome.json (2)
60-60: Critical:"enabled": nullis not valid Biome syntax.The
assist.enabledfield only accepts boolean values (trueorfalse), notnull. Change this line to a valid boolean value based on whether you intend to enable or disable Biome's code assist features."assist": { - "enabled": null, + "enabled": true, "actions": { "source": { "organizeImports": "on" } } }
41-41: Critical: Linter excludes.astrofiles, contradicting the PR objective.Line 41 configures the linter to exclude Astro files with
!**/*.astro, but the PR objective is to "use biome for astro." This contradicts enabling Biome formatting and linting for Astro files now that Biome v2.3 supports them.Either:
- Remove the
.astroexclusion to enable linting for Astro files (recommended given the PR goal), or- Document why Astro files should be formatted but not linted.
If you choose to include Astro files in linting, consider adding an
overridessection with Astro-specific parser configuration."linter": { "enabled": true, "rules": { ... }, - "includes": ["**", "!**/*.astro"] + "includes": ["**"] }
🧹 Nitpick comments (1)
biome.json (1)
8-10: Consider explicitly ignoring.astro/build directory.The
files.includessetting at line 9 is["**", "!**/package.json"]. While.gitignoremay be respected (viavcs.useIgnoreFile: true), consider explicitly excluding the.astro/directory (build artifacts and cache) to prevent accidental formatting or linting of generated files."files": { - "includes": ["**", "!**/package.json"] + "includes": ["**", "!**/package.json", "!**/.astro"] }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
biome.json(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
biome.json
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
biome.json defines JS/TS linting and formatting rules and must be kept in sync with project standards
Files:
biome.json
🧠 Learnings (10)
📓 Common learnings
Learnt from: CR
PR: Omochice/blog#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-27T11:50:55.637Z
Learning: Applies to biome.json : biome.json defines JS/TS linting and formatting rules and must be kept in sync with project standards
📚 Learning: 2025-09-27T11:50:55.637Z
Learnt from: CR
PR: Omochice/blog#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-27T11:50:55.637Z
Learning: Applies to biome.json : biome.json defines JS/TS linting and formatting rules and must be kept in sync with project standards
Applied to files:
biome.json
📚 Learning: 2025-09-27T11:50:55.637Z
Learnt from: CR
PR: Omochice/blog#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-27T11:50:55.637Z
Learning: Applies to **/*.astro : Prettier formatting must pass for .astro files
Applied to files:
biome.json
📚 Learning: 2025-09-27T11:50:55.637Z
Learnt from: CR
PR: Omochice/blog#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-27T11:50:55.637Z
Learning: Applies to **/*.astro : Stylelint must pass for styles embedded in .astro files
Applied to files:
biome.json
📚 Learning: 2025-09-27T11:50:55.637Z
Learnt from: CR
PR: Omochice/blog#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-27T11:50:55.637Z
Learning: Applies to stylelint.config.ts : stylelint.config.ts must define CSS linting for styles and .astro files
Applied to files:
biome.json
📚 Learning: 2025-09-27T11:50:55.637Z
Learnt from: CR
PR: Omochice/blog#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-27T11:50:55.637Z
Learning: Applies to **/*.astro : Markuplint HTML validation must pass for .astro files
Applied to files:
biome.json
📚 Learning: 2025-09-27T11:50:55.637Z
Learnt from: CR
PR: Omochice/blog#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-27T11:50:55.637Z
Learning: Applies to markuplint.config.ts : markuplint.config.ts configures HTML validation rules for .astro files
Applied to files:
biome.json
📚 Learning: 2025-09-27T11:50:55.637Z
Learnt from: CR
PR: Omochice/blog#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-27T11:50:55.637Z
Learning: Applies to **/*.astro : Run Astro type checking on all .astro files
Applied to files:
biome.json
📚 Learning: 2025-09-27T11:50:55.637Z
Learnt from: CR
PR: Omochice/blog#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-27T11:50:55.637Z
Learning: Applies to src/**/*.{ts,tsx} : Biome linting must pass for TypeScript source files
Applied to files:
biome.json
📚 Learning: 2025-09-27T11:50:55.637Z
Learnt from: CR
PR: Omochice/blog#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-27T11:50:55.637Z
Learning: Applies to src/{components,layouts,pages}/**/*.astro : Astro components, layouts, and pages should be implemented as .astro files in their respective directories
Applied to files:
biome.json
biome v2.3 supports astro
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
biome v2.3 supports astro
Summary by CodeRabbit