
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
dev-infrastructure-setup
Advanced tools
Shareable development infrastructure setup for TypeScript/React Native projects
A shareable development infrastructure package for TypeScript/React Native/Node.js projects with ESLint, Prettier, Husky, Jest, and comprehensive AI development guidelines.
✅ ESLint - TypeScript-ready linting with Prettier integration ✅ Prettier - Consistent code formatting ✅ Husky - Git hooks for pre-commit and pre-push validation ✅ Jest - Testing setup with coverage support ✅ TypeScript - Strict type checking configuration ✅ CLAUDE.md - Comprehensive AI assistant development guide ✅ NPM Scripts - Pre-configured development workflow commands
Run this command in your project directory:
npx @benashman/dev-infrastructure
Or if you've published it to npm:
npm install -g @benashman/dev-infrastructure
setup-dev-infra
The setup script will:
package.jsonCLAUDE.md with development guidelinesIf you prefer to set up manually or the automated script doesn't work:
npm install --save-dev \
@typescript-eslint/eslint-plugin@^8.20.0 \
@typescript-eslint/parser@^8.20.0 \
eslint@^9.18.0 \
eslint-config-prettier@^9.1.0 \
eslint-plugin-prettier@^5.2.1 \
prettier@^3.4.2 \
husky@^9.1.7 \
lint-staged@^16.2.7 \
@types/jest@^29.5.14 \
jest@^29.7.0
Copy these files from the package to your project root:
eslint.config.js.prettierrc.prettierignorejest.config.jsCLAUDE.mdnpx husky init
Then copy the pre-commit and pre-push hooks to .husky/ directory.
{
"scripts": {
"typecheck": "tsc --noEmit",
"lint": "npx eslint .",
"lint:fix": "npx eslint . --fix",
"format": "npx prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
"format:check": "npx prettier --check \"**/*.{ts,tsx,js,jsx,json,md}\"",
"check:all": "npm run format:check && npm run lint && npm run typecheck",
"fix:all": "npm run format && npm run lint:fix && npm run typecheck",
"pre-commit": "npm run format && npm run lint:fix && npm run typecheck",
"pre-push": "npm run typecheck && npm run lint && npm run test",
"test": "npx jest",
"test:watch": "npx jest --watch",
"test:coverage": "npx jest --coverage",
"prepare": "husky"
},
"lint-staged": {
"*.{ts,tsx}": [
"npx eslint --fix",
"npx prettier --write"
],
"*.{js,jsx,json,md}": [
"npx prettier --write"
]
}
}
After installation, you'll have these npm scripts available:
npm run lint # Check for linting errors
npm run lint:fix # Auto-fix linting errors
npm run format # Format all files with Prettier
npm run format:check # Check formatting without modifying files
npm run typecheck # Run TypeScript type checking
npm test # Run all tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coverage report
npm run check:all # Run format check, lint, and typecheck
npm run fix:all # Run format, lint fix, and typecheck
Automatically runs on every commit:
lint-staged)Bypass: git commit --no-verify
Automatically runs before every push:
npm run check:all)Bypass: git push --no-verify
eslint.config.js)@typescript-eslintconsole.log (allows console.warn and console.error)prefer-const and no var.prettierrc)jest.config.js)@/ → src/)src/**/*.{ts,tsx}Update your tsconfig.json to include:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}
The package includes a comprehensive CLAUDE.md file with:
Customize it with your project-specific information!
On Unix/Mac:
chmod +x .husky/pre-commit .husky/pre-push
On Windows: Hooks should work automatically. If not, ensure Git is configured:
git config core.hooksPath .husky
Make sure your tsconfig.json includes the path aliases:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}
Ensure you're running ESLint from the project root:
npx eslint .
Try clearing npm cache:
npm cache clean --force
npm install
Edit eslint.config.js and update the rules section:
rules: {
'no-console': 'off', // Allow all console statements
'@typescript-eslint/no-explicit-any': 'error', // Make 'any' an error instead of warning
}
Edit .prettierrc:
{
"singleQuote": false, // Use double quotes
"printWidth": 120 // Wider lines
}
Edit .husky/pre-commit or .husky/pre-push:
#!/bin/sh
# Add your custom validation here
npm run custom-check
Want to create your own version of this package?
git clone <this-repo>
cd dev-setup-package
# Customize configs, scripts, CLAUDE.md
In package.json:
{
"name": "@yourname/dev-infrastructure",
"version": "1.0.0"
}
npm login
npm publish --access public
npx @yourname/dev-infrastructure
dev-setup-package/
├── bin/
│ └── setup.js # Main setup script
├── configs/
│ ├── eslint.config.js # ESLint configuration
│ ├── .prettierrc # Prettier configuration
│ ├── .prettierignore # Prettier ignore patterns
│ └── jest.config.js # Jest configuration
├── templates/
│ ├── CLAUDE.md # AI development guide
│ └── husky-hooks/
│ ├── pre-commit # Pre-commit git hook
│ └── pre-push # Pre-push git hook
├── package.json
└── README.md
Found a bug or want to add a feature?
git checkout -b feature/amazing-feature)git commit -m 'feat: add amazing feature')git push origin feature/amazing-feature)MIT © Ben Ashman
For issues or questions:
Happy coding! 🎉
FAQs
Shareable development infrastructure setup for TypeScript/React Native projects
We found that dev-infrastructure-setup demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.