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

decorators (legacy) enforce decorators after export #8598

Closed
jsg2021 opened this issue Aug 31, 2018 · 8 comments
Closed

decorators (legacy) enforce decorators after export #8598

jsg2021 opened this issue Aug 31, 2018 · 8 comments
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@jsg2021
Copy link

jsg2021 commented Aug 31, 2018

The babel 6 legacy decorators transform allowed decorators on either side of the export... after upgrading to babel 7 using the new decorators transform with legacy: true, code that used decorators before the export are failing with:

error Parsing error: Using the export keyword between a decorator and a class is not allowed. Please use export @dec class instead.

@babel-bot
Copy link
Collaborator

Hey @jsg2021! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

@loganfsmyth
Copy link
Member

Do you have a stack trace or anything? As far as I'm aware, legacy: true should sidestep that error in general. Are you potentially not fully upgraded to the most recent stable version yet?

@jsg2021
Copy link
Author

jsg2021 commented Aug 31, 2018

Oh... the error is not from babel cli, its from eslint, & babel-eslint@9.0.0 :/

@loganfsmyth
Copy link
Member

loganfsmyth commented Aug 31, 2018

Ah, yeah babel-eslint has its own option for that, it's just not documented well yet :( babel/babel-eslint#679

ecmaFeatures: {
  legacyDecorators: true
}

in your ESLint config should resolve it for you.

@jsg2021
Copy link
Author

jsg2021 commented Aug 31, 2018

awesome... i was off creating a repro... thanks!

@jsg2021 jsg2021 closed this as completed Aug 31, 2018
@the-simian
Copy link

the-simian commented Sep 3, 2018

@jsg2021 I had this exact issue here: #8562 , and that fix worked for me

@the-simian
Copy link

the-simian commented Sep 5, 2018

heads up to anyone copy pasting this.... @loganfsmyth typed 'decotators' (not decorators) which while I'm still laughing about was initially very confused when it seemed to do nothing...

@nicolo-ribaudo
Copy link
Member

I uppdated his comment

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Dec 5, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Dec 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

No branches or pull requests

5 participants