{"id":24986,"library":"bdg-tooling","title":"bdg-tooling","description":"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.","status":"active","version":"1.5.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install bdg-tooling","lang":"bash","label":"npm"},{"cmd":"yarn add bdg-tooling","lang":"bash","label":"yarn"},{"cmd":"pnpm add bdg-tooling","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Formatter/linter configs target Biome >=2","package":"@biomejs/biome","optional":false},{"reason":"tsconfig presets require TypeScript >=5","package":"typescript","optional":false},{"reason":"commitlint config requires the CLI to enforce Conventional Commits","package":"@commitlint/cli","optional":true},{"reason":"Commitlint rule set for conventional commits","package":"@commitlint/config-conventional","optional":true},{"reason":"Git hooks used by lint-staged and commitlint","package":"husky","optional":true},{"reason":"Run Biome on staged files","package":"lint-staged","optional":true}],"imports":[{"note":"Presets are published in the tsconfig/ directory; never import from dist/.","wrong":"{ \"extends\": \"bdg-tooling/dist/tsconfig/node\" }","symbol":"tsconfig presets","correct":"{ \"extends\": \"bdg-tooling/tsconfig/node\" }"},{"note":"Package is ESM-only; use import assertions for JSON files.","wrong":"require('bdg-tooling/biome/base.json')","symbol":"Biome configs","correct":"import biomeConfig from 'bdg-tooling/biome/base.json' assert { type: 'json' };"},{"note":"commitlint config is CommonJS; use require() in commitlint.config.js.","wrong":"import commitlintConfig from 'bdg-tooling/commitlint'","symbol":"commitlint config","correct":"module.exports = require('bdg-tooling/commitlint');"},{"note":"lint-staged config exports ESM default; import for ESM projects.","wrong":"const lintStagedConfig = require('bdg-tooling/lint-staged/biome')","symbol":"lint-staged config","correct":"import lintStagedConfig from 'bdg-tooling/lint-staged/biome';"},{"note":"Use npx or pnpm dlx without extra flags; --yes may skip prompts.","wrong":"pnpm dlx bdg-tooling init --yes","symbol":"CLI","correct":"npx bdg-tooling init"}],"quickstart":{"code":"// Install the package and required peer deps\npnpm add -D bdg-tooling typescript @biomejs/biome\n\n// Optional but needed for husky/commitlint:\npnpm add -D husky lint-staged @commitlint/cli @commitlint/config-conventional\n\n// Run the interactive CLI scanner:\nnpx bdg-tooling init\n\n// The CLI will ask:\n// - Project type (node/react/nextjs/nestjs/library)\n// - Which tsconfig to create or patch\n// - Whether to install deps now\n// - Whether to set up Husky +\n//   commitlint + lint-staged\n//\n// After completion, your tsconfig.json\n// may look like:\n{\n  \"extends\": \"bdg-tooling/tsconfig/react\",\n  \"compilerOptions\": {},\n  \"include\": [\"src\"]\n}\n\n// For manual setup (no CLI):\n// In tsconfig.json:\n// { \"extends\": \"bdg-tooling/tsconfig/node\" }\n//\n// In biome.json:\n// { \"extends\": [\"bdg-tooling/biome/base\"] }\n//\n// In commitlint.config.js:\n// module.exports = require('bdg-tooling/commitlint');","lang":"javascript","description":"Installs bdg-tooling with required peers, runs the interactive init CLI to scaffold tsconfig, Biome, commitlint, lint-staged, and Husky setup."},"warnings":[{"fix":"Upgrade Node to >=22 and pnpm to >=10, or use a different tool.","message":"Requires Node >=22.0.0 and pnpm >=10.0.0; older runtimes fail with cryptic errors.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use import assertions for JSON; for tsconfig extends, never point to dist/.","message":"Package is ESM-only; do not use require() for core config files (except commitlint).","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"In commitlint.config.js: module.exports = require('bdg-tooling/commitlint');","message":"commitlint config is CommonJS; must use module.exports = require(...) not ESM import.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"import config from 'bdg-tooling/lint-staged/biome';","message":"lint-staged config is ESM; use import not require().","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Omit --yes and let CLI prompt or pipe stdin.","message":"CLI --yes flag may be removed in future; interactive mode is preferred.","severity":"deprecated","affected_versions":">=1.5.0"},{"fix":"Use exact path relative to package root (no 'dist').","message":"tsconfig presets are not exported from package.json; they must be referenced by path: bdg-tooling/tsconfig/<preset>.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"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);","cause":"lint-staged config is ESM, cannot be required() in a CommonJS lint-staged.config.js.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /node_modules/bdg-tooling/lint-staged/biome.js from ... not supported."},{"fix":"Use correct path without extension: \"extends\": \"bdg-tooling/tsconfig/base\"","cause":"Consumer's tsconfig.json uses wrong path (e.g., dist/ or missing file extension).","error":"Cannot find module 'bdg-tooling/tsconfig/base'"},{"fix":"In commitlint.config.js: module.exports = require('bdg-tooling/commitlint');","cause":"commitlint config not loaded correctly — likely using ESM import instead of CJS require.","error":"TypeError: Cannot read properties of undefined (reading 'conventional')"},{"fix":"Run: pnpm add -D @biomejs/biome","cause":"Missing peer dependency @biomejs/biome.","error":"error: package.json requires a peer of @biomejs/biome@>=2.0.0 but none is installed"},{"fix":"Run: pnpm add -D commander","cause":"CLI uses commander but it may not be installed (missing peer dep).","error":"Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'commander' imported from /node_modules/bdg-tooling/dist/cli/init.js"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}