prettier

 1#!/bin/bash
 2set -euxo pipefail
 3
 4PRETTIER_VERSION=3.5.0
 5
 6if [[ "${1:-}" == "--write" ]]; then
 7    MODE="--write"
 8else
 9    MODE="--check"
10fi
11
12pnpm dlx "prettier@${PRETTIER_VERSION}" assets/settings/default.json --parser=jsonc $MODE || {
13    echo "To fix, run from the root of the Zed repo:"
14    echo "  pnpm dlx prettier@${PRETTIER_VERSION} assets/settings/default.json --parser=jsonc --write"
15    false
16}
17
18cd docs
19pnpm dlx "prettier@${PRETTIER_VERSION}" . $MODE || {
20    echo "To fix, run from the root of the Zed repo:"
21    echo "  cd docs && pnpm dlx prettier@${PRETTIER_VERSION} . --write && cd .."
22    false
23}