Migrate from Biome to OXC + tsgo
This guide documents the exact migration path used in this repository.
- Install OXC tooling:
oxlint,oxfmt,oxlint-tsgolint. - Install tsgo preview:
@typescript/native-preview. - Replace scripts (
lint,format,check) to use OXC + tsgo. - Add
oxlint.config.tsandoxfmt.json. - Remove root
biome.jsonand Biome lint-staged hooks. - Keep
typescriptinstalled temporarily ifastro checkrequires it.
Introduction
Section titled “Introduction”Biome works well, but OXC has first-class dedicated tools for linting and formatting, and tsgo unlocks native high-performance type-checking. This migration adopts those tools while keeping Astro compatibility.
Migration Steps
Section titled “Migration Steps”1. Install dependencies
Section titled “1. Install dependencies”pnpm add -D oxlint oxfmt oxlint-tsgolint @typescript/native-previewpnpm remove @biomejs/biome2. Add OXC configs
Section titled “2. Add OXC configs”- Create
oxlint.config.ts - Create
oxfmt.json - Tune ignores (
dist,.astro, snippets folder) - Add overrides for script files (
no-console: offinscripts/**)
3. Update npm scripts
Section titled “3. Update npm scripts”{ "scripts": { "lint": "oxlint .", "lint:fix": "oxlint --fix .", "format": "oxfmt --write", "format:check": "oxfmt --check", "typecheck": "astro check", "typecheck:tsgo": "tsgo --noEmit", "check": "pnpm lint:md && pnpm lint && pnpm format:check && pnpm typecheck && pnpm style:lint" }}4. Update lint-staged
Section titled “4. Update lint-staged”Replace Biome command with OXC commands:
{ "*.{js,jsx,ts,tsx,mjs,cjs,json,jsonc}": ["oxlint --fix", "oxfmt --write"]}5. Update TypeScript config for TS 6/7 compatibility
Section titled “5. Update TypeScript config for TS 6/7 compatibility”- Remove deprecated
baseUrl - Inline path mapping roots
- Keep
pathsrelative to config file
{ "compilerOptions": { "paths": { "~/*": ["./src/*"] } }}6. Update editor settings
Section titled “6. Update editor settings”In .vscode/settings.json:
source.fixAll.biome→source.fixAll.oxc- default formatter →
oxc.oxfmt-vscode
Compatibility Notes
Section titled “Compatibility Notes”astro checkcurrently requires thetypescriptpackage.- This means full removal of TypeScript 5 is not yet practical in Astro projects.
- Current strategy: use
tsgofor native type checking and keeptypescriptas a compatibility dependency for Astro tooling.
Conclusion
Section titled “Conclusion”This migration provides faster linting/formatting and a path toward TypeScript
7 native tooling, while preserving existing Astro checks. As soon as Astro fully
supports tsgo, the legacy typescript package can be removed.