admin.xpcool.com/lefthook.yml
夏犀麟 b585603d58
Some checks failed
Build and Deploy (admin.xpcool.com) / build-and-deploy (push) Failing after 4s
feat(notice): 通知历史记录页面增强筛选与详情
新增通知历史记录多维筛选(关键字/分组/类型/事件/渠道/接收人/状态/时间/排序)、统计概览、详情抽屉、批量删除与按天数清空,并补充通知字典选项接口与常量兜底。
2026-09-15 00:25:48 +08:00

82 lines
2.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# EXAMPLE USAGE:
#
# Refer for explanation to following link:
# https://lefthook.dev/configuration/
#
# pre-push:
# jobs:
# - name: packages audit
# tags:
# - frontend
# - security
# run: yarn audit
#
# - name: gems audit
# tags:
# - backend
# - security
# run: bundle audit
#
# pre-commit:
# parallel: true
# jobs:
# - run: yarn eslint {staged_files}
# glob: "*.{js,ts,jsx,tsx}"
#
# - name: rubocop
# glob: "*.rb"
# exclude:
# - config/application.rb
# - config/routes.rb
# run: bundle exec rubocop --force-exclusion {all_files}
#
# - name: govet
# files: git ls-files -m
# glob: "*.go"
# run: go vet {files}
#
# - script: "hello.js"
# runner: node
#
# - script: "hello.go"
# runner: go run
pre-commit:
# 串行执行(不设 parallel避免与 check:type 同时运行导致低配机内存/CPU 瞬时飙升。
# lint 仅检查暂存文件并自动修复后回填大幅降低负载check:type 仍需全量。
jobs:
- name: oxlint
glob: '*.{js,jsx,ts,tsx,vue,cjs,mjs,cts,mts}'
run: pnpm exec oxlint --fix --type-aware --threads=4 --no-error-on-unmatched-pattern {staged_files}
stage_fixed: true
- name: oxfmt
glob: '*.{js,jsx,ts,tsx,vue,cjs,mjs,cts,mts,json,jsonc}'
run: pnpm exec oxfmt --threads=4 --no-error-on-unmatched-pattern {staged_files}
stage_fixed: true
- name: eslint
glob: '*.{js,jsx,ts,tsx,vue,cjs,mjs,cts,mts}'
run: pnpm exec eslint --fix {staged_files}
stage_fixed: true
- name: stylelint
glob: '*.{vue,css,less,scss}'
run: pnpm exec stylelint --fix {staged_files}
stage_fixed: true
# 类型检查改为「增量」:全量 turbo run typecheck 要跑 38 个任务(含 vue-tsc
# --filter=...[HEAD] 只校验「自 HEAD 起有改动的包 + 依赖它们的包」,实测 38 → 10 个任务。
# --concurrency=4 限制并发,避免 dev server 在跑时瞬时打满内存/CPU。
# 注意2026-09-15「commit 卡死」的真凶不在这里,而是 eslint 规则 n/no-extraneous-import
# (已在 eslint-config 中关闭,详见 agents.md 第 8 节现象 C本项仅为缩时优化。
# 应急跳过(例如纯文档/配置提交LEFTHOOK=0 git commit ...(该次提交跳过全部钩子)。
- name: checkType
run: pnpm exec turbo run typecheck --filter=...[HEAD] --concurrency=4
post-merge:
commands:
install:
run: pnpm install
commit-msg:
commands:
commitlint:
run: pnpm exec commitlint --edit $1