Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit decorators before export #1611

Open
edoardocavazza opened this issue Apr 26, 2021 · 0 comments
Open

Emit decorators before export #1611

edoardocavazza opened this issue Apr 26, 2021 · 0 comments

Comments

@edoardocavazza
Copy link

Describe the feature

At the moment, the print method moves decorators always after the export keyword.
For example:

@deco
export class A {}
let contents = ``;

let program = await swc.parse('@deco\n', {
    syntax: 'typescript',
    tsx: true,
    decorators: true,
    dynamicImport: true,
});

let { code } = await swc.print(program, {
    sourceMaps: true,
});

will result in

export @deco class A {}

which is not compatible with the typescript syntax.

Please consider the possibility to introduce a parameter to instruct swc to print decorators before export.

@kdy1 kdy1 added this to the v1.2.55 milestone Apr 26, 2021
@kdy1 kdy1 modified the milestones: v1.2.55, v1.2.56, v1.2.57, v1.2.58 May 7, 2021
@kdy1 kdy1 modified the milestones: v1.2.58, v1.2.59 May 21, 2021
@kdy1 kdy1 modified the milestones: v1.2.59, v1.2.60 May 30, 2021
@kdy1 kdy1 modified the milestones: v1.2.60, v1.2.61 Jun 7, 2021
@kdy1 kdy1 modified the milestones: v1.2.61, v1.2.62 Jun 16, 2021
@kdy1 kdy1 modified the milestones: v1.2.62, v1.2.63 Jun 27, 2021
@kdy1 kdy1 modified the milestones: v1.2.63, v1.2.64 Jul 5, 2021
@kdy1 kdy1 modified the milestones: v1.2.64, v1.2.65, v1.2.66, v1.2.67 Jul 13, 2021
@kdy1 kdy1 modified the milestones: v1.2.67, v1.2.68, v1.2.72, v1.2.73, v1.2.74 Jul 31, 2021
@kdy1 kdy1 modified the milestones: v1.2.136, v1.2.137 Jan 27, 2022
@kdy1 kdy1 modified the milestones: v1.2.137, v1.2.138, v1.2.139, v1.2.140 Feb 7, 2022
@kdy1 kdy1 modified the milestones: v1.2.148, v1.2.149, v1.2.150 Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants