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

fix: Parameter decorator bug parsing typescript #261

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ottodevs
Copy link

@ottodevs ottodevs commented May 8, 2022

  • Using the old "decorators" plugin config was preventing import-cost to parse decorators in class constructors parameters.
  • Followed babel guidelines to replace the old plugin by the latest decorators-legacy

This fixes the "infamous" error, emitted by @babel/parser and shown in the vscode output log:
importCost error: SyntaxError: Decorators cannot be used to decorate parameters.

Now it works as expected when decorators are declared as parameters:
image

Fixes: #161, Fixes: #164

Further information about the "decorators-legacy" option: https://babeljs.io/docs/en/babel-plugin-proposal-decorators (it seems also applicable to @babel/parser plugin config)

Using the old "decorators" plugin config was preventing import-cost to parse decorators in class constructors parameters.
Followed babel guidelines to replace the old plugin by the latest `decorators-legacy`
@ottodevs
Copy link
Author

ottodevs commented May 8, 2022

Btw I loved the trick of lowering the alpha to 50% for each import-cost default hex color option, now it is much less intrusive but still handy! This should be by default imho ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extension issue Extension issue
1 participant