Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop Visual Studio Code from automatically adding semicolons and single quotes in .ts files

Related to this question but different as for .ts files. When using the QuickFix function to add a missing import I want it to use double quotes and stop it from ending with a semicolon to remain consistent with the existing code base.

I have disabled all extensions so I think this must be the built in Typescript formatting. I have tried looking through the visual studio code base and not found where this is being done yet.

Perhaps it is not possible to configure this using some setting in the preferences file?

like image 311
AJP Avatar asked Oct 15 '25 18:10

AJP


1 Answers

Try these new settings (v1.41):

javascript.format.semicolons

typescript.format.semicolons

See https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_41.md#semicolon-formatter-options-for-javascript-and-typescript

Options are:

  • ignore — Does not add or remove semicolons (default).
  • insert — Insets semicolons at statement ends.
  • remove — Remove unnecessary semicolons.
like image 173
Mark Avatar answered Oct 17 '25 09:10

Mark