dprint-plugin-typescript icon indicating copy to clipboard operation
dprint-plugin-typescript copied to clipboard

Parsing error when using export keyword with decorator

Open cedric-spinergie opened this issue 2 years ago • 2 comments

Describe the bug The valid TypeScript code below causes a parsing error.

dprint-plugin-typescript version: 0.88.3

Input Code

export class MyClass {
  @MyDecorator() export = "myStr";
}

Expected Output

export class MyClass {
  @MyDecorator() export = "myStr";
}

Actual Output

`export` is not allowed here at file.ts:2:18

    @MyDecorator() export = "myStr";
                   ~~~~~~

Playground Link Playground link

cedric-spinergie avatar Nov 07 '23 15:11 cedric-spinergie

Looks like https://github.com/swc-project/swc/issues/5276

dsherret avatar Nov 07 '23 15:11 dsherret

Looks like swc-project/swc#5276

Yes, that's exactly the issue.

cedric-spinergie avatar Nov 07 '23 15:11 cedric-spinergie