Use NPX to run prettier (#990)

### What

If `prettier` isn't installed globally, this means the format script
still works.

### How

If it's already installed, this is a no-op. Otherwise, this prompts the
user to download a temporary version of the package to run the command.

V3_GIT_ORIGIN_REV_ID: 6d10387a0a6d5cdc33b748c0533b7bb276d322ac
This commit is contained in:
Tom Harding 2024-08-19 13:12:13 +02:00 committed by hasura-bot
parent de9ecd1262
commit 7d49ec4197
2 changed files with 3 additions and 3 deletions

View File

@ -217,7 +217,7 @@
pkgs.just
pkgs.moreutils
pkgs.nixpkgs-fmt
pkgs.nodePackages.prettier
pkgs.nodejs_22
# Rust
pkgs.bacon

View File

@ -10,7 +10,7 @@ build:
format:
cargo fmt --check
prettier --check .
npx --yes prettier --check .
! command -v nix || nix fmt -- --check .
alias fmt := format
@ -21,7 +21,7 @@ fix:
! command -v nix || nix fmt
fix-format:
prettier --write .
npx --yes prettier --write .
run-local-with-shell:
#!/usr/bin/env bash