Repository navigation
fix: linting and formatting - #23
andyjakubowski wants to merge 2 commits into
Conversation
Biome doesn’t support formatting YAML or Markdown files.
📝 WalkthroughWalkthrough
Possibly related PRs
Suggested reviewers
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 #23 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 3 3
Branches 1 1
=========================================
Hits 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
There is a conflict between Biome formatting all JSON files, and then |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/ci.yml(1 hunks)biome.json(1 hunks)package.json(1 hunks)
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-03T12:53:28.421Z
Learning: Run `npm run format-fix` before committing any changes
📚 Learning: 2025-09-03T13:01:49.096Z
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/instructions/typescript.instructions.md:0-0
Timestamp: 2025-09-03T13:01:49.096Z
Learning: Use `npm run format` to check code style
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-09-03T13:01:49.096Z
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/instructions/typescript.instructions.md:0-0
Timestamp: 2025-09-03T13:01:49.096Z
Learning: Use `npm run format-fix` to auto-fix formatting issues
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-09-03T12:53:28.421Z
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-03T12:53:28.421Z
Learning: Run `npm run format-fix` before committing any changes
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-09-03T13:01:49.096Z
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/instructions/typescript.instructions.md:0-0
Timestamp: 2025-09-03T13:01:49.096Z
Learning: ALWAYS run `npm run format-fix` before committing changes
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-09-03T12:53:28.421Z
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-09-03T12:53:28.421Z
Learning: Use lint/format tools as part of development
Applied to files:
.github/workflows/ci.yml
📚 Learning: 2025-09-03T13:01:49.096Z
Learnt from: CR
PR: deepnote/vscode-extension#0
File: .github/instructions/typescript.instructions.md:0-0
Timestamp: 2025-09-03T13:01:49.096Z
Learning: Pre-commit: run `npm run format-fix`, `npm run lint`, and `npm run test:unittests` before committing
Applied to files:
.github/workflows/ci.yml
🪛 GitHub Actions: CI
package.json
[error] 9-15: Biome formatting check failed. The 'files' field would be reformatted to include proper brackets and spacing. Run 'pnpm run format' or 'biome format .' to fix.
🔇 Additional comments (2)
biome.json (1)
17-17: Keeppackage.jsonin Biome’s scope.Bringing package.json under Biome is necessary now that lint-staged runs Biome on JSON; this keeps the workflow consistent. Looks good.
package.json (1)
9-14: Use Biome’s--write=false(or--check) flag for format checks.
biome format .without flags streams formatted code to stdout but exits 0 even when fixes are needed, soformat:checkwon’t fail for dirty files. Add an explicit check mode, e.g.biome format --write=false .(Biome 2.2+) orbiome check --write=false ., so CI actually enforces formatting.⛔ Skipped due to learnings
Learnt from: jamesbhobbs PR: deepnote/deepnote#18163 File: .husky/pre-push:2-2 Timestamp: 2025-08-14T18:24:01.956Z Learning: The `biome format` command runs in check mode by default and does not modify files. It only writes changes when the `--write` or `--fix` flag is provided.Learnt from: CR PR: deepnote/vscode-extension#0 File: .github/instructions/typescript.instructions.md:0-0 Timestamp: 2025-09-03T13:01:49.096Z Learning: Use `npm run format` to check code styleLearnt from: CR PR: deepnote/vscode-extension#0 File: .github/instructions/typescript.instructions.md:0-0 Timestamp: 2025-09-03T13:01:49.096Z Learning: Use `npm run format-fix` to auto-fix formatting issuesLearnt from: CR PR: deepnote/deepnote#0 File: CONVENTIONS.md:0-0 Timestamp: 2025-08-18T23:41:22.727Z Learning: Use provided build/lint/test commands (pnpm build, lint, typecheck, test) and Nx invocationsLearnt from: CR PR: deepnote/vscode-extension#0 File: .github/copilot-instructions.md:0-0 Timestamp: 2025-09-03T12:53:28.421Z Learning: Run `npm run format-fix` before committing any changesLearnt from: CR PR: deepnote/vscode-extension#0 File: .github/instructions/typescript.instructions.md:0-0 Timestamp: 2025-09-03T13:01:49.096Z Learning: ALWAYS run `npm run format-fix` before committing changes
| "**/*.{ts,tsx,json,html}": ["pnpm exec biome lint --write", "pnpm exec biome format --write"], | ||
| "**/*.{md,yml,yaml}": "pnpm exec prettier --write", | ||
| ".gitignore": "sort -o .gitignore .gitignore", | ||
| "**/package.json": "sort-package-json" | ||
| }, |
There was a problem hiding this comment.
Avoid fighting Biome with sort-package-json.
With package.json now formatted by Biome, sort-package-json rewrites arrays (e.g., keywords, files) into multi-line JSON.stringify output, after which biome format fails in CI. Drop sort-package-json or switch to Biome’s built-in sort action to keep the tools aligned.
🤖 Prompt for AI Agents
package.json lines 27-31: the lint-staged entry runs sort-package-json against
package.json which conflicts with Biome formatting and causes CI failures;
remove the "**/package.json": "sort-package-json" entry (or replace it with a
Biome-based step such as running Biome format on package.json, e.g.
"**/package.json": "pnpm exec biome format --write") so package.json sorting is
handled by Biome and the two tools no longer fight.
jamesbhobbs
left a comment
There was a problem hiding this comment.
I suggest closing this for https://github.com/deepnote/deepnote/pull/20/files
`biome check runs more than just biome lint and biome format combined.
biome check includes:
Linting (like biome lint)
Formatting (like biome format)
Organize imports (not included in lint or format separately)
Assists (code actions/refactoring suggestions)
So the hierarchy is:
biome lint = linting only
biome format = formatting only
biome check = lint + format + organize imports + assists
That's why biome check is generally the recommended command to use - it's the most comprehensive. When you run biome check --write, it will:
Fix linting issues
Format code
Organize/remove unused imports
Apply safe code transformations
`
|
Closing this in favor of #20 |
Addresses #8
This PR tightens up our repo hygiene by fixing lint-staged coverage and ensuring Prettier formatting is enforced in CI.
Changes
1. Pre-commit (lint-staged)
• Updated lint-staged config to run Biome (lint + format) on code files.
• Stopped excluding package.json from Biome, it will format the file and then lint-staged will run sort-package-json.
• Prettier continues to run only on Markdown and YAML files.
2. CI (format job)
• Updated package.json scripts so format:check runs both Biome and Prettier checks.
• Updated CI workflow step label to reflect that format:check now validates MD/YAML as well.
Why
• Previously, lint-staged skipped JS/TS files and tried to pass package.json to Biome (ignored by config), causing failed commits.
• CI only checked Biome formatting, so pushes could bypass Prettier rules on MD/YAML.
With these changes:
• Pre-commit hooks cover all relevant staged files correctly.
• CI enforces both Biome and Prettier formatting consistently.
Summary by CodeRabbit