ESLint
The project uses ESLint with TypeScript support for code quality and consistency.Run linting
ESLint configuration
ESLint is configured ineslint.config.js with:
- TypeScript parser and plugin
- Prettier integration
- Strict TypeScript rules
- Relaxed rules for test files
Prettier
Prettier handles code formatting for consistent style across the codebase.Format code
Prettier configuration
Prettier is configured in.prettierrc.json:
- Single quotes
- No semicolons
- 2-space indentation
- ES5 trailing commas
- 80 character line width
.prettierignore.
Pre-commit hooks
Husky and lint-staged automatically run linting and formatting on staged files before each commit.What runs on commit
When you commit, these tools run on staged files:- ESLint with auto-fix
- Prettier formatting
Manual hook installation
If hooks aren’t working, reinstall Husky:Files covered
Pre-commit hooks process:- TypeScript/TSX files: ESLint + Prettier
- JSON, Markdown, YAML: Prettier only
CI validation
The CI workflow validates linting and formatting on every push and pull request. Build will fail if linting errors are present.Recommended workflow
- Write code
- Run
npm run lint:fixto auto-fix issues - Run
npm run formatto ensure consistent formatting - Commit (hooks run additional checks)
- Push (CI validates everything again)
Editor integration
Most editors support ESLint and Prettier integration:- VSCode: Install ESLint and Prettier extensions
- The project includes recommended configurations for workspace settings