Skip to content
Merged
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
16 changes: 16 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,19 @@ case "$branch" in
exit 1
;;
esac

# Format and auto-fix what is about to be committed.
#
# The pre-push gate runs `format:check` and `lint:all` over the whole tree, so a
# file that reaches a commit unformatted is only found once the push is already
# underway - at which point the fix has to be amended into a commit that exists.
# Running the writers here, on the staged paths only, keeps the commit itself
# clean and the push gate quiet.
#
# Skip it for a commit that is not about content (a rebase, a merge resolution):
#
# SKIP_LINT_STAGED=1 git commit ...

[ "$SKIP_LINT_STAGED" = "1" ] && exit 0

npx --no-install lint-staged
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
}
},
"prettier": "@codexo/exojs-config/prettier",
"lint-staged": {
"*.{ts,tsx,mts,cts,mjs,js,json,jsonc,md,mdx,css,yml,yaml,html}": "prettier --write",
"{src,test,examples,scripts,packages}/**/*.{ts,tsx,mts,cts}": "eslint --fix --no-warn-ignored --max-warnings=0"
},
"scripts": {
"bootstrap": "pnpm install --frozen-lockfile --ignore-scripts && pnpm build:tooling",
"build:tooling": "pnpm --filter @codexo/exojs-build build",
Expand Down Expand Up @@ -246,6 +250,7 @@
"husky": "^9.1.7",
"jiti": "^2.7.0",
"jsdom": "^29.1.1",
"lint-staged": "^16.2.7",
"playwright": "^1.50.0",
"prettier": "3.8.5",
"rimraf": "^6.1.3",
Expand Down
138 changes: 138 additions & 0 deletions pnpm-lock.yaml

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

Loading