A template for quick project startup with configured code quality tools and automated testing.
- Remove anything you don't need (packages, rules, scripts, docs)
- Use AI to speed up onboarding and edits:
- Cursor AI / Continue.dev — code understanding, refactors, quick edits
- MCP Context7 + BrowserMCP — fetch up-to-date docs and examples
# Enable Corepack
corepack enable
# Clone repository
git clone <repository-url>
cd eslint-cspell-commitlint-lefthook-template
# Install dependencies
yarn install
# Install Git hooks
yarn lefthook install# Full CI testing (including builds)
yarn lefthook run ci# Code quality checks
yarn check-eslint-all
yarn check-prettier-all
yarn check-cspell-all
yarn test
# Build projects
yarn workspace @some-name/trpc-service build
yarn workspace @some-name/vite-mantine build
# Run in development mode
yarn workspace @some-name/trpc-service start
yarn workspace @some-name/vite-mantine dev- ESLint — JavaScript/TypeScript linting with custom rules
- Prettier — automatic code formatting
- cSpell — spell checking in comments
- Commitlint — commit message validation
- Lefthook — Git hooks management and automation
- Uses the modern Flat ESLint configuration format
- Based on eslint-canonical-config
- Yarn Workspaces — monorepo with multiple packages
- Corepack — package manager version management
- TypeScript — strict typing across all packages
@some-name/trpc-service— tRPC backend service@some-name/vite-mantine— React frontend with Vite + Mantine@some-name/tsconfig— shared TypeScript configuration
Automatic empty lines management for better code readability.
Automatic replacement of type with interface for React Props.
// Bad example
type BadInputProps = ComponentPropsWithRef<'input'> & {
type: number; // no error and <input /> gets an invalid property :(
};
// Good example
interface GoodInputProps extends ComponentPropsWithRef<'input'> {
type: number; // TypeScript error :)
}Automatic addition of displayName for React DevTools
(docs).
// you write only
YourComponent.displayName = '';// after auto-fix
YourComponent.displayName = 'YourComponent';Rules for correct JSDoc comment formatting.
- tsx — easiest way to run TypeScript in Node.js
- pkgroll — the zero-config package bundler used by tsx!
- tRPC — end-to-end typesafe APIs
- Vite — next generation frontend tooling
- Next.js — The React Framework for the Web
- Mantine — React UI library
- Vanilla Extract — CSS-in-TypeScript
- Vitest — fast testing framework
├── eslint/ # Custom ESLint rules
│ ├── empty-lines/ # Empty lines rules
│ ├── jsdoc/ # JSDoc rules
│ └── react/ # React-specific rules
├── packages/ # Template projects
│ ├── trpc-service/ # tRPC backend
│ ├── vite-mantine/ # React frontend
│ └── tsconfig/ # Shared TS config
├── tests/ # ESLint rule tests
├── lefthook.yml # Git hooks configuration
├── eslint.config.js # ESLint configuration
└── commitlint.config.ts # Commitlint configuration
- Create rule in
eslint/ - Add tests in
tests/ - Update
eslint.config.js
- Create folder in
packages/ - Add
package.jsonwith correct name - Update tests in lefthook
Project uses Lefthook for automation:
- pre-commit — linting and formatting
- commit-msg — commit message validation
- ci — full testing for CI/CD