Require destructuring from arrays and/or objects
ProprietaryRewrites variable declarations that copy a property into a same-named variable to use object destructuring, e.g. const foo = object.foo; becomes const {foo} = object;. Replicates the autofix of the ESLint rule prefer-destructuring under its default options.
org. openrewrite. javascript. cleanup. PreferDestructuringmod run . --recipe= org. openrewrite. javascript. cleanup. PreferDestructuringInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.