import-cost icon indicating copy to clipboard operation
import-cost copied to clipboard

fix: Parameter decorator bug parsing typescript

Open ottodevs opened this issue 3 years ago • 1 comments

  • 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)

ottodevs avatar May 08 '22 16:05 ottodevs

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 ;)

ottodevs avatar May 08 '22 16:05 ottodevs