@cfxlabsinc/b2b-services
    Preparing search index...

    Module @cfxlabsinc/nx-bun-lint

    @cfxlabsinc/nx-bun-lint

    Workspace-internal Nx plugin that gives every project its own cached lint and format targets, run with Bun's built-in bun lint and bun fmt.

    The plugin's createNodes watches for **/project.json and contributes two targets to every project except the workspace root.

    Configuration Command
    (default) bun lint <projectRoot>
    fix bun lint --fix <projectRoot>
    ci bun lint <projectRoot>
    nx run <pkg>:lint -c fix     # one project
    nx affected -t lint -c ci # what CI runs
    nx run-many -t lint -c fix # everything

    bun lint exits non-zero on errors only; warnings are advisory.

    Configuration Command
    (default) bun fmt <projectRoot>
    check / ci bun fmt --check <projectRoot>
    nx run-many -t format          # format everything
    nx affected -t format # only what changed
    nx run <pkg>:format -c check # dry run

    bun fmt formats every language it supports and sends .sql to the installed Prettier with prettier-plugin-sql.

    format runs the bun on PATH and hashes .bun-version. lint runs ${BUN_CANARY:-bun} and hashes ${BUN_CANARY:-bun} --revision: stable 1.4.4 shipped bun fmt but not bun lint, so CI points BUN_CANARY at a canary beside the pinned bun for lint alone. Unset, lint runs plain bun, which must then be a canary. CI also runs bun fmt --check at the repo root (ci:format-repo), which covers files outside any project; see rules/formatting.md.

    Its cache is tighter than lint's: formatting is purely local, so inputs omits ^production.

    One root config, no per-project files:

    • bunfig.toml [lint]: rules, overrides, ignore patterns. [fmt] for Bun-only formatter switches.
    • eslint-suppressions.json: the lint errors recorded as existing, per file and rule. bun lint fails when a file gains one, and when one is fixed until bun lint --prune-suppressions <path> removes it.
    • .prettierrc and .prettierignore: formatter options and exclusions.
    • tools/lint/n-plus-one.mjs: the local rule plugin [lint] plugins loads.

    All five are lint cache inputs. format takes all but eslint-suppressions.json and the plugin, which only bun lint reads. Both declare prettier and prettier-plugin-sql as external dependencies.

    Per-project targets are cacheable and nx affected-aware, so a one-package change lints one package. The workspace root is skipped explicitly (projectRoot === "."): it is its own Nx project, and a target there would re-check the whole repo as one task.

    inputs keeps ^production, not ^default: the type-aware rules (no-floating-promises, no-misused-promises) read a dependency's importable source, but never its *.test.ts or pulumi/.

    Registered in workspace nx.json under plugins, excluding the vendored Pulumi provider SDKs:

    {
    "plugin": "@cfxlabsinc/nx-bun-lint",
    "options": {},
    "exclude": ["packages/pulumi/sdks/*/**"]
    }

    Resolves through the workspace dependency in the root package.json:

    "@cfxlabsinc/nx-bun-lint": "workspace:*"
    
    NxBunLintPluginOptions
    createNodes