Biome eslint prettier lint format

From CraftOS-dev/craftbot-agent-bundles · View interactive version

Biome eslint prettier lint format is an AI agent skill from the GitHub repository CraftOS-dev/craftbot-agent-bundles. Source: https://biomejs.dev/ · https://eslint.org/ · https://oxc.rs/

How to use this skill

Skill file

<!--

Source: https://biomejs.dev/ · https://eslint.org/ · https://oxc.rs/

Authored: June 2026 for the frontend-engineer agent bundle.

-->

Biome / ESLint 9 / Prettier — Lint + format

Biome (Rust) is the single-tool replacement for ESLint + Prettier — ~25x

faster, 95%+ Prettier-compatible. Use Biome for new projects. Stay on ESLint 9

(flat config required) + Prettier 3 only when you need a niche plugin Biome

doesn't have. Oxlint is the Rust ESLint-alternative if you want even faster

linting separate from formatting.

When to use

"Oxlint", "flat config", "biome migrate"

Decision tree

| Situation | Pick |

|---|---|

| Greenfield project, no exotic rules needed | Biome |

| Need a plugin Biome doesn't have (e.g., eslint-plugin-storybook) | ESLint 9 + Prettier 3 |

| Want fastest lint, format unchanged | Oxlint + Prettier 3 |

| Existing huge ESLint config that works | Stay on ESLint until you have a reason to move |

Setup — Biome

pnpm add -D --save-exact @biomejs/biome

# Init config
pnpm dlx biome init

# Run
pnpm dlx biome check --write ./src
pnpm dlx biome check                     # CI gate (no writes)
pnpm dlx biome format --write ./src
pnpm dlx biome lint --write ./src

Verify: pnpm dlx biome --version → 1.9+ (June 2026).

Setup — Migrate ESLint + Prettier → Biome

# 1. Install
pnpm add -D --save-exact @biomejs/biome

# 2. Run migrators (read .eslintrc + .prettierrc, emit biome.json)
pnpm dlx biome migrate eslint --write
pnpm dlx biome migrate prettier --write

# 3. Format + lint
pnpm dlx biome check --write .

# 4. Delete legacy configs once happy
git rm .eslintrc* .prettierrc* .eslintignore .prettierignore
pnpm remove eslint prettier $(pnpm list --depth 0 | grep eslint-)

Verify: pnpm dlx biome check . exits 0.

Setup — ESLint 9 (flat config)

pnpm add -D eslint @eslint/js typescript-eslint
pnpm add -D eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-jsx-a11y
pnpm add -D eslint-config-prettier prettier
// eslint.config.ts
import js from "@eslint/js";
import ts from "typescript-eslint";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import jsxA11y from "eslint-plugin-jsx-a11y";
import prettier from "eslint-config-prettier";

export default ts.config(
  js.configs.recommended,
  ...ts.configs.strict,
  ...ts.configs.stylistic,
  react.configs.flat.recommended,
  react.configs.flat["jsx-runtime"],
  {
    plugins: { "react-hooks": reactHooks, "jsx-a11y": jsxA11y },
    rules: {
      ...reactHooks.configs.recommended.rules,
      ...jsxA11y.configs.recommended.rules,
      "react/prop-types": "off",       // TypeScript covers this
    },
    settings: { react: { version: "detect" } },
  },
  prettier,                            // last — disables stylistic rules Prettier owns
);
// prettier.config.mjs
export default {
  semi: true,
  singleQuote: false,
  trailingComma: "all",
  printWidth: 100,
  tabWidth: 2,
};

Common recipes — Biome

Recipe 1 — `biome.json` baseline

