fix(stdin --check): stdin with the --check flag should return a formatted output

stdin with --check was returning the original code, but should be returning the formatted code.

closes #486
This commit is contained in:
Christopher Pickering 2022-12-16 10:42:47 -06:00
parent 2c9995cd78
commit 57e1eecedb
No known key found for this signature in database
GPG key ID: E14DB3B0A0FACF84

View file

@ -33,7 +33,7 @@ def reformat_file(config: Config, this_file: Path) -> dict:
if config.format_js:
beautified_code = format_js(beautified_code, config)
if config.check is not True:
if config.check is not True or config.stdin is True:
# update the file
this_file.write_text(beautified_code, encoding="utf8")