-
Notifications
You must be signed in to change notification settings - Fork 107
feat: switch from Prettier to Biome for formatting #139
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
feat: switch from Prettier to Biome for formatting #139
Conversation
- Replace Prettier with Biome (@biomejs/biome ^1.9.4) - Add biome.json config matching previous Prettier settings - Add pre-commit hooks with husky + lint-staged - Update CONTRIBUTING.md with Biome setup guide - Enable import organization for consistent imports - Update npm scripts: format, format:check, test:format Closes Nano-Collective#57
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.
Pull request overview
This PR successfully migrates the project from Prettier to Biome for code formatting and linting. Biome provides faster performance and combines formatting with linting capabilities in a single tool.
Key Changes:
- Replaced Prettier with Biome for formatting (~200 files reformatted)
- Implemented pre-commit hooks with husky and lint-staged for automatic formatting
- Organized imports alphabetically across all source files
Reviewed changes
Copilot reviewed 198 out of 200 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| biome.json | New Biome configuration matching previous Prettier settings |
| package.json | Updated dependencies, scripts, and lint-staged configuration |
| .husky/pre-commit | New pre-commit hook for automatic formatting |
| CONTRIBUTING.md | Added Biome setup guide and migration instructions |
| eslint.config.js | Updated comment reference from Prettier to Biome |
| .prettierignore | Removed (replaced by Biome's files configuration) |
| pnpm-lock.yaml | Updated lockfile with new dependencies |
| ~195 source files | Import organization and minor formatting adjustments |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
PTAL @will-lamerton, thanks. |
|
Hey @akramcodez working well my end - looking great 👍 Cheers for doing this one
Next couple of PR merges might be a challenge with the import reorganisation.. could be worth timing when this one is merged in (@will-lamerton) |
spinualexandru
left a 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.
This looks good, I love biome. Let's merge this after #135 as this oen is easier to run the linter against.
|
@spinualexandru - sounds good to me :) |
|
@akramcodez Approve of this as well. Love it, thanks for doing :D will merge after another big PR as suggested by @spinualexandru - thanks! |
|
@akramcodez You have conflicts preventing me from merging your changes. Could you resolve them please ? |
2dbda5f
|
@Avtrkrb I’ve resolved all the merge conflicts. Let me know if there are any issues. |
|
@Avtrkrb I've enabled the Biome linter in biome.json as requested. I disabled some specific rules (e.g., useTemplate, useArrowFunction) and the recommended set to keep the noise down and match our current ESLint configuration (warnings over errors). This ensures Biome acts as a fast, compatible secondary linter without blocking our workflow. |
|
@mrspence or @will-lamerton or @spinualexandru Need another approval on this please. |
Closes #57
Overview
This PR migrates the project from Prettier to Biome for code formatting. Biome is a faster alternative that provides both formatting and linting capabilities in a single tool.
Changes
New Files:
biome.json- Biome configuration matching Prettier settings.husky/pre-commit- Pre-commit hook for automatic formattingModified Files:
package.json- Updated dependencies and scriptsCONTRIBUTING.md- Added Biome setup guideeslint.config.js- Updated comment reference~195 source files- Import organization and minor formatting fixesDeleted Files:
.prettierignore- Replaced by Biome's files configurationConfiguration
The Biome configuration exactly matches our previous Prettier settings:
Pre-commit Hooks
Implemented with husky and lint-staged to automatically format staged files before commit.
Files Changed: ~200
Why so many files?
Import Organization (180 files) - Biome sorts all imports alphabetically. This is a one-time change for consistent import ordering going forward.
Minor Formatting (15 files) - Small formatting differences between Prettier and Biome.
Configuration (5 files) - New Biome config, dependencies, documentation.
This is a one-time migration. Future PRs will have minimal formatting diffs.
Testing
All checks pass:
Migration for Contributors
After pulling this change:
pnpm install(sets up pre-commit hooks automatically)biomejs.biomepnpm formatto format any existing changesAvailable Scripts