{
  "$schema": "https://biomejs.dev/schemas/1.9.0/schema.json",
  "vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
  "files": { "ignore": ["dist", "node_modules", ".next", "out", "storybook-static"] },
  "formatter": {
    "enabled": true,
    "indentStyle": "space",
    "indentWidth": 2,
    "lineWidth": 100,
    "lineEnding": "lf"
  },
  "javascript": {
    "formatter": {
      "quoteStyle": "double",
      "trailingCommas": "all",
      "semicolons": "always"
    }
  },
  "linter": {
    "enabled": true,
    "rules": {
      "recommended": true,
      "a11y": { "useKeyWithClickEvents": "warn", "useValidAriaProps": "error" },
      "correctness": { "useExhaustiveDependencies": "error" },
      "suspicious": { "noExplicitAny": "warn", "noConsoleLog": "warn" },
      "style": { "noNonNullAssertion": "off" }
    }
  },
  "overrides": [
    { "include": ["*.tsx"], "linter": { "rules": { "style": { "noDefaultExport": "off" } } } }
  ]
}

Recipe 2 — package.json scripts

{
  "scripts": {
    "lint": "biome check .",
    "lint:fix": "biome check --write .",
    "format": "biome format --write .",
    "format:check": "biome format ."
  }
}

Recipe 3 — Pre-commit with lefthook

# lefthook.yml
pre-commit:
  parallel: true
  commands:
    biome:
      glob: "*.{js,jsx,ts,tsx,json,jsonc}"
      run: pnpm dlx biome check --write --no-errors-on-unmatched {staged_files}
      stage_fixed: true
pnpm add -D lefthook
pnpm exec lefthook install

Or with Husky + lint-staged:

// package.json
{
  "lint-staged": {
    "*.{js,jsx,ts,tsx,json}": ["biome check --write --no-errors-on-unmatched"]
  }
}

Recipe 4 — CI workflow

# .github/workflows/ci.yml
- uses: biomejs/setup-biome@v2
  with: { version: latest }
- run: biome ci .

biome ci is optimized for CI — single pass, focused output, fails fast.

Recipe 5 — Disable a single rule for one line

// biome-ignore lint/suspicious/noExplicitAny: third-party API returns any
const data: any = await thirdParty.fetch();

Recipe 6 — Per-file overrides

{
  "overrides": [
    {
      "include": ["**/*.test.ts", "**/*.spec.ts"],
      "linter": { "rules": { "suspicious": { "noExplicitAny": "off" } } }
    }
  ]
}

Common recipes — ESLint 9

Recipe 7 — Run lint

pnpm exec eslint . --max-warnings=0          # CI gate
pnpm exec eslint . --fix                     # auto-fix
pnpm exec eslint --print-config src/file.tsx # inspect effective config

Recipe 8 — TypeScript ESLint with typed lint rules

// eslint.config.ts
export default ts.config(
  ...ts.configs.recommendedTypeChecked,    // requires type info
  {
    languageOptions: {
      parserOptions: {
        project: "./tsconfig.json",
        tsconfigRootDir: import.meta.dirname,
      },
    },
  },
);

Slower but catches type-aware bugs (no-floating-promises,

no-misused-promises).

Common recipes — Oxlint

pnpm add -D oxlint
pnpm exec oxlint --import-plugin --tsconfig=tsconfig.json src

Oxlint runs the most common ESLint rules ~50-100x faster. Pairs well with

Prettier (Oxlint doesn't format). Good if you want fast lint but stay on

Prettier for formatting.

Examples

Example 1: Migrate a CRA project to Biome

pnpm add -D --save-exact @biomejs/biome
pnpm dlx biome migrate eslint --write
pnpm dlx biome migrate prettier --write
pnpm dlx biome check --write src/
# Remove eslint / prettier deps
pnpm remove eslint prettier $(pnpm list --depth 0 --json | jq -r '.[0].dependencies | keys[] | select(test("^(eslint|prettier)"))')
git rm .eslintrc* .prettierrc* .eslintignore .prettierignore

Example 2: ESLint flat config from scratch

pnpm create eslint                       # interactive config generator (ESLint 9+)
pnpm exec eslint . --fix

Edge cases / gotchas

(eslint-plugin-storybook, eslint-plugin-tailwindcss) may still need

ESLint. Run both side-by-side until parity.

keep it enabled.

per-file overrides.

on first migration. Review and accept.

the only supported format.

conflicting stylistic rules.

pre-commit and CI, not editor.

extension in VS Code. Set

"editor.defaultFormatter": "biomejs.biome".

(deterministic version); dlx downloads each time.

each handles. Most teams pick one.

Sources

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.