Skip to content

Conversation

@jamesbhobbs
Copy link
Contributor

@jamesbhobbs jamesbhobbs commented Oct 14, 2025

Fixes GRN-4939

Summary

Syncs Biome and Prettier configurations from deepnote/deepnote to establish consistent linting/formatting tooling. This PR adds the configuration infrastructure only—the codebase has not been reformatted yet.

Changes

Configuration Files

  • Added biome.json: Complete Biome configuration copied from deepnote/deepnote

    • 2-space indentation, 120 char line width
    • Comprehensive lint rules (a11y, complexity, correctness, performance, security, style, suspicious)
    • Auto-organize imports enabled
  • Updated .prettierrc.js:

    • Changed tabWidth: 4 → 2 (to match biome)
    • Changed trailingComma: 'none' → 'es5' (to match biome)
    • Removed datascience/serviceRegistry.ts override (biome handles it now)

Dependencies

  • Added @biomejs/biome: 2.2.5 to devDependencies

Scripts

  • biome:check / biome:check:fix - Run biome linter/formatter
  • lintAndFormat / lintAndFormat:fix - Combined biome + prettier checks
  • prettier / prettier:check - Prettier for markdown/YAML only

Pre-commit Hooks (lint-staged)

Breaking change: Replaced ESLint-based config with Biome

  • Before: eslint --cache --fix + prettier --write on src/**/*.{ts,tsx}
  • After: biome check --write on **/*.{ts,tsx,html,json,jsonc} + prettier --write on **/*.{md,yml,yaml} + sort .gitignore
  • Note: Adapted from deepnote/deepnote which uses pnpm exec; this repo uses npm so that prefix was removed

CI

  • Consolidated separate ESLint and Prettier steps into single npm run lintAndFormat command

⚠️ Important Notes

This PR will cause CI to fail - Biome will detect formatting violations in the existing codebase. This is expected and intentional.

Follow-up required: The codebase needs to be reformatted with npm run lintAndFormat:fix either:

  • In this PR (additional commits), or
  • In a follow-up PR

Formatting impact when applied:

  • 4-space indentation → 2-space indentation across all TS/JS files
  • No trailing commas → ES5 trailing commas
  • Other biome formatting rules

Review Checklist

  • Verify biome.json matches deepnote/deepnote exactly
  • Confirm the lint-staged npm adaptation is appropriate (vs pnpm in source repo)
  • Acknowledge CI will fail until reformatting is applied
  • Verify all new scripts are correctly configured
  • Decide: reformat in this PR or separately?

Session: https://app.devin.ai/sessions/c6d9ca47685f4ef39b76448d22a60e3f
Requested by: James Hobbs (@jamesbhobbs)

Summary by CodeRabbit

  • Style

    • Standardized code style: 2-space indentation and ES5 trailing commas; unified formatting rules across the project.
    • Removed an oversized override and aligned formatting preferences.
    • Automatic import organization enabled.
  • Chores

    • Adopted unified linting/formatting tooling with a new project config.
    • Added scripts for linting/formatting checks and fixes.
    • Enabled pre-commit checks and consolidated CI to run a single combined lint/format step.

- Copy biome.json configuration for TypeScript/JavaScript linting and formatting
- Update .prettierrc.js to only handle markdown and YAML files
- Add @biomejs/biome, update lint-staged, husky, and prettier versions
- Add biome:check, biome:check:fix, lintAndFormat, and prettier scripts
- Add lint-staged configuration for automated pre-commit formatting
- Update CI workflow to use new lintAndFormat command

This migrates the linting/formatting setup to match the main deepnote/deepnote repository,
using Biome for JS/TS files and Prettier only for markdown and YAML files.

Related to: GRN-4939
@linear
Copy link

linear bot commented Oct 14, 2025

@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 14, 2025

📝 Walkthrough

