Skip to content

Code Quality Tools

Our project uses several tools to maintain code quality and consistency:

ESLint

We use ESLint with TypeScript support for code linting and catching potential issues.

  • Configuration: See eslint.config.js for the full configuration
  • Rules: Includes TypeScript-specific rules and Prettier integration
  • Ignored files: Generated files, builds, and migrations are excluded

Commands:

# Run linting on all TypeScript files
pnpm lint
 
# Auto-fix linting issues where possible
pnpm lint:fix
 
# Lint only changed files (useful during development)
pnpm lint:changed
 
# Lint only staged files (used in pre-commit hooks)
pnpm lint:staged

Prettier

Code formatting is handled automatically by Prettier to ensure consistent code style.

  • Configuration: See .prettierrc for formatting rules
  • Settings: Single quotes, semicolons, trailing commas, 100 character line width
  • Ignored files: See .prettierignore for excluded files

Commands:

# Format all files
pnpm format
 
# Format only changed files
pnpm format:changed
 
# Format only staged files
pnpm format:staged
 
# Check formatting without making changes
pnpm format:check

Husky Git Hooks

We use Husky to run automated checks before commits to ensure code quality.

Pre-commit hooks (.husky/pre-commit):

  1. Prettier formatting: Automatically formats staged files
  2. ESLint checks: Runs linting on staged TypeScript files
  3. Validation: Ensures all checks pass before allowing commit

The hooks run automatically when you commit. If any check fails, the commit will be rejected.