Disallow unnecessary calls to .bind()

Proprietary

Removes the .bind(...) suffix from arrow functions (whose this can never be rebound) and from function expressions whose body neither references this nor calls eval. The call is only removed when it has exactly one non-spread, side-effect-free argument, no comments would be lost, and it is not inside a with statement, whose object may supply the argument. Replicates the autofix of the ESLint rule no-extra-bind under its default options.

io.moderne.javascript.cleanup.NoExtraBind
mod run . --recipe=io.moderne.javascript.cleanup.NoExtraBind

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.