Skip to content

Publish packages

Biome can resolve configurations and plugins from packages installed in node_modules/. This allows you to publish them once and reuse them across projects.

For Biome v2.6 and later, publish plugins and configurations through a manifest named biome-manifest.json or biome-manifest.jsonc.

A manifest can export plugin rules, rule presets, and configurations.

Publish Biome plugins as npm packages by declaring their rules and presets in a Biome manifest.

  1. Create biome-manifest.json in the root of your package. Set the required version field and add an empty plugins.rules array:

    biome-manifest.json
    {
    "version": 1,
    "plugins": {
    "rules": []
    }
    }
  2. Add a sample rule named useCompanyLogger by mapping its name to the GritQL file in plugins.rules:

    biome-manifest.json
    {
    "version": 1,
    "plugins": {
    "rules": [
    { "useCompanyLogger": "./rules/useCompanyLogger.grit" }
    ]
    }
    }

    The rules array accepts objects and strings. Use an object to map a rule name to a GritQL file in your package. Use a string to re-export a rule or preset from a dependency.

  3. Add the manifest and rule files to the files field in package.json. Then add a biome entry to the exports field that maps to the manifest:

    package.json
    {
    "name": "@org/biome-plugins",
    "version": "1.0.0",
    "files": [
    "biome-manifest.json",
    "rules"
    ],
    "exports": {
    "biome": "./biome-manifest.json"
    }
    }
  4. Publish the package, then install @org/biome-plugins as a dependency of the consuming project. To enable a rule, add <PACKAGE_NAME>/<RULE_NAME> to plugins:

    biome.json
    {
    "plugins": ["@org/biome-plugins/useCompanyLogger"]
    }

Publish groups of related rules as presets by declaring them in a Biome manifest. Presets allow consumers to enable multiple rules together.

  1. Add a plugins.presets field. This example defines recommended and strict presets:

    biome-manifest.json
    {
    "version": 1,
    "plugins": {
    "rules": [
    { "useCompanyLogger": "./rules/useCompanyLogger.grit" },
    { "noLegacyLibrary": "./rules/noLegacyLibrary.grit" }
    ],
    "presets": {
    "recommended": ["useCompanyLogger"],
    "strict": ["useCompanyLogger", "noLegacyLibrary"]
    }
    }
    }
  2. To enable a preset, add <PACKAGE_NAME>/presets/<PRESET_NAME> to plugins. This example enables the recommended preset:

    biome.json
    {
    "plugins": ["@org/biome-plugins/presets/recommended"]
    }

You can re-export rules from dependencies through your package.

The following example uses a hypothetical biome-ux-plugins package and re-exports its minimal preset and its noExternalLinks rule, which is not part of that preset.

  1. Add biome-ux-plugins/noExternalLinks and biome-ux-plugins/presets/minimal to rules, then add biome-ux-plugins/noExternalLinks to the recommended preset:

    biome-manifest.json
    {
    "version": 1,
    "plugins": {
    "rules": [
    "biome-ux-plugins/noExternalLinks",
    "biome-ux-plugins/presets/minimal",
    { "useCompanyLogger": "./rules/useCompanyLogger.grit" },
    { "noLegacyLibrary": "./rules/noLegacyLibrary.grit" }
    ],
    "presets": {
    "recommended": [
    "useCompanyLogger",
    "biome-ux-plugins/noExternalLinks"
    ],
    "strict": ["useCompanyLogger", "noLegacyLibrary"]
    }
    }
    }
  2. Consumers access re-exported rules through your package name. This keeps rule names and suppression comments stable if you replace the underlying rule.

    The following configuration enables the package’s recommended preset and useAnimationFallback, a rule re-exported from biome-ux-plugins/presets/minimal:

    biome.json
    {
    "plugins": [
    "@org/biome-plugins/presets/recommended",
    "@org/biome-plugins/useAnimationFallback"
    ]
    }

Publish configurations as npm packages by declaring them in a Biome manifest. To support consumers using a Biome version earlier than v2.6, use the legacy method.

  1. Create biome-manifest.json in the root of your package. Set the required version field and map each configuration name to its file in configs:

    biome-manifest.json
    {
    "version": 1,
    "configs": [
    { "recommended": "./configs/recommended.json" },
    { "strict": "./configs/strict.json" }
    ]
    }
  2. Add the manifest and configuration files to the files field in package.json. Then add a biome entry to the exports field that maps to the manifest:

    package.json
    {
    "name": "@org/biome-configs",
    "version": "1.0.0",
    "files": [
    "biome-manifest.json",
    "configs"
    ],
    "exports": {
    "biome": "./biome-manifest.json"
    }
    }
  3. Publish the package, then install @org/biome-configs as a dependency of the consuming project. To extend a configuration, add <PACKAGE_NAME>/configs/<CONFIG_NAME> to extends:

    biome.json
    {
    "extends": ["@org/biome-configs/configs/strict"]
    }

Re-export configurations from another package

Section titled “Re-export configurations from another package”

You can re-export configurations from dependencies through your package.

The following example uses the same hypothetical biome-ux-plugins package and re-exports its nuxt and astro configurations.

  1. Add biome-ux-plugins/configs/nuxt and biome-ux-plugins/configs/astro to configs:

    biome-manifest.json
    {
    "version": 1,
    "configs": [
    "biome-ux-plugins/configs/nuxt",
    "biome-ux-plugins/configs/astro",
    { "recommended": "./configs/recommended.json" },
    { "strict": "./configs/strict.json" }
    ]
    }
  2. Consumers access re-exported configurations through your package name. This keeps configuration references stable if you replace the underlying configuration.

    In this example, the configurations from biome-ux-plugins are available under @org/biome-configs. To extend the nuxt configuration, add @org/biome-configs/configs/nuxt:

    biome.json
    {
    "extends": ["@org/biome-configs/configs/nuxt"]
    }

Publish and share a configuration (legacy)

Section titled “Publish and share a configuration (legacy)”
  1. Add a ./biome entry to the exports field that maps to the shared configuration. This example publishes @org/shared-configs/biome:

    package.json
    {
    "name": "@org/shared-configs",
    "type": "module",
    "exports": {
    "./biome": "./biome.json"
    }
    }
  2. Install @org/shared-configs in the consuming project, then add @org/shared-configs/biome to extends in biome.json:

    biome.json
    {
    "extends": ["@org/shared-configs/biome"]
    }

Biome resolves @org/shared-configs from the working directory. For CLI commands, this is the directory where the command runs, usually the directory containing package.json. For the Biome Language Server, this is the project root.