babel / babel/minify

Add support for annotations improving minification and rewriting

Open
#178 9 comments 0 reactions 0 assignees View on GitHub
discussion enhancement
Dominant language
JavaScript
Stars
4.4k
Forks
217
PR merge metrics
No merged PRs in 30d

Description

Eg. ability to declare "pure" functions:

```
class Bar {
/* babili: no-side-effects */
constructor() {
someFunction(this);
}
}
new Bar();
```

Would result in removing `new Bar()` because of `no-side-effects` annotation.
Other possible annotations include: `dont-modify-argument`, `constant-expression`, `always-new` (function always return unique object - like `foo = ()=>({})` - all calls to `foo()` results in new objects) or similar.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.