-
Notifications
You must be signed in to change notification settings - Fork 4
chore: add biome formatter configuration #106
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
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
⚙️ Control Options:
|
📝 WalkthroughWalkthroughA new Possibly related PRs
Pre-merge checks✅ Passed checks (3 passed)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #106 +/- ##
=====================================
Coverage 71% 71%
=====================================
Files 527 527
Lines 39474 39474
Branches 4933 4933
=====================================
Hits 28277 28277
Misses 9563 9563
Partials 1634 1634 🚀 New features to boost your workflow:
|
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: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
biome.json(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: FilipPyrek
PR: deepnote/deepnote#18531
File: biome.json:58-58
Timestamp: 2025-09-25T14:43:13.976Z
Learning: Biome is a JavaScript/TypeScript linter and formatter that doesn't process .proto files, so Protocol Buffer source files don't need to be explicitly ignored in biome.json configuration.
Learnt from: CR
PR: deepnote/deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-14T13:43:36.364Z
Learning: Applies to **/*.{ts,tsx} : Follow Biome's lint rules as configured in biome.json
📚 Learning: 2025-09-25T14:43:13.976Z
Learnt from: FilipPyrek
PR: deepnote/deepnote#18531
File: biome.json:58-58
Timestamp: 2025-09-25T14:43:13.976Z
Learning: Biome is a JavaScript/TypeScript linter and formatter that doesn't process .proto files, so Protocol Buffer source files don't need to be explicitly ignored in biome.json configuration.
Applied to files:
biome.json
📚 Learning: 2025-10-14T13:43:36.364Z
Learnt from: CR
PR: deepnote/deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-14T13:43:36.364Z
Learning: Applies to **/*.{ts,tsx} : Follow Biome's lint rules as configured in biome.json
Applied to files:
biome.json
⏰ 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). (3)
- GitHub Check: Build & Test
- GitHub Check: Lint & Format
- GitHub Check: Build & Package Extension
🔇 Additional comments (2)
biome.json (2)
4-4: Minor: verify ignoreUnknown setting.Setting
ignoreUnknown: falsemeans Biome will attempt to process file types it may not recognize, potentially wasting cycles or causing errors. Confirm this is intentional;trueis often safer as a default.
1-33: Biome config added but unenforced—needs CI integration or removal.Verification confirms the concern. Biome has no npm script and isn't validated in CI (which only runs Prettier). With Prettier still active, reformatting conflicts are real. Either add
npm run format:biome+ CI validation, migrate away from Prettier entirely, or drop the biome.json.
| { | ||
| "$schema": "https://biomejs.dev/schemas/2.2.5/schema.json", | ||
| "vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true }, | ||
| "files": { "ignoreUnknown": false }, | ||
| "formatter": { | ||
| "enabled": true, | ||
| "formatWithErrors": false, | ||
| "indentStyle": "space", | ||
| "indentWidth": 2, | ||
| "lineEnding": "lf", | ||
| "lineWidth": 120, | ||
| "attributePosition": "auto", | ||
| "bracketSameLine": false, | ||
| "bracketSpacing": true, | ||
| "expand": "auto", | ||
| "useEditorconfig": true, | ||
| "includes": ["**", "!./coverage", "!./dist", "!**/package.json"] | ||
| }, | ||
| "javascript": { | ||
| "formatter": { | ||
| "jsxQuoteStyle": "single", | ||
| "quoteProperties": "preserve", | ||
| "trailingCommas": "es5", | ||
| "semicolons": "asNeeded", | ||
| "arrowParentheses": "asNeeded", | ||
| "bracketSameLine": false, | ||
| "quoteStyle": "single", | ||
| "attributePosition": "auto", | ||
| "bracketSpacing": true | ||
| } | ||
| }, | ||
| "html": { "formatter": { "selfCloseVoidElements": "always" } } | ||
| } |
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.
Biome configuration added but blocker: tool not installed in package.json.
The config file is inert without @biomejs/biome in package.json and a lint/format script in package.json.
Add the Biome package to package.json (install section) and configure scripts:
{
"devDependencies": {
"@biomejs/biome": "^1.9.0"
},
"scripts": {
"format": "biome format --write .",
"format:check": "biome format --check .",
"lint": "biome lint .",
"lint:fix": "biome lint --fix ."
}
}🤖 Prompt for AI Agents
In biome.json lines 1-33: Biome was added but package.json lacks the Biome
dependency and scripts, so add @biomejs/biome to devDependencies (e.g., ^1.9.0)
and add scripts "format", "format:check", "lint", and "lint:fix" mapping to
biome format/lint commands (format --write ., format --check ., lint ., lint
--fix .); update package.json accordingly and run your package manager install
to ensure the tool is available.
Missing documentation: add Biome setup and migration guidance.
Update README.md and/or CONTRIBUTING.md with:
- How to set up and run Biome locally.
- IDE integration instructions (e.g., VSCode Biome extension).
- Migration guide if replacing Prettier.
- When/where Biome formatting is applied (CI, pre-commit hooks, editor, etc.).
🤖 Prompt for AI Agents
In biome.json (lines 1-33) the repository adds Biome configuration but lacks
documentation; update README.md and/or CONTRIBUTING.md to include concise setup
and migration instructions: describe how to install and run Biome locally (CLI
install or dev dependency, common commands), IDE/editor integration steps (e.g.,
enable Biome extension and recommended settings for VSCode), a brief migration
guide for teams replacing Prettier (key config differences and a checklist to
run and verify formatting), and where formatting is enforced (CI workflow names,
pre-commit hook config, and editor format-on-save guidance) so contributors know
when and how formatting will be applied.
🧩 Analysis chain
Conflict with existing .prettierrc.js: clarify migration strategy.
The repo already uses Prettier. Running both formatters concurrently risks conflicting rewrites and developer confusion. Decisions needed:
- Should Prettier be deprecated in favor of Biome?
- If both coexist, which formatter owns which file types?
- Are there configuration differences (semicolons, quote style, trailing commas, etc.) that will cause large diffs or inconsistency?
Update .prettierrc.js or remove it, and document the migration plan in README.md / CONTRIBUTING.md.
I need to verify the concerns raised about the Prettier/Biome conflict. Let me examine the repository structure.
🏁 Script executed:
#!/bin/bash
# Check for .prettierrc.js and related Prettier config files
fd -t f '\.(prettierrc|prettierignore)' --extension js --extension json --extension yaml --extension yml
# Check package.json for Prettier and Biome configuration
cat package.json 2>/dev/null | head -50
# Look for any Prettier config in package.json
grep -A 20 '"prettier"' package.json 2>/dev/null
# Check for husky/pre-commit hooks
fd -t f 'husky' '\.husky'
# Check README and CONTRIBUTING for migration guidance
grep -i 'prettier\|biome\|format\|migration' README.md CONTRIBUTING.md 2>/dev/null | head -20Length of output: 2609
🏁 Script executed:
#!/bin/bash
# Find Prettier config files
find . -maxdepth 2 -type f \( -name ".prettierrc*" -o -name "prettier.config.*" \) 2>/dev/null
# Examine package.json for formatter dependencies and scripts
cat package.json 2>/dev/null
# Check for git hooks or scripts that might run formatters
ls -la .git/hooks 2>/dev/null || echo "No .git/hooks found"
# Look for docs mentioning formatters
grep -r "prettier\|biome" README.md CONTRIBUTING.md 2>/dev/null | head -15Length of output: 110428
🏁 Script executed:
#!/bin/bash
# View .prettierrc.js content
cat .prettierrc.js
# Check for CI/workflow files that might run formatters
find .github -name "*.yml" -o -name "*.yaml" 2>/dev/null | head -5
# Check if there's a .husky directory with pre-commit hooks
find . -path '*/.husky/*' -type f 2>/dev/null
# Look for any biome or prettier mentions in CI files
grep -r "prettier\|biome\|format" .github 2>/dev/null | head -10
# Check README for any formatter setup instructions
head -100 README.md | grep -i "setup\|format\|prettier"Length of output: 5470
🏁 Script executed:
#!/bin/bash
# View .prettierrc.js content
cat .prettierrc.js
# Check for CI/workflow files
ls -la .github/workflows/ 2>/dev/null | head -20
# Check for husky hooks
find . -path './.husky' -type d 2>/dev/null
# Search CI files for formatter commands
grep -r "prettier\|biome\|format" .github/workflows/ 2>/dev/null | head -15Length of output: 1141
Address formatter conflict before merging: both Prettier and Biome are configured with conflicting rules.
Prettier and Biome have incompatible settings:
- Indent width: Prettier 4 spaces vs Biome 2 spaces
- Trailing commas: Prettier 'none' vs Biome 'es5'
- Semicolons: Prettier implicit vs Biome 'asNeeded'
Currently only Prettier runs in CI (lint-staged pre-commit and npm run format). Adding biome.json without integrating it into CI or removing Prettier will cause conflicting rewrites.
Decide: migrate to Biome (remove .prettierrc.js and wire Biome into CI/lint-staged), or don't add biome.json yet. Document the choice in CONTRIBUTING.md.
🤖 Prompt for AI Agents
biome.json lines 1-33: this new Biome config conflicts with existing Prettier
(indentWidth 2 vs 4, trailingCommas es5 vs none, semicolons asNeeded vs
Prettier's setting) and Biome is not wired into CI/lint-staged; choose one of
two fixes: (A) migrate fully to Biome — remove .prettierrc.js, update
package.json scripts and lint-staged to run biome format/lint in CI and
pre-commit, adjust biome.json to the team’s canonical rules, and add a
CONTRIBUTING.md note describing the Biome workflow; or (B) defer adding Biome —
delete biome.json from the PR (or revert it) and keep Prettier as single source
of truth, documenting that decision in CONTRIBUTING.md; implement whichever
choice so only one formatter runs in CI to avoid conflicting rewrites.
|
This was abandoned |
Summary
Adds Biome formatter configuration file to enable opt-in usage of Biome as an alternative to Prettier. This is a configuration-only change that does not install Biome as a dependency or integrate it into the build process.
Configuration copied from
deepnote/deepnoteOSS repository to maintain consistency across Deepnote projects.Changes
biome.jsonwith formatter-only configuration:.editorconfigfiles if presentpackage.json,coverage, anddistfrom formattingReview Checklist
Notes
biome.jsonfile was formatted with Prettier to pass existing CI checksLink to Devin run: https://app.devin.ai/sessions/df9fb4f9ff664ab28848f60fedcb2877
Requested by: James Hobbs ([email protected]) / @jamesbhobbs
Summary by CodeRabbit