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
51 changes: 51 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# lefthook.yml
# Configuration reference: https://lefthook.dev/configuration/

assert_lefthook_installed: true

output:
- meta # Print lefthook version
- summary # Print summary block (successful and failed steps)
- empty_summary # Print summary heading when there are no steps to run
- success # Print successful steps
- failure # Print failed steps printing
- execution # Print any execution logs (but prints if the execution failed)
- execution_out # Print execution output (but still prints failed commands output)
- execution_info # Print `EXECUTE > ...` logging
- skips # Print "skip" (i.e. no files matched)

pre-push:
follow: true
parallel: true
jobs:
- name: 'Lint'
run: npx --no-install eslint --fix "{staged_files}"
glob:
- '*.ts'
- '*.js'
- '*.tsx'
- '*.jsx'
stage_fixed: true

- name: 'Code Formatting'
run: npx --no-install prettier --write --ignore-unknown "{staged_files}"
stage_fixed: true

- name: 'Build'
run: npm run build
stage_fixed: true

- name: 'Test'
run: npm run fetch:spec-types && npx --no-install jest --passWithNoTests "{staged_files}"
glob: '*.{ts,js,json}'
stage_fixed: true

post-checkout:
jobs:
- name: 'Install Dependencies'
run: npm install

post-merge:
jobs:
- name: 'Install Dependencies'
run: npm install
164 changes: 164 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"prepack": "npm run build:esm && npm run build:cjs",
"lint": "eslint src/ && prettier --check .",
"lint:fix": "eslint src/ --fix && prettier --write .",
"prepare": "npx --no-install lefthook install",
"test": "npm run fetch:spec-types && jest",
"start": "npm run server",
"server": "tsx watch --clear-screen=false src/cli.ts server",
Expand Down Expand Up @@ -91,8 +92,9 @@
"@types/ws": "^8.5.12",
"eslint": "^9.8.0",
"eslint-config-prettier": "^10.1.8",
"prettier": "3.6.2",
"jest": "^29.7.0",
"lefthook": "^1.13.6",
"prettier": "3.6.2",
"supertest": "^7.0.0",
"ts-jest": "^29.2.4",
"tsx": "^4.16.5",
Expand Down