# SonarJS: Support Bun root catalog for catalog: dependencies

**URL:** <https://community.sonarsource.com/t/sonarjs-support-bun-root-catalog-for-catalog-dependencies/187970>\
**Category:** Suggest new features\
**Created:** [September 5, 2026, 7:42pm UTC](https://community.sonarsource.com/t/sonarjs-support-bun-root-catalog-for-catalog-dependencies/187970 "2026-09-05T19:42:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mynameistito](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mynameistito/32/77423_2.png) [@mynameistito](https://community.sonarsource.com/u/mynameistito)\
**Post date:** [September 5, 2026, 7:42pm UTC](https://community.sonarsource.com/t/sonarjs-support-bun-root-catalog-for-catalog-dependencies/187970/1 "2026-09-05T19:42:19Z")

</div>

SonarJS does not correctly resolve Bun’s default catalog when it is defined at the root of `package.json`.

Originally reported here:

> <https://github.com/oxc-project/oxc/issues/26346>
>
> \### What version of Oxlint are you using?
> 
> ^1.81.0
> 
> \### What command did you run…?
> 
> \`oxlint .\`
> 
> \### What does your \`.oxlintrc.json\` (or \`oxlint.config.ts\`) config file look like?
> \`\`\`ts
> import { defineConfig } from "oxlint";
> import antiSlop from "ultracite/oxlint/anti-slop";
> import core from "ultracite/oxlint/core";
> import { jsPluginSettings, selectJsPlugins } from "ultracite/oxlint/js-plugins";
> import react from "ultracite/oxlint/react";
> import tanstack from "ultracite/oxlint/tanstack";
> import tanstackJsPlugins from "ultracite/oxlint/tanstack/js-plugins";
> import vitest from "ultracite/oxlint/vitest";
> 
> const jsPlugins = selectJsPlugins(\["github", "sonarjs", "react-doctor"\]);
> 
> export default defineConfig({
> extends: \[
> antiSlop,
> core,
> react,
> vitest,
> tanstack,
> tanstackJsPlugins,
> jsPlugins,
> \],
> ignorePatterns: core.ignorePatterns,
> jsPlugins: jsPlugins.jsPlugins,
> overrides: \[
> {
> // These tests intentionally exercise plain-http URLs: the feature
> // under test is which http:// URLs are accepted for local dev.
> files: \["apps/mobile/src/\_\_tests\_\_/flows.test.ts"\],
> rules: { "sonarjs/no-clear-text-protocols": "off" },
> },
> {
> // TanStack file-based routing mandates $ and \_\_ route filename segments.
> files: \["apps/web/src/routes/\*\*", "apps/web/src/routeTree.gen.ts"\],
> rules: { "github/filenames-match-regex": "off" },
> },
> {
> // Expo Router mandates \_layout and route filenames.
> files: \["apps/mobile/src/app/\*\*"\],
> rules: { "github/filenames-match-regex": "off" },
> },
> {
> // Metro bundler config must be CommonJS.
> files: \["apps/mobile/metro.config.js"\],
> rules: { "unicorn/prefer-module": "off" },
> },
> \],
> settings: jsPluginSettings,
> });
> \`\`\`
> 
> \### What happened?
> 
> Bun \`1.4.0\`. Default catalog defined at \*\*top-level\*\* root \`package.json\` \`"catalog"\` (Bun-supported form).
> 
> \### Minimal package.json
> 
> \`\`\`json
> {
> "workspaces": \["apps/\*", "packages/\*", "tooling/\*"\],
> "devDependencies": {
> "@types/bun": "catalog:",
> "effect": "catalog:",
> "hono": "catalog:",
> "vitest": "catalog:"
> },
> "catalog": {
> "@types/bun": "1.4.0",
> "effect": "4.0.0-rc.112",
> "hono": "4.13.7",
> "vitest": "5.0.0"
> },
> "packageManager": "bun@1.4.0"
> }
> \`\`\`
> 
> \`bun install\` resolves these correctly.
> 
> \### What happened?
> 
> \`\`\`text
> Dependency "@types/bun" could not be resolved for catalog "default"
> Dependency "effect" could not be resolved for catalog "default"
> Dependency "hono" could not be resolved for catalog "default"
> Dependency "vitest" could not be resolved for catalog "default"
> \`\`\`
> 
> Still \*\*0 warnings / 0 errors\*\*, exit \*\*0\*\*.
> 
> \### Expected
> 
> Resolve bare \`catalog:\` against Bun’s default catalog from root \`package.json\`:
> 
> \- top-level \`"catalog": { … }\` (this case), and/or
> \- \`"workspaces": { "packages": \[...\], "catalog": { … } }\`
> 
> Do not emit unresolved-catalog warnings when those entries exist.
> 
> \### Note
> 
> Message uses catalog \`"default"\` (pnpm naming). Bun’s default catalog is the singular \`"catalog"\` field, not necessarily \`catalogs.default\`.

Oxc traced the warning to SonarJS:

> <https://github.com/SonarSource/SonarJS/blob/421f28194fc279fabd3d7b170ed51d6229d4273a/packages/analysis/src/jsts/rules/helpers/dependency-manifests/resolvers/package-json.ts#L150>

Example:

```auto
{
  "dependencies": {
    "effect": "catalog:"
  },
  "catalog": {
    "effect": "4.0.0-rc.112"
  }
}

```

Bun resolves this correctly, but SonarJS outputs:

```auto
Dependency "effect" could not be resolved for catalog "default"

```

Expected: bare `catalog:` should resolve against Bun’s top-level `"catalog"` field without emitting the warning.

---

<div class="post-metadata">

**Author:** ![mynameistito](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mynameistito/32/77423_2.png) [@mynameistito](https://community.sonarsource.com/u/mynameistito)\
**Post date:** [September 6, 2026, 5:45am UTC](https://community.sonarsource.com/t/sonarjs-support-bun-root-catalog-for-catalog-dependencies/187970/2 "2026-09-06T05:45:08Z")

</div>

Related PR’s and Jira

> <https://github.com/SonarSource/SonarJS/pull/7009>
>
> \## Summary
> 
> Use the current \`package.json\` as a Bun catalog source before fallin…g back to parent \`package.json\` files or \`pnpm-workspace.yaml\`.
> 
> This fixes the case where the workspace root defines Bun catalogs and also consumes its own \`catalog:\` dependencies.
> 
> \## Testing
> 
> \- \`npm ci\`
> \- \`npx tsx --tsconfig packages/tsconfig.test.json --test --test-reporter=spec --test-reporter-destination=stdout packages/analysis/tests/dependency-manifests.test.ts\`
> \- \`npm run bbf\`

> **[Jira](https://sonarsource.atlassian.net/browse/JS-1728)**

---

<div class="post-metadata">

**Author:** ![andres](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/andres/32/76342_2.png) [@andres](https://community.sonarsource.com/u/andres)\
**Post date:** [September 9, 2026, 9:33am UTC](https://community.sonarsource.com/t/sonarjs-support-bun-root-catalog-for-catalog-dependencies/187970/3 "2026-09-09T09:33:12Z")

</div>

Hey @mynameistito, welcome to the Community!

It seems like [the closed PR you linked](https://github.com/SonarSource/SonarJS/pull/7009) saw some activity recently when [a user commented](https://github.com/SonarSource/SonarJS/pull/7009#issuecomment-5557180303) that we made mistake in assuming this wasn’t supported. It’s quite great timing that you brought this up at the same time as this happened! (was it you who commented in the PR? 👀)

We now have [another PR](https://github.com/SonarSource/SonarJS/pull/7892) to finally address this, so I recommend you follow the progress there.

---

<div class="post-metadata">

**Author:** ![victor.diez](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/victor.diez/32/38525_2.png) [@victor.diez](https://community.sonarsource.com/u/victor.diez)\
**Post date:** [September 9, 2026, 10:01am UTC](https://community.sonarsource.com/t/sonarjs-support-bun-root-catalog-for-catalog-dependencies/187970/5 "2026-09-09T10:01:03Z")

</div>

Hello @mynameistito,

thanks for the heads up. We are aware and this will be fixed in the coming days.

Cheers!  
Victor

---

<div class="post-metadata">

**Author:** ![mynameistito](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mynameistito/32/77423_2.png) [@mynameistito](https://community.sonarsource.com/u/mynameistito)\
**Post date:** [September 9, 2026, 11:00am UTC](https://community.sonarsource.com/t/sonarjs-support-bun-root-catalog-for-catalog-dependencies/187970/6 "2026-09-09T11:00:30Z")

</div>

Too easy legend!

I saw it on git being re implemented tyty!

- Tito
