@berenddeboer/nx-biome

中文文档
1.0.3发布于 2026/04/03MITTypeScriptCommonJS构建来源已验证近 30 天下载 1.5万

Nx self-inferring plugin for Biome linter and formatter with batch processing support

原始使用文档
文档目录15 节
  1. Table of Contents
  2. Features
  3. Install
  4. Usage
  5. Plugin Setup
  6. Basic Usage
  7. Batch Mode (Recommended for CI)
  8. All Projects
  9. Configuration
  10. Plugin Options
  11. Executor Options
  12. Biome Configuration
  13. Caching
  14. Contributing
  15. License

@berenddeboer/nx-biome

A self-inferring Nx plugin for Biome - a fast linter and formatter for JavaScript, TypeScript, JSON, and CSS. This plugin includes support for batch processing, which dramatically speeds up linting in monorepos.

Table of Contents

Features

  • Self-inferring plugin that automatically adds lint targets to all projects
  • Standard executor for single project linting
  • Batch executor for running Biome once across all affected projects - massive performance improvement for large monorepos
  • Caching support for faster subsequent runs

Install

npm
npm install --save-dev @berenddeboer/nx-biome
pnpm
pnpm add --save-dev @berenddeboer/nx-biome
yarn
yarn add --dev @berenddeboer/nx-biome
bun
bun add -D @berenddeboer/nx-biome

Usage

Plugin Setup

Add the plugin to your nx.json:

{
  "plugins": [
    {
      "plugin": "@berenddeboer/nx-biome",
      "options": {
        "targetName": "lint"
      }
    }
  ]
}

This will automatically add a lint target to all projects in your workspace.

Basic Usage

Run linting for a single project:

nx lint my-project

Run linting for all affected projects:

nx affected -t lint

The --batch flag enables batch processing, which runs Biome once for all affected projects instead of spawning separate processes for each project. This can provide massive performance improvements in monorepos with many projects.

nx affected -t lint --batch

Why use --batch?

In a typical Nx setup, running nx affected -t lint spawns a separate Biome process for each affected project. With the batch executor:

  • Biome is invoked only once with all project directories
  • No process spawning overhead per project
  • Biome can optimize its internal caching across all directories
  • Significantly faster execution, especially in CI environments

Example performance improvement:

ProjectsWithout --batchWith --batch
10~15s~3s
50~60s~8s
100~120s~12s

Actual times depend on project size and machine specifications.

All Projects

Run linting for all projects:

nx run-many -t lint
nx run-many -t lint --batch

Configuration

Plugin Options

OptionTypeDefaultDescription
targetNamestringlintThe name of the target to create for each project

Executor Options

OptionTypeDefaultDescription
projectRootstring.The root directory of the project

Biome Configuration

This plugin expects a biome.json or biome.jsonc configuration file at the workspace root or in individual project directories. See the Biome configuration documentation for details.

Caching

The plugin configures Nx caching with appropriate inputs:

  • Project-level biome.json / biome.jsonc
  • Workspace-level biome.json / biome.jsonc
  • Source files: *.ts, *.tsx, *.js, *.jsx, *.mjs, *.json, *.jsonc, *.css, *.md

This ensures the cache is invalidated when relevant files change.

Contributing

See the contributing file!

PRs accepted.

License

This project is MIT licensed.

版本与发布记录

@berenddeboer/nx-biome 共发布 4 个版本,首次发布于 2025/12/15;过去 12 个月发布了 4 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.0.3latest2026/04/037 个月前
1.0.22025/12/2310 个月前
1.0.12025/12/1510 个月前
1.0.02025/12/1510 个月前

关于 @berenddeboer/nx-biome 的常见问题

@berenddeboer/nx-biome 是什么?

Nx self-inferring plugin for Biome linter and formatter with batch processing support

如何安装 @berenddeboer/nx-biome?

在项目目录运行 npm install @berenddeboer/nx-biome,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@nx/devkit(^20.6.4 || ^21.0.0 || ^22.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@berenddeboer/nx-biome 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@berenddeboer/nx-biome 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@berenddeboer/nx-biome 可以商用吗?

@berenddeboer/nx-biome 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@berenddeboer/nx-biome 的下载量有多少?

根据 npm 官方下载统计,@berenddeboer/nx-biome 在 2026/10/08 – 2026/11/06 这 30 天内被下载 14,737 次,日均约 491 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@berenddeboer/nx-biome 还在维护吗?

最新版本 1.0.3 发布于 2026/04/03(7 个月前);至今共发布 4 个版本,其中过去 12 个月发布了 4 个;首次发布于 2025/12/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。