I installed the Prettier extension and set the maximum line width to 80. I also set it up to format on save. When I save the file I'm working on, I find that the comments are still very long. The extension should shorten it to the maximum 80 character width, but it doesn't do that. Do I need to use other settings? Or maybe there is a better extension than Prettier? I just want to use any formatting tool that can eliminate the 200 errors I get when deploying my TypeScript cloud functions.
P粉5415653222023-09-17 17:25:38
Prettier does not format comments, see https://prettier.io/docs/en/rationale.html#comments
I recommend converting your comments to jsdoc style comments and wrapping them yourself.
vscode has a nice feature where adding a newline character to a comment will make the new line a comment as well.
By the way, I can't comment on your post because I don't have enough reputation haha, but you can create a basic prettier profile by pressing Ctrl Shift P and typing prettier,