p42ai / js-assistant

120+ refactorings and code-assists for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=p42ai.refactor
MIT License
119 stars 7 forks source link

Feature Request: transform object property assignment to `defineProperty` #75

Open aghArdeshir opened 11 months ago

aghArdeshir commented 11 months ago

refactor

myObject.someProp = 'someValue'

to

Object.defineProperty(myObject, 'someProp', {
  value: 'someValue'
})

I use this technique a lot for bypassing TypeScript :grin: But I believe we may be able to find good use cases for it as well. : )