Fast code quality with Biome for Google Antigravity projects including linting, formatting, and import organization.
# Biome Code Quality Tools for Google Antigravity
Configure fast code quality tooling with Biome in your Google Antigravity IDE projects. This comprehensive guide covers linting rules, formatting options, and import organization optimized for Gemini 3 agentic development.
## Biome Configuration
Set up Biome with comprehensive rules:
```json
// biome.json
{
"$schema": "https://biomejs.dev/schemas/1.5.0/schema.json",
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"noBannedTypes": "error",
"noExtraBooleanCast": "error",
"noUselessCatch": "error",
"noWith": "error"
},
"correctness": {
"noConstAssign": "error",
"noConstantCondition": "warn",
"noUnreachable": "error",
"noUnusedVariables": "warn",
"useIsNan": "error"
},
"security": {
"noDangerouslySetInnerHtml": "warn",
"noGlobalEval": "error"
},
"style": {
"noVar": "error",
"useConst": "error",
"useTemplate": "error"
},
"suspicious": {
"noConsoleLog": "warn",
"noDebugger": "error",
"noDoubleEquals": "error",
"noExplicitAny": "warn"
},
"a11y": {
"useAltText": "error",
"useButtonType": "error",
"useValidAnchor": "error"
}
}
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100,
"lineEnding": "lf"
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"jsxQuoteStyle": "double",
"trailingComma": "es5",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSpacing": true
}
},
"json": {
"formatter": {
"enabled": true,
"indentWidth": 2
}
},
"files": {
"ignore": [
"node_modules",
".next",
"dist",
"build",
"coverage"
]
}
}
```
## Package Scripts
Configure npm scripts for Biome:
```json
// package.json
{
"scripts": {
"lint": "biome lint .",
"lint:fix": "biome lint --apply .",
"format": "biome format --write .",
"format:check": "biome format .",
"check": "biome check .",
"check:fix": "biome check --apply .",
"ci": "biome ci ."
}
}
```
## VS Code Integration
Configure VS Code for Biome:
```json
// .vscode/settings.json
{
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports.biome": "explicit",
"quickfix.biome": "explicit"
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
```
## Git Hooks with Lefthook
Set up pre-commit hooks:
```yaml
# lefthook.yml
pre-commit:
parallel: true
commands:
biome:
glob: "*.{js,jsx,ts,tsx,json}"
run: npx biome check --apply {staged_files}
stage_fixed: true
typecheck:
glob: "*.{ts,tsx}"
run: npx tsc --noEmit
```
## CI Integration
Add Biome to CI pipeline:
```yaml
# .github/workflows/ci.yml
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- name: Biome CI
run: npm run ci
- name: Type Check
run: npx tsc --noEmit
```
## Rule Customization
Override rules for specific files:
```json
{
"overrides": [
{
"include": ["**/*.test.ts", "**/*.spec.ts"],
"linter": {
"rules": {
"suspicious": {
"noExplicitAny": "off"
}
}
}
},
{
"include": ["scripts/**"],
"linter": {
"rules": {
"suspicious": {
"noConsoleLog": "off"
}
}
}
}
]
}
```
## Best Practices
1. **Use recommended rules** as a baseline
2. **Configure per-project overrides** as needed
3. **Enable organize imports** for consistent ordering
4. **Set up editor integration** for real-time feedback
5. **Use git hooks** for pre-commit checks
6. **Run in CI** to catch issues early
7. **Migrate from ESLint/Prettier** graduallyThis biome prompt is ideal for developers working on:
By using this prompt, you can save hours of manual coding and ensure best practices are followed from the start. It's particularly valuable for teams looking to maintain consistency across their biome implementations.
Yes! All prompts on Antigravity AI Directory are free to use for both personal and commercial projects. No attribution required, though it's always appreciated.
This prompt works excellently with Claude, ChatGPT, Cursor, GitHub Copilot, and other modern AI coding assistants. For best results, use models with large context windows.
You can modify the prompt by adding specific requirements, constraints, or preferences. For biome projects, consider mentioning your framework version, coding style, and any specific libraries you're using.