Skip to content

Allow TS formatter to not remove extra spaces after the first non-whitespace character (and before the last). #47708

@Tyriar

Description

@Tyriar

TS Template added by @mjbvz

TypeScript Version: 4.6

Search Terms

  • format
  • formatting
  • whitespace

I often format code like this outside in other projects:

image

I've found this particularly useful when dealing with color channel in an array as it makes it much easier to see the differences in the RHS:

data[i    ] = ;
data[i + 1] = ;
data[i + 2] = ;
data[i + 3] = ;

alt+shift+f removes this whitespace, I checked settings and there are a bunch of whitespace related ones but they all seem to be strict around adding a single space. Can we add a setting so we can have these use >=1 instead space?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureDomain: FormatterThe issue relates to the built-in formatterSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions