babel-plugin-filter-imports
babel-plugin-filter-imports copied to clipboard
[BUGFIX] Remove decorators from the AST if there are no more decorators
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.