bdg-tooling
raw JSON →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.
Common errors
error Error [ERR_REQUIRE_ESM]: require() of ES Module /node_modules/bdg-tooling/lint-staged/biome.js from ... not supported. ↓
error Cannot find module 'bdg-tooling/tsconfig/base' ↓
error TypeError: Cannot read properties of undefined (reading 'conventional') ↓
error error: package.json requires a peer of @biomejs/biome@>=2.0.0 but none is installed ↓
error Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'commander' imported from /node_modules/bdg-tooling/dist/cli/init.js ↓
Warnings
breaking Requires Node >=22.0.0 and pnpm >=10.0.0; older runtimes fail with cryptic errors. ↓
breaking Package is ESM-only; do not use require() for core config files (except commitlint). ↓
gotcha commitlint config is CommonJS; must use module.exports = require(...) not ESM import. ↓
gotcha lint-staged config is ESM; use import not require(). ↓
deprecated CLI --yes flag may be removed in future; interactive mode is preferred. ↓
gotcha tsconfig presets are not exported from package.json; they must be referenced by path: bdg-tooling/tsconfig/<preset>. ↓
Install
npm install bdg-tooling yarn add bdg-tooling pnpm add bdg-tooling Imports
- tsconfig presets wrong
{ "extends": "bdg-tooling/dist/tsconfig/node" }correct{ "extends": "bdg-tooling/tsconfig/node" } - Biome configs wrong
require('bdg-tooling/biome/base.json')correctimport biomeConfig from 'bdg-tooling/biome/base.json' assert { type: 'json' }; - commitlint config wrong
import commitlintConfig from 'bdg-tooling/commitlint'correctmodule.exports = require('bdg-tooling/commitlint'); - lint-staged config wrong
const lintStagedConfig = require('bdg-tooling/lint-staged/biome')correctimport lintStagedConfig from 'bdg-tooling/lint-staged/biome'; - CLI wrong
pnpm dlx bdg-tooling init --yescorrectnpx bdg-tooling init
Quickstart
// 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');