mirror of
https://github.com/morluto/rea.git
synced 2026-12-06 15:33:56 +08:00
ci(hooks): skip the staged-file autofix on merge commits (#11530)
A merge commit stages every file brought in from the other branch, so lint-staged's oxlint --fix rewrote incoming code that main had not autofixed (duplicate imports and similar fixable warnings), putting unrelated changes into PR merges and causing new conflicts with main. Conflict resolutions are still checked by the pre-push hook and CI.
This commit is contained in:
@@ -1 +1,7 @@
|
||||
# A merge commit stages every file it brings in from the other branch; an
|
||||
# autofix here would rewrite that incoming code and put unrelated changes into
|
||||
# the merge. Conflict resolutions are still checked by the pre-push hook and CI.
|
||||
if git rev-parse -q --verify MERGE_HEAD >/dev/null; then
|
||||
exit 0
|
||||
fi
|
||||
npx --no-install lint-staged
|
||||
|
||||
Reference in New Issue
Block a user