Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
- name: Lint
run: npm run lint

- name: Check formatting
run: npm run format:check

- name: Cache Playwright browsers
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
id: playwright-cache
Expand Down
27 changes: 27 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# yaml-language-server: $schema=https://lefthook.dev/schema.json
#
# Git hooks, installed by the lefthook package's postinstall script on
# `npm install`. See https://lefthook.dev/configuration/.
# Skip them for a single command with `LEFTHOOK=0 git commit ...`.

# Standard glob semantics: `**/` also matches zero directories.
glob_matcher: doublestar

pre-commit:
# Run jobs in order, so clang-format and ESLint never touch a file at the
# same time, and stop at the first failing job.
piped: true
jobs:
# Same scope as `npm run format`.
- name: clang-format
glob: "packages/*/src/**/*.ts"
exclude:
- "**/*.d.ts"
run: npx clang-format -i {staged_files}
stage_fixed: true

# Pass every staged file: eslint.config.mjs decides which ones are linted,
# and --no-warn-ignored skips the rest quietly.
- name: eslint
run: npx eslint --fix --no-warn-ignored {staged_files}
stage_fixed: true
Loading
Loading