@atharvdange/toolchain
v1.0.2
Published
Scaffold ESLint, Prettier, Husky, commitlint, and strict TypeScript into any JS/TS project
Maintainers
Readme
@atharvdange/toolchain
A reusable CLI that scaffolds a complete dev toolchain - ESLint, Prettier, Husky, commitlint, and strict TypeScript - into any JS/TS project with one command.
pnpm dlx @atharvdange/toolchain initFeatures
- Framework-aware - detects Next.js, Express, React, or plain TS and tailors ESLint rules accordingly
- Monorepo-ready - detects
workspaces/pnpm.workspacesand generates tsconfig project references with per-package eslint overrides - Zero-config - interactive prompts guide you through, or use
--yesto skip - All in one - linter, formatter, hooks, commit linting, and type checking
What it sets up
| Config | Generated variant |
| --------------------------------- | ------------------------------------------------- |
| .editorconfig | Static |
| .prettierrc / .prettierignore | Static |
| commitlint.config.js | Static |
| eslint.config.mjs | Plain TS / React / Next.js / Express rules |
| tsconfig.json | Flat strict config or monorepo project references |
| .husky/pre-commit | lint-staged + typecheck |
| .husky/commit-msg | commitlint |
| package.json | Scripts, lint-staged config, devDependencies |
Usage
# Interactive
pnpm dlx @atharvdange/toolchain init
# Non-interactive (defaults)
pnpm dlx @atharvdange/toolchain init --yesNote:
npx @atharvdange/toolchain initwill not work because the package'spackageManageris set topnpm, causing npm to throw anEBADDEVENGINESerror. Usepnpm dlx,yarn dlx, orbunxinstead.
ESLint variants
The generated eslint.config.mjs adapts based on what's in your package.json:
| Detected | Plugins included |
| -------- | ---------------------------------------------------------- |
| Plain TS | typescript-eslint, unicorn, perfectionist |
| React | Above + eslint-plugin-react, eslint-plugin-react-hooks |
| Next.js | Above + @next/eslint-plugin-next |
| Express | Same as Plain TS but no-unsafe-* rules relaxed to warn |
Detection logic
- Package manager: checks
npm_config_user_agentfirst (set by the package manager that invoked the CLI), then lockfiles (pnpm-lock.yaml→ pnpm,yarn.lock→ yarn), thendevEnginesin package.json, else npm - Monorepo: checks for
workspacesin package.json orpnpm.workspaces - Framework: checks
dependencies/devDependenciesfornext,express,react
