Biome是一个现代化的工具链,支持 JavaScript、TypeScript、JSON 和 CSS 等主流 Web 开发语言,可以在几分之一秒内格式化和 lint 代码,旨在最终取代 Babel、ESLint、webpack、Prettier、Jest 等。


npm install --save-dev --save-exact @biomejs/biome



npx @biomejs/biome init
Welcome to Biome! Let's get you started...

Files created ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  - biome.json: Your project configuration. Documentation:

Next Steps ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  1. Setup an editor extension
     Get live errors as you type and format when you save. Learn more:

  2. Try a command
     biome ci checks for lint errors and verifies formatting. Run biome --help for a full list of commands and options.

  3. Read the documentation
     Our website serves as a comprehensive source of guides and documentation:

  4. Get involved in the community
     Ask questions, get support, or contribute by participating on GitHub (,
     or join our community Discord (


    "$schema": "",
    "organizeImports": {
        "enabled": true
    "linter": {
        "enabled": true,
        "rules": {
            "recommended": true


从 Visual Studio Marketplace 安装官方 Biome VS Code 扩展。编辑器右键使用...格式化文档可以选择Biome,可以修改biome.json调整格式化方案,默认格式化方案如下

  "formatter": {
    "enabled": true,
    "formatWithErrors": false,
    "indentStyle": "tab",
    "indentSize": 2,
    "lineWidth": 80,
    "ignore": []


使用以下命令运行 CLI 以检查可能的错误

npx @biomejs/biome lint ./src