0

It seems VSCode has a builtin code formatter for TypeScript

Is there a standalone command (CLI) of the code formatter used by VSCode?

I want to format all ts files in my folder recursively with this tool.

(Currently it is not so convenient for me to launch the text editor GUI and open each file one by one and format them one by one.)

Is there any way to do that?

cshu
  • 5,654
  • 28
  • 44
  • I think [prettier](https://prettier.io/docs/en/cli.html) can, which has a popular extension people use in VS Code for formatting. – Timothy G. Jan 13 '23 at 01:16
  • @TimothyG. prettier is good. But many co-workers will probably frequently use the VSCode builtin formatter to format code. So I hope I can format code in a way that is consistent with other people using VSCode as editor. I guess prettier formatting result can be different from VSCode formatting – cshu Jan 13 '23 at 02:17

0 Answers0