Walkthrough

  • CI (.github/workflows/ci.yml): Consolidates separate ESLint and Prettier steps into a single step running npm run lintAndFormat.
  • Prettier (.prettierrc.js): Changes tabWidth from 4 to 2, trailingComma from none to es5, and removes the override for **/datascience/serviceRegistry.ts; other overrides unchanged.
  • Biome (biome.json): Adds Biome configuration enabling the formatter and linter, sets formatter preferences, include/exclude globs, multiple lint rule sets and severities, and assist.organizeImports.
  • package.json: Adds scripts (biome:check, biome:check:fix, lintAndFormat, lintAndFormat:fix, prettier, prettier:check), wire-up for Biome/Prettier, adds @biomejs/biome devDependency, and updates lint-staged entries (Biome for TS/TSX/HTML/JSON/JSONC, Prettier for MD/YML/YAML, plus .gitignore sorter).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant GH as GitHub Actions
  participant NPM as npm
  participant Biome as Biome
  participant Prettier as Prettier

  Dev->>GH: push / open PR
  GH->>GH: run CI
  GH->>NPM: run "npm run lintAndFormat"  %%#orange
  alt lintAndFormat invokes biome then prettier
    NPM->>Biome: run biome checks & format
    NPM->>Prettier: run prettier checks (configured targets)
  end
  alt any check fails
    NPM-->>GH: exit non-zero
    GH-->>Dev: CI fails
  else all pass
    NPM-->>GH: exit 0
    GH-->>Dev: CI passes
  end
Loading
sequenceDiagram
  autonumber
  actor Dev as Developer
  participant Husky as Husky (pre-commit)
  participant LS as lint-staged
  participant Biome as Biome
  participant Prettier as Prettier

  Dev->>Husky: git commit
  Husky->>LS: run staged tasks
  LS->>Biome: biome:check on "**/*.{ts,tsx,html,json,jsonc}"
  LS->>Prettier: prettier --write on "**/*.{md,yml,yaml}"
  LS->>LS: run .gitignore sorter on .gitignore
  alt any task fails
    LS-->>Husky: non-zero exit
    Husky-->>Dev: commit blocked
  else all pass
    LS-->>Husky: success
    Husky-->>Dev: commit proceeds
  end
Loading

Possibly related PRs

Suggested reviewers

  • andyjakubowski
  • saltenasl
  • Artmann

