Use when formatting JavaScript/TypeScript code with Biome's fast formatter including patterns, options, and code style management.
View on GitHubSelect agents to install to:
npx add-skill https://github.com/TheBushidoCollective/han/blob/main/plugins/validation/biome/skills/biome-formatting/SKILL.md -a claude-code --skill biome-formattingInstallation paths:
.claude/skills/biome-formatting/# Biome Formatting
Master Biome's fast code formatter for JavaScript, TypeScript, JSON, and other supported languages with consistent style enforcement.
## Overview
Biome's formatter provides opinionated, fast code formatting similar to Prettier but with better performance. It's written in Rust and designed to format code consistently across teams.
## Core Commands
### Basic Formatting
```bash
# Format files and write changes
biome format --write .
# Format specific files
biome format --write src/**/*.ts
# Check formatting without fixing
biome format .
# Format stdin
echo "const x={a:1}" | biome format --stdin-file-path="example.js"
```
### Combined Operations
```bash
# Lint and format together
biome check --write .
# Only format (skip linting)
biome format --write .
# CI mode (check both lint and format)
biome ci .
```
## Formatter Configuration
### Global Settings
```json
{
"formatter": {
"enabled": true,
"formatWithErrors": false,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 80,
"attributePosition": "auto"
}
}
```
Options:
- `enabled`: Enable/disable formatter (default: true)
- `formatWithErrors`: Format even with syntax errors (default: false)
- `indentStyle`: "space" or "tab" (default: "tab")
- `indentWidth`: Number of spaces, typically 2 or 4 (default: 2)
- `lineEnding`: "lf", "crlf", or "cr" (default: "lf")
- `lineWidth`: Maximum line length (default: 80)
- `attributePosition`: "auto" or "multiline" for HTML/JSX
### Recommended Configuration
```json
{
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 100
}
}
```
## Language-Specific Formatting
### JavaScript/TypeScript
```json
{
"javascript": {
"formatter": {
"enabled": true,
"quoteStyle": "single",
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "all",
"semicolons": "always",