ywai/skills/biome/SKILL.md
Linting, formatting, and code quality using Biome
npx skillsauth add Yoizen/dev-ai-workflow biomeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
biome check --write before committingcorrectness or suspicious rules without a clear justification in commentsbiome.json configuration synchronized across all servicesnpm run lint in CI/CD pipelines# Check and auto-fix
npx @biomejs/biome check --write .
# Format files
npx @biomejs/biome format --write .
# Organize imports
npx @biomejs/biome organize-imports .
Note: If your project currently uses ESLint, to migrate to Biome:
npm install --save-dev @biomejs/biome
npm uninstall eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin
biome.json:
{
"$schema": "https://biomejs.dev/schemas/2.3.2/schema.json",
"files": {
"ignoreUnknown": true,
"includes": [
"**",
"!!**/node_modules",
"!!**/dist",
"!!**/build",
"!!**/coverage",
"!!**/.next",
"!!**/.nuxt",
"!!**/.svelte-kit",
"!!**/.turbo",
"!!**/.vercel",
"!!**/.cache",
"!!**/__generated__",
"!!**/*.generated.*",
"!!**/*.gen.*",
"!!**/generated",
"!!**/codegen"
]
},
"formatter": {
"enabled": true,
"formatWithErrors": true,
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 80,
"bracketSpacing": true
},
"assist": {
"actions": {
"source": {
"organizeImports": "on",
"useSortedAttributes": "on",
"noDuplicateClasses": "on",
"useSortedInterfaceMembers": "on",
"useSortedProperties": "on"
}
}
},
"linter": {
"enabled": true,
"rules": {
"correctness": {
"noUnusedImports": {
"fix": "safe",
"level": "error"
},
"noUnusedVariables": "error",
"noUnusedFunctionParameters": "error",
"noUndeclaredVariables": "error",
"useParseIntRadix": "warn",
"useValidTypeof": "error",
"noUnreachable": "error"
},
"style": {
"useBlockStatements": {
"fix": "safe",
"level": "error"
},
"useConst": "error",
"useImportType": "warn",
"noNonNullAssertion": "error",
"useTemplate": "warn"
},
"security": {
"noGlobalEval": "error"
},
"suspicious": {
"noExplicitAny": "error",
"noImplicitAnyLet": "error",
"noDoubleEquals": "warn",
"noGlobalIsNan": "error",
"noPrototypeBuiltins": "error"
},
"complexity": {
"useOptionalChain": "error",
"useLiteralKeys": "warn",
"noForEach": "warn"
},
"nursery": {
"useSortedClasses": {
"fix": "safe",
"level": "error",
"options": {
"attributes": ["className"],
"functions": ["clsx", "cva", "tw", "twMerge", "cn", "twJoin", "tv"]
}
}
}
}
},
"javascript": {
"formatter": {
"arrowParentheses": "always",
"semicolons": "always",
"trailingCommas": "es5"
}
},
"organizeImports": {
"enabled": true
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true,
"defaultBranch": "main"
}
}
ESLint Locations (current): 3. Remove ESLint config files from your project directories
# Validate Biome configuration
npx @biomejs/biome check --verbose
# Show configuration
npx @biomejs/biome migrate eslint
# Check all files
npx @biomejs/biome check
# Check specific file
npx @biomejs/biome check src/app.component.ts
# Check specific directory
npx @biomejs/biome check src/
# Watch mode
npx @biomejs/biome check --watch
# Apply fixes
npx @biomejs/biome check --write
# Format all files
npx @biomejs/biome format
# Format specific file
npx @biomejs/biome format src/app.component.ts
# Format specific directory
npx @biomejs/biome format src/
# Check formatting without writing
npx @biomejs/biome format --write=false
# Organize imports in all files
npx @biomejs/biome check --apply-unsafe
# Or run separately
npx @biomejs/biome organize-imports
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'airbnb-base',
'prettier'
],
plugins: [
'@typescript-eslint',
'prettier'
],
rules: {
// Custom rules
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'prettier/prettier': 'error'
},
settings: {
'import/resolver': {
'typescript': {}
}
}
};
Based on common ESLint configurations:
| Rule | Severity | Description |
|------|----------|-------------|
| @typescript-eslint/no-unused-vars | warn | Warn about unused variables |
| @typescript-eslint/explicit-module-boundary-types | off | Disable boundary type requirement |
| prettier/prettier | error | Enforce Prettier formatting |
Add to package.json:
{
"scripts": {
"lint": "biome check .",
"lint:fix": "biome check --write .",
"format": "biome format --write .",
"format:check": "biome format ."
}
}
{
"scripts": {
"lint": "eslint . --ext .ts,.tsx",
"lint:fix": "eslint . --ext .ts,.tsx --fix",
"format": "prettier --write \"src/**/*.{ts,tsx,scss}\"",
"format:check": "prettier --check \"src/**/*.{ts,tsx,scss}\""
}
}
# Find ESLint configs
find . -name ".eslintrc.*"
# Find Prettier configs
find . -name ".prettierrc.*"
# Find Biome configs (if migrated)
find . -name "biome.json"
# Find lint scripts
grep -r "\"lint\"" package.json
# Find format scripts
grep -r "\"format\"" package.json
# Auto-fix all fixable errors
npm run lint:fix
# Fix specific file
npx @biomejs/biome check --write src/file.ts
# Check remaining errors
npm run lint
# Format all changes
npm run format
# Organize imports
npm run organize
# Check for remaining errors
npm run lint:fix
GitHub Actions (.github/workflows/lint.yml):
name: Lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm ci
- name: Run Biome
run: npm run lint
npm install --save-dev @biomejs/biome
# Generate Biome config from ESLint
npx @biomejs/biome migrate eslint
# Review generated biome.json
npm uninstall eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin prettier eslint-config-prettier eslint-config-airbnb-base eslint-plugin-import eslint-plugin-prettier
# Update package.json scripts
# See "Biome Scripts" section above
Update .lefthook/pre-commit:
#!/bin/sh
. "$(dirname "$0")/_/lefthook.sh"
# Run Biome check and format
npx --no -- biome check --write
Error: command not found: biome
Solution:
# Install Biome locally
npm install --save-dev @biomejs/biome
# Or use npx
npx @biomejs/biome check
Common Errors:
Solutions:
npm run lint:fix to auto-fixnpx tsc --noEmitIssue: Biome and Prettier both formatting
Solution:
# Pre-commit hook
git add -A
npm run lint:fix
git add -A
.gitignore exclusions# Update Biome regularly
npm update @biomejs/biome
# Check for new rules
npx @biomejs/biome migrate --help
VS Code Settings (.vscode/settings.json):
{
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.biomejs.biome": "explicit"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
assets/scripts/lint.sh - Linting automation script.assets/scripts/format.sh - Formatting automation script.documentation
Yoizen UI design system guidelines and resources. Trigger: When working on Yoizen UI components, styling, colors, typography, or icons.
development
TypeScript strict patterns and best practices. Trigger: When writing TypeScript code - types, interfaces, generics.
development
Tailwind CSS 4 patterns and best practices. Trigger: When styling with Tailwind - cn(), theme variables, no var() in className.
data-ai
name: skill-sync description: > Sync skill metadata with the Auto-invoke sections in AGENTS.md. Trigger: When you change a skill's metadata (metadata.scope/metadata.auto_invoke), regenerate the Auto-invoke tables, or run ./skills/skill-sync/assets/sync.sh. metadata: author: Yoizen version: "1.0" scope: [root] auto_invoke: - "skill operations" - "workflow" - "sdd" author: Yoizen version: "1.0" scope: [root] auto_invoke: - "skill operations" - "workflow"