microsoft/typespec
Publicmirrored from https://github.com/microsoft/typespecAvailable
eng/scripts/check-format.js
13lines · modecode
| 1 | import { runPrettier, CommandFailedError } from "./helpers.js"; |
| 2 | |
| 3 | try { |
| 4 | runPrettier("--list-different"); |
| 5 | } catch (err) { |
| 6 | if (err instanceof CommandFailedError) { |
| 7 | console.error( |
| 8 | "\nERROR: Files above are not formatted correctly. Run `rush format` and commit the changes." |
| 9 | ); |
| 10 | process.exit(err.proc?.status ?? 1); |
| 11 | } |
| 12 | throw err; |
| 13 | } |
| 14 | |