Files
zed/script/prettier
Conrad Irwin 6016d0b8c6 Improve autofix (#44930)
Release Notes:

- N/A
2025-12-15 22:19:18 -07:00

24 lines
613 B
Bash
Executable File

#!/bin/bash
set -euxo pipefail
PRETTIER_VERSION=3.5.0
if [[ "${1:-}" == "--write" ]]; then
MODE="--write"
else
MODE="--check"
fi
pnpm dlx "prettier@${PRETTIER_VERSION}" assets/settings/default.json --parser=jsonc $MODE || {
echo "To fix, run from the root of the Zed repo:"
echo " pnpm dlx prettier@${PRETTIER_VERSION} assets/settings/default.json --parser=jsonc --write"
false
}
cd docs
pnpm dlx "prettier@${PRETTIER_VERSION}" . $MODE || {
echo "To fix, run from the root of the Zed repo:"
echo " cd docs && pnpm dlx prettier@${PRETTIER_VERSION} . --write && cd .."
false
}