Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.1.0] - 2024-XX-XX
### Added

- **`migrate` command** — Migrate existing projects from ESLint/Prettier to Biome
- Automatic ESLint config migration (uses Biome's official `biome migrate eslint`)
- Automatic Prettier config migration (`biome migrate prettier`)
- **Preserves Prettier settings** (quotes, semicolons, trailing commas, line width)
- **Auto-detects and excludes generated folders** (`gen/`, `dist/`, `build/`)
- **Reads ESLint ignorePatterns** and applies them to Biome
- **Jest/Vitest globals** automatically configured
- **Optional auto-format** to apply Biome formatting in one commit
- Smart dependency cleanup (detects all ESLint/Prettier plugins with regex)
- Git safety commit before migration
- Interactive prompts for relaxed rules, script updates, and cleanup
- `--dry-run` mode for previewing changes
- Project detection for ESLint, Prettier, and existing Biome configs
- Biome version validation (requires ≥1.7)


### Added

Expand Down
49 changes: 43 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@

## Quick Start

### Create a New Project

```bash
npx zero-setup-biome my-app
cd my-app
npm run dev
```

### Migrate Existing Project

```bash
cd your-existing-project
npx zero-setup-biome migrate
```

That's it. No ESLint/Prettier conflicts. No configuration hell. Just code.

## What You Get
Expand All @@ -20,20 +29,48 @@ That's it. No ESLint/Prettier conflicts. No configuration hell. Just code.
- 🎨 **VSCode Integration** — Format on save, auto-organize imports
- 🔒 **Zero Conflicts** — No ESLint vs Prettier wars

## Options
## Commands

### Create

```bash
npx zero-setup-biome <project-name> [options]

Options:
-t, --template <template> Template to use (react-ts) [default: react-ts]
--skip-install Skip installing dependencies
--skip-git Skip git initialization
--pm <package-manager> Package manager (npm, pnpm, yarn, bun)
-v, --version Output version number
-h, --help Display help
--skip-install Skip installing dependencies
--skip-git Skip git initialization
--pm <package-manager> Package manager (npm, pnpm, yarn, bun)
-v, --version Output version number
-h, --help Display help
```

### Migrate

Migrate existing projects from ESLint/Prettier to Biome:

```bash
npx zero-setup-biome migrate [options]

Options:
--skip-install Skip installing Biome
--skip-cleanup Keep ESLint/Prettier configs and dependencies
--skip-git Skip creating safety git commit
--dry-run Show changes without applying them
-h, --help Display help
```

**What it does:**
- ✅ Migrates ESLint rules to `biome.json` (uses Biome's official migration)
- ✅ Migrates Prettier config to `biome.json`
- ✅ **Preserves your Prettier settings** (quotes, semicolons, line width, etc.)
- ✅ **Auto-detects Jest/Vitest** and adds global variables
- ✅ **Excludes generated folders** (`gen/`, `dist/`, `build/`, etc.)
- ✅ Removes ESLint/Prettier dependencies and plugins
- ✅ Updates `package.json` scripts
- ✅ **Optional auto-format** to apply Biome formatting in one commit
- ✅ Creates a safety git commit before changes

## Why Biome?

| Tool | Lint Time (medium project) |
Expand Down
12 changes: 10 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@
"commander": "^12.1.0",
"execa": "^9.5.2",
"fs-extra": "^11.2.0",
"picocolors": "^1.1.1"
"picocolors": "^1.1.1",
"semver": "^7.7.3"
},
"devDependencies": {
"@biomejs/biome": "^2.0.6",
"@types/fs-extra": "^11.0.4",
"@types/node": "^22.10.1",
"@types/semver": "^7.7.1",
"@vitest/coverage-v8": "^4.0.15",
"tsup": "^8.3.5",
"tsx": "^4.19.2",
Expand Down
17 changes: 17 additions & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Command } from "commander";
import { runCreate } from "./commands/create.js";
import { runMigrate } from "./commands/migrate.js";
import type { PackageManager, Template } from "./types/index.js";
import { TEMPLATES, VERSION } from "./utils/constants.js";

Expand Down Expand Up @@ -34,4 +35,20 @@ program
});
});

program
.command("migrate")
.description("Migrate existing project from ESLint/Prettier to Biome")
.option("--skip-install", "Skip installing Biome", false)
.option("--skip-cleanup", "Keep ESLint/Prettier configs and dependencies", false)
.option("--skip-git", "Skip creating safety git commit", false)
.option("--dry-run", "Show changes without applying them", false)
.action(async (opts) => {
await runMigrate({
skipInstall: opts.skipInstall,
skipCleanup: opts.skipCleanup,
skipGit: opts.skipGit,
dryRun: opts.dryRun,
});
});

program.parse();
Loading