A demonstration project showcasing Biome - the fast, modern formatter and linter for JavaScript, TypeScript, JSON, and more!
Biome is a performant toolchain for web projects. It aims to provide developer tools to maintain the health of your projects.
- ⚡ Blazingly Fast - Written in Rust, 25x faster than Prettier
- 🎯 All-in-One - Formatter + Linter + Import Organizer in one tool
- 🔧 Zero Config - Works out of the box with sensible defaults
- 📦 Multi-language - Supports JS, TS, JSX, TSX, JSON, CSS, and more
- 🔄 Drop-in Replacement - Compatible with Prettier & ESLint rules
Demo-Biome/
├── biome.json # Biome configuration
├── package.json # npm scripts for running Biome
├── README.md # This file
└── src/
└── examples/
├── formatting-demo.js # 🎨 Formatting issues
├── lint-demo.js # 🔍 Linting issues
├── imports-demo.js # 📦 Import sorting
├── typescript-demo.ts # 🔷 TypeScript support
├── react-demo.jsx # ⚛️ React/JSX support
└── json-demo.json # 📄 JSON formatting
Shows all issues without making changes:
npm run checkFixes all auto-fixable issues:
npm run check:fixCheck formatting issues:
npm run formatFix formatting issues:
npm run format:fixCheck lint issues:
npm run lintFix lint issues:
npm run lint:fixStrict check for CI pipelines (fails on any issue):
npm run ciDemonstrates formatting issues:
- Inconsistent spacing
- Missing semicolons
- Long lines
- Inconsistent quotes
- Poor indentation
Demonstrates lint issues:
- Unused variables
- Using
varinstead ofconst/let - Loose equality (
==vs===) debuggerstatements- Empty blocks
Demonstrates import organization:
- Unsorted imports
- Mixed import styles
- Grouped imports (third-party vs local)
Demonstrates TypeScript support:
- Interface/Type formatting
- Generic functions
- Class formatting
- Async functions
Demonstrates React/JSX support:
- Component formatting
- JSX indentation
- Hook usage
- Event handlers
Demonstrates JSON formatting:
- Proper indentation
- Consistent spacing
- Key sorting (optional)
The biome.json file contains all Biome settings:
{
"formatter": {
"enabled": true,
"indentStyle": "tab",
"lineWidth": 100
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "double",
"semicolons": "always"
}
}
}| Option | Description | Default |
|---|---|---|
indentStyle |
"tab" or "space" |
"tab" |
indentWidth |
Number of spaces (if using spaces) | 2 |
lineWidth |
Max line length | 80 |
quoteStyle |
"double" or "single" |
"double" |
semicolons |
"always" or "asNeeded" |
"always" |
Biome can automatically migrate your existing config:
# Migrate from ESLint
npx @biomejs/biome migrate eslint
# Migrate from Prettier
npx @biomejs/biome migrate prettierInstall the Biome VS Code Extension for:
- Real-time error highlighting
- Format on save
- Quick fixes
- Code actions
{
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit",
"source.organizeImports.biome": "explicit"
}
}| Tool | Time (1000 files) |
|---|---|
| Biome | ~0.5s |
| Prettier | ~12s |
| ESLint | ~15s |
Biome is approximately 25x faster than traditional tools!
- 📖 Biome Documentation
- 🔧 Configuration Reference
- 📜 Lint Rules
- 💬 Discord Community
- 🐙 GitHub Repository
- Show the Problem: Run
npm run checkto see all issues - Explain Issues: Walk through each file type
- Fix Everything: Run
npm run check:fix - Show the Result: Run
npm run checkagain (should be clean!) - Discuss Speed: Compare with ESLint/Prettier
- Show VS Code Integration: Real-time linting and formatting
Made with ❤️ for demonstrating Biome