Linting & Formatting
Prettier
Formatting is handled by Prettier with these settings (.prettierrc.json):
- Double quotes
- Semicolons
- 2-space indentation
- Trailing commas
ESLint
eslint.config.mjs configures a flat config for TypeScript/TSX with:
@typescript-eslintrecommended rules- Prettier integration (
prettier/prettieras an error) no-unused-vars/@typescript-eslint/no-unused-vars: warn (underscore prefixed names are ignored)no-console: warnsemiandquotesenforced
src/components/ui/** (shadcn/ui primitives) and generated timestamp files are
ignored.
Run it manually:
npx eslint src/
Pre-commit hook
A Husky pre-commit hook runs lint-staged, which on staged files:
| Files | Action |
|---|---|
*.{js,jsx,ts,tsx} | eslint --fix |
| all files | prettier --ignore-unknown --write |
package.json | sort-package-json |
Formatting and lint issues in staged files are fixed automatically before the commit lands.