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