import-cost
import-cost copied to clipboard
fix: Parameter decorator bug parsing typescript
- 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:

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