Skip to content

Commit

Permalink
Stop falling back to WASM sane-fmt
Browse files Browse the repository at this point in the history
WASM sane-fmt doesn't exist here
  • Loading branch information
KSXGitHub authored Mar 15, 2024
1 parent 702c437 commit 0763e4e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions run-on-save
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@
set -o errexit -o pipefail -o nounset

# TASK: Use sane-fmt to format TypeScript/JavaScript file
# Recommend: Install native sane-fmt for good performance (https://github.com/sane-fmt/sane-fmt)
# <https://github.com/sane-fmt/sane-fmt>
for ext in js ts jsx tsx; do
if [[ "$FILE" == *.$ext && "$FILE" != *node_modules* ]]; then
if which sane-fmt &>/dev/null; then
echo "Run sane-fmt on $FILE"
sane-fmt --color=never --write "$FILE"
else
echo 'Using WebAssembly implementation of sane-fmt'
echo 'Recommend: Install native version from https://github.com/sane-fmt/sane-fmt'
pnpm run sane-fmt:fix -- --color=never --hide-passed
echo 'Fail to detect sane-fmt in PATH'
echo 'See <https://github.com/sane-fmt/sane-fmt> for installation instruction'
exit 1
fi
break
fi
Expand Down

0 comments on commit 0763e4e

Please sign in to comment.