Pre-merge checks

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "chore: partially sync biome and prettier configs from deepnote/deepnote" directly summarizes the main change: introducing Biome configuration and updating Prettier settings to align with the upstream repository. The word "partially" appropriately reflects that this PR contains configuration changes only, with code reformatting deferred to a follow-up commit. The title is specific, clear, and concise enough for team members to understand the primary change at a glance.
Linked Issues Check ✅ Passed The PR fully satisfies the objectives from GRN-4939. All key coding-related requirements are addressed: biome.json is added with the specified formatting rules (2-space indent, 120-char line width) and comprehensive lint rule sets; .prettierrc.js is updated with the correct tabWidth and trailingComma settings while removing obsolete overrides; @biomejs/biome@2.2.5 is added as a devDependency; new npm scripts (biome:check, lintAndFormat, etc.) are provided; lint-staged hooks are replaced to use Biome and Prettier appropriately; and CI workflow is consolidated to use the unified lintAndFormat command.
Out of Scope Changes Check ✅ Passed All changes are directly related to the GRN-4939 objective of syncing biome and prettier configurations. The modifications to .github/workflows/ci.yml, .prettierrc.js, biome.json, and package.json all serve the stated goal of aligning linting and formatting with deepnote/deepnote. No unrelated refactorings, feature additions, or code reformatting (which is deferred per the PR plan) are present.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7b4caf2 and 971aaeb.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • .github/workflows/ci.yml (1 hunks)
  • package.json (3 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
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-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:

  • package.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:

  • package.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: Build & Package Extension
  • GitHub Check: copilot-setup-steps
🔇 Additional comments (3)
.github/workflows/ci.yml (1)

41-42: CI consolidation correctly routes to unified linting script.

The step now invokes npm run lintAndFormat, which chains Biome and Prettier checks per the new package.json configuration. This simplifies the workflow and eliminates duplication.

package.json (2)

2112-2117: New npm scripts correctly orchestrate Biome and Prettier.

Scripts are well-structured: lintAndFormat runs Biome check followed by Prettier check, while lintAndFormat:fix applies both fixes. Granular scripts (biome:check, prettier) allow standalone execution when needed.


2373-2382: lint-staged configuration correctly routes file types to Biome and Prettier.

TS/TSX/HTML/JSON/JSONC files route to Biome (aligns with learnings on Biome lint rules), Markdown and YAML to Prettier, and .gitignore is sorted. Configuration is correct and mirrors the CI consolidation intent.


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

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d1ca48b and 0274268.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • .github/workflows/ci.yml (1 hunks)
  • .prettierrc.js (1 hunks)
  • biome.json (1 hunks)
  • package.json (5 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: deepnote/deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-14T13:43:36.344Z
Learning: Applies to **/*.{ts,tsx} : Follow Biome's lint rules as configured in biome.json
📚 Learning: 2025-10-14T13:43:36.344Z
Learnt from: CR
PR: deepnote/deepnote#0
File: CLAUDE.md:0-0
Timestamp: 2025-10-14T13:43:36.344Z
Learning: Applies to **/*.{ts,tsx} : Follow Biome's lint rules as configured in biome.json

Applied to files:

  • 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
🔇 Additional comments (5)
.prettierrc.js (1)

4-6: LGTM! Config aligns with biome.

Changes match the stated objectives: 2-space indent and ES5 trailing commas.

package.json (2)

2058-2063: LGTM! Scripts follow clear check/fix pattern.

The lintAndFormat scripts properly chain biome and prettier checks.


2106-2116: LGTM! lint-staged config is well-structured.

Biome handles code files, Prettier handles docs. The .gitignore sorting is a nice touch but may cause initial churn.

.github/workflows/ci.yml (1)

44-45: LGTM! CI consolidation is clean.

Single step replaces previous separate ESLint/Prettier checks, matching the new lintAndFormat script.

biome.json (1)

1-81: Config structure is solid. Strict rules noted.

The configuration is comprehensive and aligns with prettier settings. However, rules like noExplicitAny (error) and noUnusedImports (error) may flag numerous existing issues. Per the PR notes, CI failures are expected until the follow-up formatting PR.

Consider whether noExplicitAny at "error" is too strict for the current codebase—you might want "warn" during migration. Based on learnings.

@codecov
Copy link

codecov bot commented Oct 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71%. Comparing base (614334b) to head (971aaeb).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@          Coverage Diff          @@
##            main     #55   +/-   ##
=====================================
  Coverage     71%     71%           
=====================================
  Files        523     523           
  Lines      39001   39001           
  Branches    4905    4905           
=====================================
  Hits       27834   27834           
  Misses      9542    9542           
  Partials    1625    1625           
🚀 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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0274268 and baad269.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • .github/workflows/ci.yml (1 hunks)
  • package.json (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
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
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.
⏰ 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). (1)
  • GitHub Check: Build & Test
🔇 Additional comments (2)
.github/workflows/ci.yml (1)

44-45: CI consolidation looks good.

Replacing two separate lint/format steps with a single npm run lintAndFormat call is clean and matches the PR migration goal.

package.json (1)

2112-2117: New scripts are correctly wired.

The biome:check, biome:check:fix, lintAndFormat variants, and prettier scripts are all properly defined and align with the PR migration plan.

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between baad269 and 7b4caf2.

📒 Files selected for processing (1)
  • package.json (3 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
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
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.
📚 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:

  • package.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:

  • package.json
🔇 Additional comments (3)
package.json (3)

2112-2117: Scripts configuration looks solid.

The six new npm scripts (biome:check, biome:check:fix, lintAndFormat, lintAndFormat:fix, prettier, prettier:check) are well-structured and provide clear separation between check and fix modes. Chaining in lintAndFormat and lintAndFormat:fix is clean.


2371-2381: lint-staged configuration correctly aligned with PR objectives.

Biome handles **/*.{ts,tsx,html,json,jsonc} and Prettier handles **/*.{md,yml,yaml}. The .gitignore sort step is a useful addition. Structure matches the intent to replace ESLint + Prettier with Biome for source files.


2371-2387: Duplicate lint-staged block confirmed removed.

Verification shows only one lint-staged configuration block remains (line 2371). The second grep match is the dependency entry at line 2342—normal and expected. Previous duplicate configuration is gone.

@jamesbhobbs jamesbhobbs changed the title Sync biome and prettier configs from deepnote/deepnote chore: Sync biome and prettier configs from deepnote/deepnote Oct 21, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Oct 21, 2025
@jamesbhobbs jamesbhobbs changed the title chore: Sync biome and prettier configs from deepnote/deepnote chore: partially sync biome and prettier configs from deepnote/deepnote Oct 21, 2025
@jamesbhobbs jamesbhobbs deleted the devin/GRN-4939-1760472067 branch October 21, 2025 11:19
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