Description
Version: Deno 2.2.1
Exit code when failing to format bad file is 0, deno fmt --check
fails.
Expected behavior: fmt fails, so should exit with a non-zero exit code.
Reproduce using the following script:
#!/bin/bash
deno --version
# json with js extension
echo '{ "data": {"lang": "en", "length": 25} }' > a.js
deno fmt a.js
echo "Deno exit was $?"
for 2.2.1 produces:
deno 2.2.1 (stable, release, x86_64-unknown-linux-gnu)
v8 13.4.114.9-rusty
typescript 5.7.3
Error formatting: /tmp/a.js
Expected ';', '}' or <eof> at file:///tmp/a.js:1:9
{ "data": {"lang": "en", "length": 25} }
~
Checked 1 file
Deno exit was 0
I expected it to exit with 1.
Seems like the same kind of issue as #4157