Omit braces around arrow function bodies containing only a return
ProprietaryConverts 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. Replicates the autofix of the ESLint rule arrow-body-style under its default options.
org. openrewrite. javascript. cleanup. ArrowBodyStylemod run . --recipe= org. openrewrite. javascript. cleanup. ArrowBodyStyleInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.