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. 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. ArrowBodyStylemod run . --recipe= io. moderne. javascript. cleanup. ArrowBodyStyleInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.