Skip to content

Conversation

@jamesbhobbs
Copy link
Contributor

@jamesbhobbs jamesbhobbs commented Oct 21, 2025

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/deepnote OSS repository to maintain consistency across Deepnote projects.

Changes

  • Added biome.json with formatter-only configuration:
    • 2-space indentation, 120 character line width
    • Single quotes, semicolons as needed
    • Respects .editorconfig files if present
    • Excludes package.json, coverage, and dist from formatting
    • JavaScript/TypeScript/HTML formatting rules

Review Checklist

  • Formatter settings - Verify the configuration matches project standards (particularly line width: 120, indent: 2 spaces, quotes: single)
  • Integration approach - Confirm that config-only (no package installation) is the desired approach vs. full Biome integration
  • Future steps - Consider if follow-up work is needed to:
    • Add Biome as devDependency
    • Update npm scripts to support Biome formatting
    • Document how developers can opt-in to using Biome

Notes

  • This PR intentionally does NOT install Biome as a dependency - developers who want to use Biome will need to install it separately
  • Existing Prettier + ESLint setup remains unchanged and will continue to be enforced by CI
  • The biome.json file was formatted with Prettier to pass existing CI checks

Link to Devin run: https://app.devin.ai/sessions/df9fb4f9ff664ab28848f60fedcb2877
Requested by: James Hobbs ([email protected]) / @jamesbhobbs

Summary by CodeRabbit

  • Chores
    • Updated project tooling configuration to standardize code formatting and linting standards across the codebase.

@devin-ai-integration
Copy link

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 21, 2025

📝 Walkthrough

Walkthrough

A new biome.json configuration file is added to define project-wide formatting and tooling settings. The file specifies formatter rules for indentation, line endings, and line width; configures VCS settings with Git integration; sets file inclusion/exclusion patterns; and establishes JavaScript and HTML formatting preferences including JSX quote style, trailing commas, semicolons, and self-closing void elements.

Possibly related PRs

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "chore: add biome formatter configuration" accurately and clearly describes the primary change: adding a biome.json configuration file to the repository. The title uses conventional commit format, is concise without vague terms or noise, and would give a teammate immediately useful context when scanning the git history. It appropriately matches the scope of the changeset, which is limited to introducing the configuration file itself.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71%. Comparing base (55d8454) to head (8a827b5).
⚠️ Report is 21 commits behind head on main.
✅ All tests successful. No failed tests found.

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:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 55d8454 and 8a827b5.

📒 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: false means Biome will attempt to process file types it may not recognize, potentially wasting cycles or causing errors. Confirm this is intentional; true is 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.

Comment on lines +1 to +33
{
"$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" } }
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

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.

⚠️ Potential issue | 🟠 Major

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.

⚠️ Potential issue | 🔴 Critical

🧩 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:

  1. Should Prettier be deprecated in favor of Biome?
  2. If both coexist, which formatter owns which file types?
  3. 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 -20

Length 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 -15

Length 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 -15

Length 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.

@jamesbhobbs
Copy link
Contributor Author

This was abandoned

@jamesbhobbs jamesbhobbs deleted the devin/1761062779-add-biome-formatter branch October 28, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants