Interactive devtools setup for Node.js projects with ESLint, Prettier, Commitlint, Husky, and Lint-staged.
- Interactive CLI setup with framework detection
- Auto-install dependencies based on your project needs
- Support for React, Next.js, React Native, Tailwind CSS, and Storybook
- Git hooks with Husky and Lint-staged
- Commitlint with devmoji support
- Zero-config defaults for quick setup
npm install --save-dev @jjuidev/node-devtools
# or
yarn add --dev @jjuidev/node-devtools
# or
pnpm add -D @jjuidev/node-devtoolsThen run the interactive setup:
npx node-devtools
# or
yarn node-devtools
# or
pnpm node-devtoolsThe CLI will ask you questions about your project and automatically install the necessary dependencies.
npx node-devtoolsThis command will:
- Ask about your project setup (React, Next.js, Tailwind, etc.)
- Automatically install all required dependencies
- Detect your package manager (npm, yarn, pnpm, bun)
- Install ESLint, Prettier, Husky, Lint-staged, and related plugins
For CI/CD pipelines and automation, you can use non-interactive mode with CLI flags or stdin input:
# With specific options
npx node-devtools --framework react --tailwind yes --storybook no --alias yes --gitignore yes
# Accept all defaults
npx node-devtools -y
# Mixed mode (some flags + prompts for rest)
npx node-devtools --framework next --tailwind yesAvailable flags:
--framework <type>- Framework: node, react, react-native, next--tailwind <bool>- Use Tailwind CSS (yes/no)--storybook <bool>- Use Storybook (yes/no)--alias <bool>- Use TypeScript alias imports (yes/no)--gitignore <bool>- Add .gitignore file (yes/no)-y, --yes- Accept all defaults--non-interactive- Force non-interactive mode
# Provide answers via stdin (one per line)
echo -e "react\nyes\nno\nyes\nyes" | npx node-devtools
# From a file
cat answers.txt | npx node-devtoolsInput order for stdin:
- Framework (node/react/react-native/next or 1-4)
- Use Tailwind? (yes/no) - only for react/next
- Use Storybook? (yes/no) - only for react/next
- Use TypeScript alias? (yes/no)
- Add .gitignore? (yes/no)
Note: Tailwind and Storybook prompts are skipped for node and react-native frameworks.
The interactive command configures everything (Commitlint, ESLint, Prettier, Husky, Lint-staged). There are no separate setup or init subcommands in the current version. Use the interactive flow:
npx node-devtoolshusky- Git hookslint-staged- Run linters on staged fileseslint- JavaScript linterprettier- Code formatter@typescript-eslint/eslint-plugin- TypeScript ESLint rules@typescript-eslint/parser- TypeScript parser for ESLinteslint-config-prettier- Disable ESLint rules that conflict with Prettiereslint-plugin-prettier- Run Prettier as an ESLint ruleprettier-plugin-packagejson- Sort package.json
- React:
eslint-plugin-react,eslint-plugin-react-hooks - Next.js:
@next/eslint-plugin-next - React Native:
eslint-plugin-react-native - Tailwind CSS:
eslint-plugin-tailwindcss,prettier-plugin-tailwindcss - Storybook:
eslint-plugin-storybook
Create .commitlintrc.cjs:
const { commitlintConfigRecommend } = require('@jjuidev/node-devtools');
module.exports = commitlintConfigRecommend;Create .commitlintrc.cjs:
const { defineCommitlintConfig } = require('@jjuidev/node-devtools');
module.exports = defineCommitlintConfig((emojiList) => {
// Add or modify emoji types
return emojiList.filter((item) => item.type !== 'wip');
});const { defineCommitlintConfig } = require('@jjuidev/node-devtools');
module.exports = defineCommitlintConfig((emojiList) => {
return [
...emojiList,
{
type: 'docker',
code: ':docker:',
emoji: ':whale:',
description: 'Docker related changes'
}
];
});-
Install the package
npm install --save-dev @jjuidev/node-devtools
-
Run interactive setup
npx node-devtools
Answer the questions about your project setup.
-
Start committing!
git commit -m "feat: add new feature"Hooks are set up automatically; your commit will be validated and emoji will be added!
The recommended configuration includes the following commit types:
initπ - Initialize projectfeatβ¨ - Add new featurefixπ - Fix a bugchoreπ§ - Minor tasks or maintenancedocsπ - Update documentationstyleπ - Improve UI or code styleimproveπ - Improve code quality or performancerefactorβ»οΈ - Refactor code without changing logicperfβ‘ - Enhance performancetestβ - Add or update testsbuildποΈ - Changes related to the build systemciπ - Configure CI/CDrevertβͺ - Revert a previous commitmergeπ - Merge brancheswipπ§ - Work in progressreleaseπ - Release a new versionupgradeβ¬οΈ - Upgrade dependencies or softwaredowngradeβ¬οΈ - Downgrade dependencies or softwarebumpπ¦ - Bump package versionsecurityπ - Improve securityhotfixπ₯ - Urgent bug fixmaintainerπ - Maintainer commit and excellent handle for system
The CLI automatically detects your package manager based on lock files:
bun.lockbβ Bunpnpm-lock.yamlβ pnpmyarn.lockβ Yarn- Default β npm
The package includes TypeScript type definitions:
import type { CommitlintConfig, CommitEmoji } from '@jjuidev/node-devtools';We use Changesets for version management and publishing.
# Make your changes
npm run build
# Create a changeset
npm run changeset
# Commit your changes
git commit -m "feat: your feature"See CONTRIBUTING.md for detailed workflow.
See CHANGELOG.md for release history.
MIT
jjuidev jjuidev@gmail.com