zurassic
Published in

zurassic

Visual Studio Code Formatting Setup

Photo by chuttersnap on Unsplash

How to format code

  • To format manually, press SHIFT+CMD+P then type ‘format’, select ‘format document’ or ‘format selection’. Or, just press SHIFT+ALT+F
  • To enable format on save, add this line to your settings: ”editor.formatOnSave”: true

Format TypeScript

  • To sort the imports manually, press SHIFT+CMD+P then type ‘imports’, hit ENTER on the first command.
  • To sort on save, add this to your settings: “typescriptHero.imports.organizeOnSave”: true

Format HTML

"html.format.wrapAttributes": "force-aligned",
"html.format.enable": true,

Format Sass

"sassFormat.indent": 2,
"sassFormat.useSingleQuotes": true,

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store