Omit braces around arrow function bodies containing only a return

Proprietary

Converts arrow functions whose block body contains only a single return statement to a concise expression body. For example, () => { return x; } becomes () => x. Returned object literals and sequence expressions are wrapped in parentheses to keep the result parseable. An arrow without a terminating semicolon is left unchanged where the next statement or class member would continue its expression body. Replicates the autofix of the ESLint rule arrow-body-style under its default options.

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

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