Skip to content

fix: Parameter decorator bug parsing typescript#261

Open
ottodevs wants to merge 1 commit intowix:masterfrom
ottodevs:fix-parameter-decorator-bug
Open

fix: Parameter decorator bug parsing typescript#261
ottodevs wants to merge 1 commit intowix:masterfrom
ottodevs:fix-parameter-decorator-bug

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