-
-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
43 lines (40 loc) · 1.59 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
43 lines (40 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Git hooks, managed by prek (https://github.com/j178/prek).
#
# prek install wire up the git hooks (run once, or via `npm install`)
# prek run --all-files run every hook over the whole repo
#
# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level
# `prek install` sets up both git hooks in one go.
default_install_hook_types: [pre-commit, commit-msg]
repos:
# Conventional Commits.
# Validates the commit message; the default type set (feat, fix, chore, ci,
# docs, style, refactor, perf, test, build, revert) matches this repo's history
# and what semantic-release consumes.
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v4.4.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
# Project toolchain on staged files. Reuses the oxfmt /
# oxlint binaries already in node_modules (via npx), so there's no second
# toolchain to install or keep in sync. `require_serial` gives each tool a
# single invocation with all files — the tools parallelize internally, and it
# avoids paying npx startup once per batch.
- repo: local
hooks:
- id: oxfmt
name: oxfmt
entry: npx oxfmt
language: system
types_or: [ts, tsx, javascript, jsx, json]
exclude: (^|/)package-lock\.json$ # never rewrite the generated lockfile
stages: [pre-commit]
require_serial: true
- id: oxlint
name: oxlint
entry: npx oxlint --fix
language: system
types_or: [ts, tsx, javascript, jsx]
stages: [pre-commit]
require_serial: true