typescript-formatter
typescript-formatter copied to clipboard
How to format only a subdirectory
I have my tslint.json in the root of my project. I only want to format a subdirectory which contains generated code. I can't find a way to pass a location to the formatter that works.
When I navigated to the directory i wanted formated I ran this command $tsfmt -r --useTslint ........\tslint.json and it ended up formatting the entire project. I only wanted it to format the current directory. Passing . or . did not work either. Any ideas?
tsfmt can accept file path.
$ tsfmt --help
Usage: tsfmt [options] [--] [files...]
...
for example, you can use tsfmt *.ts. glob pattern expanded by shell on macOS or Linux.