Use object property shorthand
Recipe ID
org.openrewrite.javascript.cleanup.use-object-property-shorthandArtifact@openrewrite/rewriteSimplifies object properties where the property name and value/variable name are the same (e.g., { x: x } becomes { x }). Applies to both destructuring patterns and object literals.
Single recipeMSAL
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.javascript.cleanup.use-object-property-shorthandIf the recipe isn’t available locally, install it with:
mod config recipes npm install @openrewrite/rewrite