Skip to content

Latest commit

 

History

History
24 lines (21 loc) · 410 Bytes

File metadata and controls

24 lines (21 loc) · 410 Bytes

Allow decorators on private members and class expressions (#14548 by @fisker)

// Input
class A {
  @decorator()
  #privateMethod () {}
}

// Prettier stable
SyntaxError: Decorators are not valid here. (2:3)
  1 | class A {
> 2 |   @decorator()
    |   ^^^^^^^^^^^^
  3 |   #privateMethod () {}
  4 | }

// Prettier main
class A {
  @decorator()
  #privateMethod() {}
}