hiacliok
hiacliok

Reputation: 289

How to remove whitespace before and after braces, the } { characters, in vs studio code

By default in VS studio code there is a rule for whitespace format like this:

import { foo } from './foo';

I want to remove white space to:

import {foo} from './foo';

How can I do this in vs studio code preferences?

Upvotes: 3

Views: 564

Answers (2)

Mark
Mark

Reputation: 183004

Try these settings:

 "javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,

  "typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,

Upvotes: 2

ponytailPalm
ponytailPalm

Reputation: 275

Take a look at:

"editor.trimAutoWhitespace": true,

in User Settings. (Accessible via Command Palette -> Preferences:Open User Settings)

Upvotes: 0

Related Questions