bdg-tooling

raw JSON →
1.5.1 verified Fri May 01 auth: no javascript

Shared tooling configuration package for TypeScript projects — provides zero-fuss, plain-object exports for tsconfig presets (node, library/react/nextjs/nestjs), Biome formatter/linter configs, commitlint rule sets, and lint-staged Biome runners. Current stable version 1.5.1 requires Node >=22, pnpm >=10, and peer deps: @biomejs/biome >=2, @commitlint/cli >=19, @commitlint/config-conventional >=19, husky >=9, lint-staged >=15, typescript >=5. Distributed as ESM-only tarball; includes an interactive CLI (`npx bdg-tooling init`) that scaffolds consumer projects, auto-detects package manager, and optionally sets up Husky git hooks. No runtime overhead — config exports are tiny JSON/JS files published from biome/, commitlint/, lint-staged/, tsconfig/ directories.

error Error [ERR_REQUIRE_ESM]: require() of ES Module /node_modules/bdg-tooling/lint-staged/biome.js from ... not supported.
cause lint-staged config is ESM, cannot be required() in a CommonJS lint-staged.config.js.
fix
Rename lint-staged.config.js to .mjs or use dynamic import: const config = await import('bdg-tooling/lint-staged/biome').then(m => m.default);
error Cannot find module 'bdg-tooling/tsconfig/base'
cause Consumer's tsconfig.json uses wrong path (e.g., dist/ or missing file extension).
fix
Use correct path without extension: "extends": "bdg-tooling/tsconfig/base"
error TypeError: Cannot read properties of undefined (reading 'conventional')
cause commitlint config not loaded correctly — likely using ESM import instead of CJS require.
fix
In commitlint.config.js: module.exports = require('bdg-tooling/commitlint');
error error: package.json requires a peer of @biomejs/biome@>=2.0.0 but none is installed
cause Missing peer dependency @biomejs/biome.
fix
Run: pnpm add -D @biomejs/biome
error Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'commander' imported from /node_modules/bdg-tooling/dist/cli/init.js
cause CLI uses commander but it may not be installed (missing peer dep).
fix
Run: pnpm add -D commander
breaking Requires Node >=22.0.0 and pnpm >=10.0.0; older runtimes fail with cryptic errors.
fix Upgrade Node to >=22 and pnpm to >=10, or use a different tool.
breaking Package is ESM-only; do not use require() for core config files (except commitlint).
fix Use import assertions for JSON; for tsconfig extends, never point to dist/.
gotcha commitlint config is CommonJS; must use module.exports = require(...) not ESM import.
fix In commitlint.config.js: module.exports = require('bdg-tooling/commitlint');
gotcha lint-staged config is ESM; use import not require().
fix import config from 'bdg-tooling/lint-staged/biome';
deprecated CLI --yes flag may be removed in future; interactive mode is preferred.
fix Omit --yes and let CLI prompt or pipe stdin.
gotcha tsconfig presets are not exported from package.json; they must be referenced by path: bdg-tooling/tsconfig/<preset>.
fix Use exact path relative to package root (no 'dist').
npm install bdg-tooling
yarn add bdg-tooling
pnpm add bdg-tooling

Installs bdg-tooling with required peers, runs the interactive init CLI to scaffold tsconfig, Biome, commitlint, lint-staged, and Husky setup.

// Install the package and required peer deps
pnpm add -D bdg-tooling typescript @biomejs/biome

// Optional but needed for husky/commitlint:
pnpm add -D husky lint-staged @commitlint/cli @commitlint/config-conventional

// Run the interactive CLI scanner:
npx bdg-tooling init

// The CLI will ask:
// - Project type (node/react/nextjs/nestjs/library)
// - Which tsconfig to create or patch
// - Whether to install deps now
// - Whether to set up Husky +
//   commitlint + lint-staged
//
// After completion, your tsconfig.json
// may look like:
{
  "extends": "bdg-tooling/tsconfig/react",
  "compilerOptions": {},
  "include": ["src"]
}

// For manual setup (no CLI):
// In tsconfig.json:
// { "extends": "bdg-tooling/tsconfig/node" }
//
// In biome.json:
// { "extends": ["bdg-tooling/biome/base"] }
//
// In commitlint.config.js:
// module.exports = require('bdg-tooling/commitlint');