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

convert-function-to-object-method potentially unsafe #67

Open j4k0xb opened 1 year ago

j4k0xb commented 1 year ago
const obj = {
  a: function () {  },
  b() { },
};

new obj.a(); // Works
new obj.b(); // TypeError: obj.b is not a constructor

Would be more appropriate if the refactoring showed a warning instead of 🟢 safe