Require using arrow functions for callbacks

Proprietary

Converts function expressions passed as call arguments into arrow functions, keeping the parameter list and block body as written. For example, foo(function(a) { return a; }) becomes foo((a) => { return a; }), and foo(function() { return this.a; }.bind(this)) becomes foo(() => { return this.a; }). Callbacks that use this without .bind(this), arguments, new.target, or their own name recursively are left unchanged. Replicates the autofix of the ESLint rule prefer-arrow-callback under its default options.

org.openrewrite.javascript.cleanup.PreferArrowCallback
mod run . --recipe=org.openrewrite.javascript.cleanup.PreferArrowCallback

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