Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Decorator output is inconsistent #250

Closed
@vjeux

Description

@vjeux

In this example, the decorator is not wrapped in a Decorator node:

class Person {
  @inject leftLeg: Leg;
}

==>

node.decorators = [ {type: 'Identifier'} ];

In this example, it is wrapped in a TSDecorator node, instead of Decorator node:

@dec enum E {}

==>

node.decorators = [ {type: 'TSDecorator', expression: {type: 'Identifier'}} ];

It would be nice if decorators arrays was always wrapped in a Decorator node (without TS prefix). This way it would work out of the box with babylon decorators.

I have a workaround in prettier, but I'd rather it be fixed inside of this project: prettier/prettier#1509

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions