问题 Which formatter VCode uses? I read somewhere VC uses jsbeautifier so I tried adding a compatible ignore comment to my .ejs template, but to no avail. 回答1: As far as I know, there is no way to do this without an extension. However, you have full control of the formatting if you use this extension. It also uses js-beautify, but it adds configuration. As specified in the js-beautify docs, the "preserve" directive only works in javascript sections. I have tested this in the script tag of an ejs