Skip to content

Incorrect formatting after readonly modifier #12218

@aluanhaddad

Description

@aluanhaddad

TypeScript Version: 2.1.1, 2.0.9, nightly (2.2.0-dev.20161114)
VS Code: 1.8.0 - Insider

Code

// A *self-contained* demonstration of the problem follows...
class C {
  // three spaces separate the tokens readonly and property
  readonly   property = {};
}

Expected behavior:
After applying the format command via VS Code (default shift + alt + f) the extra whitespace between readonly and property is removed just as it is with modifiers such as public, private, and protected

Actual behavior:
The extra whitespace between readonly and property is retained. Note that this does not occur for other modifiers such as public and only occurs when readonly is the last modifier (
readonly public works correctly is correctly a syntax error).

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: FormatterThe issue relates to the built-in formatterFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions