typescript-formatter icon indicating copy to clipboard operation
typescript-formatter copied to clipboard

How to format only a subdirectory

Open sbabeal opened this issue 8 years ago • 1 comments

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?

sbabeal avatar Apr 27 '17 19:04 sbabeal

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.

vvakame avatar May 03 '17 07:05 vvakame