Skip to content

atharvdange618/Toolchain

Repository files navigation

@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 init

Features

  • Framework-aware - detects Next.js, Express, React, or plain TS and tailors ESLint rules accordingly
  • Monorepo-ready - detects workspaces / pnpm.workspaces and generates tsconfig project references with per-package eslint overrides
  • Zero-config - interactive prompts guide you through, or use --yes to 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 --yes

Note: npx @atharvdange/toolchain init will not work when the package's packageManager is set to pnpm (if you initialized a blank project with pnpm init), causing npm to throw an EBADDEVENGINES error. Use pnpm dlx, yarn dlx, or bunx instead.

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_agent first (set by the package manager that invoked the CLI), then lockfiles (pnpm-lock.yaml → pnpm, yarn.lock → yarn), then devEngines in package.json, else npm
  • Monorepo: checks for workspaces in package.json or pnpm.workspaces
  • Framework: checks dependencies / devDependencies for next, express, react

About

A reusable CLI that scaffolds a complete dev toolchain - ESLint, Prettier, Husky, commitlint, and strict TypeScript - into any JS/TS project with one command.

Topics

Resources

License

Stars

Watchers

Forks

Contributors