-
Notifications
You must be signed in to change notification settings - Fork 4
chore: partially sync biome and prettier configs from deepnote/deepnote #55
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
- 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
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
⚙️ Control Options:
|
📝 WalkthroughWalkthrough
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
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
Possibly related PRs
Suggested reviewers
Pre-merge checks✅ Passed checks (5 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
🧰 Additional context used🧠 Learnings (3)📓 Common learnings📚 Learning: 2025-10-14T13:43:36.364ZApplied to files:
📚 Learning: 2025-09-25T14:43:13.976ZApplied to files:
⏰ 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)
🔇 Additional comments (3)
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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis 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) andnoUnusedImports(error) may flag numerous existing issues. Per the PR notes, CI failures are expected until the follow-up formatting PR.Consider whether
noExplicitAnyat "error" is too strict for the current codebase—you might want "warn" during migration. Based on learnings.
Codecov Report✅ All modified and coverable lines are covered by tests. 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:
|
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: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis 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 lintAndFormatcall 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.
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: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 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 inlintAndFormatandlintAndFormat:fixis 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.gitignoresort 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-stagedconfiguration block remains (line 2371). The second grep match is the dependency entry at line 2342—normal and expected. Previous duplicate configuration is gone.
Fixes GRN-4939
Summary
Syncs Biome and Prettier configurations from
deepnote/deepnoteto 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/deepnoteUpdated
.prettierrc.js:tabWidth: 4 → 2(to match biome)trailingComma: 'none' → 'es5'(to match biome)datascience/serviceRegistry.tsoverride (biome handles it now)Dependencies
@biomejs/biome: 2.2.5to devDependenciesScripts
biome:check/biome:check:fix- Run biome linter/formatterlintAndFormat/lintAndFormat:fix- Combined biome + prettier checksprettier/prettier:check- Prettier for markdown/YAML onlyPre-commit Hooks (lint-staged)
Breaking change: Replaced ESLint-based config with Biome
eslint --cache --fix+prettier --writeonsrc/**/*.{ts,tsx}biome check --writeon**/*.{ts,tsx,html,json,jsonc}+prettier --writeon**/*.{md,yml,yaml}+ sort.gitignorepnpm exec; this repo uses npm so that prefix was removedCI
npm run lintAndFormatcommandThis 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:fixeither:Formatting impact when applied:
Review Checklist
biome.jsonmatchesdeepnote/deepnoteexactlySession: https://app.devin.ai/sessions/c6d9ca47685f4ef39b76448d22a60e3f
Requested by: James Hobbs (@jamesbhobbs)
Summary by CodeRabbit
Style
Chores