Skip to content

[TypeScript] inline method decorators should stay inlined #5443

@ikatyang

Description

@ikatyang

Originally reported by @svipben in #5360 (comment)

Prettier 1.15.2
Playground link

--parser typescript

Input:

class X {
  @deco x() {
    return this.count * 2;
  }
  @deco get x() {
    return this.count * 2;
  }
}

Output:

class X {
  @deco
  x() {
    return this.count * 2;
  }
  @deco
  get x() {
    return this.count * 2;
  }
}

Expected behavior:
Same as input.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.status:has prIssues with an accompanying pull request. These issues will probably be fixed soon!

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions