babel-plugin-filter-imports icon indicating copy to clipboard operation
babel-plugin-filter-imports copied to clipboard

[BUGFIX] Remove decorators from the AST if there are no more decorators

Open pzuraq opened this issue 6 years ago • 0 comments

Currently I'm encountering a failure caused by this plugin when trying to remove method decorators, specifically if it is removing the only decorator on the method:

 Method has decorators, put the decorator plugin before the classes one.
   7 | class AbstractClass {
   8 |   @abstract field;
>  9 |   @abstract method() {}
     |   ^
  10 | }
  11 | 
  12 | module('@abstract', () => {

This fixes this issue by removing the array altogether if no decorators exist after removal.

pzuraq avatar Jun 29 '19 05:06 pzuraq