fmt command, followed by the path to one or more files:
$ deno fmt my-file.ts /path/to/my-file.ts Checked 1 file
The format command also provides a flag,
--check, that tells you if a given file has been formatted. If the file is formatted, nothing happens other than a message saying that the file was checked. If the file wasn't formatted, then an error is shown, with the offending lines being output as they are and as they should be.
Lastly, there are times when you have a reason for your code being written in a specific manner. If you have a two dimensional array, for example, you might want it to output in an easy-to-read way that may be altered by the formatter. If you have a section of your code that you don't want to be formatted, you can prevent it with an ignore statement like this:
// deno-fmt-ignore export const twoDimensionalArray = [ [1, 0, 0] [0, 1, 0] [0, 0, 1] ];
The block of code that follows the comment,
// deno-fmt-ignore, will not be formatted. Everything else, before and after the comment, will be formatted.