xiaohongshu
xiaohongshu
biome-config
Update Biome linting rules, formatting configs, and import organization settings. Use when adding new lint rules, customizing code style, or fixing workspace-specific linting issues.
Full skill instructions
This skill helps you configure and customize Biome for linting and formatting across the monorepo.
Biome is an all-in-one toolchain for web projects that provides:
The project uses Biome instead of ESLint and Prettier for better performance.
sgcarstrends/
├── biome.json # Root Biome config
├── apps/
│ ├── api/
│ │ └── biome.json # API-specific config (extends root)
│ └── web/
│ └── biome.json # Web-specific config (extends root)
└── packages/
└── database/
└── biome.json # Database-specific config
// biome.json
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true,
"defaultBranch": "main"
},
"files": {
"ignoreUnknown": false,
"ignore": [
"node_modules",
"dist",
"build",
".next",
".turbo",
"coverage",
".sst"
]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100,
"lineEnding": "lf"
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"noExtraBooleanCast": "error",
"noMultipleSpacesInRegularExpressionLiterals": "error",
"noUselessCatch": "error",
"noUselessConstructor": "error",
"noUselessEmptyExport": "error",
"noWith": "error"
},
"correctness": {
"noConstAssign": "error",
"noConstantCondition": "error",
"noEmptyCharacterClassInRegex": "error",
"noEmptyPattern": "error",
"noGlobalObjectCalls": "error",
"noInvalidConstructorSuper": "error",
"noInvalidNewBuiltin": "error",
"noNonoctalDecimalEscape": "error",
"noPrecisionLoss": "error",
"noSelfAssign": "error",
"noSetterReturn": "error",
"noSwitchDeclarations": "error",
"noUndeclaredVariables": "error",
"noUnreachable": "error",
"noUnreachableSuper": "error",
"noUnsafeFinally": "error",
"noUnsafeOptionalChaining": "error",
"noUnusedLabels": "error",
"noUnusedVariables": "error",
"useIsNan": "error",
"useValidForDirection": "error",
"useYield": "error"
},
"security": {
"noDangerouslySetInnerHtml": "error",
"noDangerouslySetInnerHtmlWithChildren": "error"
},
"style": {
"noArguments": "error",
"noVar": "error",
"useConst": "error",
"useTemplate": "error"
},
"suspicious": {
"noAsyncPromiseExecutor": "error",
"noCatchAssign": "error",
"noClassAssign": "error",
"noCommentText": "error",
"noCompareNegZero": "error",
"noDebugger": "error",
"noDoubleEquals": "error",
"noDuplicateCase": "error",
"noDuplicateClassMembers": "error",
"noDuplicateObjectKeys": "error",
"noDuplicateParameters": "error",
"noEmptyBlockStatements": "error",
"noExplicitAny": "warn",
"noExtraNonNullAssertion": "error",
"noFallthroughSwitchClause": "error",
"noFunctionAssign": "error",
"noGlobalAssign": "error",
"noImportAssign": "error",
"noMisleadingCharacterClass": "error",
"noMisleadingInstantiator": "error",
"noPrototypeBuiltins": "error",
"noRedeclare": "error",
"noShadowRestrictedNames": "error",
"noUnsafeDeclarationMerging": "error",
"noUnsafeNegation": "error",
"useGetterReturn": "error",
"useValidTypeof": "error"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "double",
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "es5",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSpacing": true,
"bracketSameLine": false
}
}
}
// apps/web/biome.json
{
"extends": ["../../biome.json"],
"linter": {
"rules": {
"suspicious": {
"noExplicitAny": "off" // Allow 'any' in web app for flexibility
}
}
}
}
// Override for test files (if needed)
{
"overrides": [
{
"include": ["**/__tests__/**", "**/*.test.ts", "**/*.spec.ts"],
"linter": {
"rules": {
"suspicious": {
"noExplicitAny": "off"
}
}
}
}
]
}
# Check all files
pnpm biome check .
# Check specific directory
pnpm biome check apps/web
# Check and apply safe fixes
pnpm biome check --write .
# Check only linting
pnpm biome lint .
# Check only formatting
pnpm biome format .
# Format all files
pnpm biome format --write .
# Format specific files
pnpm biome format --write apps/web/src/**/*.ts
# Check formatting without writing
pnpm biome format .
# Organize imports
pnpm biome check --organize-imports-enabled=true --write .
# Check without modifying files (for CI)
pnpm biome ci .
Disable a rule globally:
{
"linter": {
"rules": {
"suspicious": {
"noExplicitAny": "off"
}
}
}
}
Change severity:
{
"linter": {
"rules": {
"suspicious": {
"noExplicitAny": "warn" // error, warn, off
}
}
}
}
Disable inline:
// biome-ignore lint/suspicious/noExplicitAny: Legacy code needs refactoring
function legacy(data: any) {
// ...
}
Disable for entire file:
/* biome-ignore lint/suspicious/noExplicitAny: Test file */
Enable all recommended:
{
"linter": {
"rules": {
"recommended": true
}
}
}
Enable specific categories:
{
"linter": {
"rules": {
"recommended": false,
"correctness": {
"recommended": true
},
"security": {
"recommended": true
},
"performance": {
"recommended": true
}
}
}
}
{
"javascript": {
"formatter": {
"quoteStyle": "double", // "single" or "double"
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded", // "asNeeded" or "preserve"
"trailingCommas": "es5", // "none", "es5", or "all"
"semicolons": "always", // "always" or "asNeeded"
"arrowParentheses": "always", // "always" or "asNeeded"
"bracketSpacing": true,
"bracketSameLine": false
}
}
}
{
"formatter": {
"indentStyle": "space", // "space" or "tab"
"indentWidth": 2, // Number of spaces
"lineWidth": 100, // Max line length
"lineEnding": "lf" // "lf", "crlf", or "cr"
}
}
{
"organizeImports": {
"enabled": true
}
}
Biome automatically organizes imports into groups:
fs, path)react, next)@/components, ~/utils)./utils, ../types)Example:
// Before
import { Button } from "./components/button";
import { useState } from "react";
import path from "path";
import { db } from "@/lib/db";
// After
import path from "path";
import { useState } from "react";
import { db } from "@/lib/db";
import { Button } from "./components/button";
Biome integrates with git hooks:
// .husky/pre-commit
pnpm biome check --write --staged
{
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true, // Respect .gitignore
"defaultBranch": "main"
}
}
{
"files": {
"ignore": [
"node_modules",
"dist",
"build",
".next",
".turbo",
"coverage",
".sst",
"**/*.config.js",
"migrations/**"
]
}
}
With useIgnoreFile: true, Biome respects .gitignore.
// biome-ignore format: Auto-generated code
const generated = "...";
{
"scripts": {
"lint": "biome check .",
"lint:fix": "biome check --write .",
"format": "biome format --write .",
"format:check": "biome format .",
"biome:ci": "biome ci ."
}
}
// .vscode/settings.json
{
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true
},
"[javascriptreact]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true
},
"[json]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true
},
"editor.codeActionsOnSave": {
"quickfix.biome": "explicit",
"source.organizeImports.biome": "explicit"
}
}
# Remove ESLint
pnpm remove -r eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin
# Remove Prettier
pnpm remove -r prettier
# Remove config files
rm .eslintrc.json .prettierrc .prettierignore
# Already installed in project
pnpm add -D -w @biomejs/biome
Convert ESLint rules to Biome:
biome migrate eslint for automated migrationnpx @biomejs/biome migrate eslint --write
Replace in package.json:
{
"scripts": {
"lint": "biome check .", // was: eslint .
"format": "biome format --write ." // was: prettier --write .
}
}
Issue: Rule seems to contradict another Solution: Check rule documentation, disable one if needed
Issue: Biome is slow on large codebase Solutions:
files.ignore is properly set--max-diagnostics to limit outputIssue: Files not formatting on save Solutions:
editor.defaultFormatter is set to Biomebiome.json is in workspace rootIssue: Imports not organizing Solutions:
organizeImports.enabled: truebiome check --organize-imports-enabled=true --write .{
"overrides": [
{
"include": ["**/*.config.ts"],
"linter": {
"rules": {
"suspicious": {
"noExplicitAny": "off"
}
}
}
},
{
"include": ["apps/api/**/*.ts"],
"formatter": {
"lineWidth": 120
}
}
]
}
{
"linter": {
"rules": {
"correctness": {
"noUnusedVariables": "error"
},
"style": {
"useConst": "warn"
},
"suspicious": {
"noExplicitAny": "off"
}
}
}
}
# .github/workflows/lint.yml
name: Lint
on: [push, pull_request]
jobs:
biome:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- run: pnpm install
- run: pnpm biome ci .
biome.json - Root configurationbiome.json.gitignore supportbiome ci in continuous integrationxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience