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

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
- Code Assist ID (for the configuration file):
collapse-property-into-shorthand
- You can configure custom keyboard shortcuts with this code action kind:
refactor.convert.toggle.collapse-expand.shorthand-property.p42.collapse-property-into-shorthand
- This code assist provides refactoring suggestions. Learn how to configure the refactoring suggestion visibility.