Files
prowler/ui/.pre-commit-config.yaml
T
2026-06-16 15:09:24 +02:00

44 lines
1.3 KiB
YAML

orphan: true
# Hooks run on commit only by default;
# NOTE: default_stages does NOT override a hook's manifest stages, so fixers shipping pre-push in their
# manifest need an explicit stages: ["pre-commit"] below to stay off push.
default_stages: [pre-commit]
repos:
- repo: local
hooks:
# P0 - Formatters: write fixes on staged files; prek re-stages.
- id: ui-prettier
name: UI - Prettier (write, staged)
entry: pnpm exec prettier --write --ignore-unknown
language: system
pass_filenames: true
priority: 0
- id: ui-lint
name: UI - ESLint (fix, staged)
entry: pnpm exec eslint --fix --max-warnings 40 --no-warn-ignored
language: system
files: '\.(ts|tsx|js|jsx)$'
pass_filenames: true
priority: 1
# P10 - Project-wide validators (TypeScript is fundamentally project-wide).
- id: ui-typecheck
name: UI - TypeScript Check
entry: pnpm run typecheck
language: system
files: '\.(ts|tsx|js|jsx)$'
pass_filenames: false
priority: 10
- id: ui-tests
name: UI - Unit Tests
entry: pnpm exec vitest related --run
language: system
files: '\.(ts|tsx|js|jsx)$'
exclude: '\.test\.|\.spec\.|vitest\.config|vitest\.setup'
pass_filenames: true
priority: 10