diff --git a/lib/just/formatter-wrappers.just b/lib/just/formatter-wrappers.just index 8ad5ef3..ac19590 100644 --- a/lib/just/formatter-wrappers.just +++ b/lib/just/formatter-wrappers.just @@ -7,3 +7,9 @@ _format-wrapper-statix *files: statix fix --config lib/tooling-config/statix.toml "$file" done +_format-wrapper-jq *files: + #!/usr/bin/env sh + set -euxo pipefail + for file in {{files}}; do + echo "$file" | jq -S > "$file" + done diff --git a/lib/tooling-config/treefmt.toml b/lib/tooling-config/treefmt.toml index 683e1e8..e7d856e 100644 --- a/lib/tooling-config/treefmt.toml +++ b/lib/tooling-config/treefmt.toml @@ -24,6 +24,11 @@ command = "taplo" options = ["format"] includes = ["*.toml"] +[formatter.jq] +command = "just" +options = ["_format-wrapper-jq"] +includes = ["*.json", "*.jsonc"] + [formatter.mdformat] command = "mdformat" includes = ["*.md"]