Collapse object property into shorthand

Shorten object properties when the property name is the same as the property value.

Cleanup
Modernization
ES2015
P42 for VS Code
P42 for GitHub
Collapse object property into shorthand

Why is this refactoring helpful?

Using the shorthand notation for object properties reduces the amount of visual elements that need to be recognized, making the code easier to read.

What do I need to consider?

Shorthand property names in object initializers are an ES2015 feature. They are supported on all modern browsers, but for older browsers transpilation might be required (browser support).

Configuration

Related Code Assists

Learn More

Available In