Visitar URL original
Inconsistent decorator between typescript and other parsers · Issue #14285 · prettier/prettier · GitHub
Skip to content

Inconsistent decorator between typescript and other parsers #14285

Closed

Description

@fisker

Prettier 2.8.3
Playground link

--parser typescript

Input:

class A {
  @(a().b())
  method() {}
}

Output:

class A {
  @a().b()
  method() {}
}

Expected behavior:

Other parsers like babel add parens

class A {
  @(a().b())
  method() {}
}

Activity

  1. added
    lang:typescriptIssues affecting TypeScript-specific constructs (not general JS issues)
    on Feb 1, 2023
  2. fisker commented on Feb 1, 2023

    @fisker
    MemberAuthor

    @sosukesuzuki

    #11849 changed it, is it bug in babel?

  3. fisker commented on Feb 1, 2023

    @fisker
    MemberAuthor

    Found #5785

  4. added
    status:needs investigationIssues that need additional investigation, e.g. to understand whether the reported behavior is a bug
    and removed on Feb 1, 2023
  5. cdignam-segment commented on Nov 17, 2023

    @cdignam-segment
    Contributor

    I just ran into this inconsistency, babel won't parse:

    class A {
      @a().b()
      method() {}
    }

    But it will parse:

    class A {
      @(a().b())
      method() {}
    }
  6. self-assigned this
    on Jun 3, 2025
  7. fisker commented on Jun 3, 2025

    @fisker
    MemberAuthor

    Fixed by #16458

  8. locked as resolved and limited conversation to collaborators on Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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:needs investigationIssues that need additional investigation, e.g. to understand whether the reported behavior is a bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions