Skip to content

Latest commit

 

History

History
40 lines (33 loc) · 617 Bytes

pr-7482.md

File metadata and controls

40 lines (33 loc) · 617 Bytes

Add support for decorators (#7482 by @fisker)

// Input
/* @flow */

@decorator4
class Foo {
  @decorator1
  method1() {}

  @decorator2
  @decorator3
  method2() {}
}

// Prettier stable
SyntaxError: Unexpected token `@`, expected the token `class` (3:1)
  1 | /* @flow */
  2 |
> 3 | @decorator4
    | ^
  4 | class Foo {
  5 |   @decorator1
  6 |   method1() {}

// Prettier master
/* @flow */

@decorator4
class Foo {
  @decorator1
  method1() {}

  @decorator2
  @decorator3
  method2() {}
}