From bd9664bc3be7d8b06ac9c0c74056a0b51ff4eb95 Mon Sep 17 00:00:00 2001 From: Jakub Nowakowski Date: Mon, 9 Nov 2026 14:41:13 +0100 Subject: [PATCH] Make oxlint and oxfmt optional peer dependencies Each export configures one tool, and a repository may use only one of them, for example oxlint with bun fmt. Both tools were required peers, so the package manager installed both everywhere. As optional peers, a repository installs only the tools it adds. pnpm still warns when an added tool is outside the peer range. --- README.md | 2 +- package.json | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e900bc..0bb6056 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Two details are easy to miss: ## Requirements - Node.js 22.18 or newer, because oxlint and oxfmt load `*.config.ts` through Node's own TypeScript support. -- The npm packages `oxlint` (1.81.0 or newer) and `oxfmt` (0.66.0 or newer). The standalone binaries do not load TypeScript configs. +- The npm package of each tool you use: `oxlint` (1.81.0 or newer) for the oxlint config, `oxfmt` (0.66.0 or newer) for the oxfmt config. The standalone binaries do not load TypeScript configs. Both are optional peers, so the package manager installs only the ones you add. - `oxlint-tsgolint` for `--type-aware`. ## Development diff --git a/package.json b/package.json index a473693..2376749 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,14 @@ "oxfmt": ">=0.66.0", "oxlint": ">=1.81.0" }, + "peerDependenciesMeta": { + "oxfmt": { + "optional": true + }, + "oxlint": { + "optional": true + } + }, "engines": { "node": ">=22.18.0" },