eslint-plugin-deprecate
eslint-plugin-deprecate copied to clipboard
deprecate/function always deprecates toString function name
trafficstars
This plugin incorrectly (I believe) always deprecates usage of the toString() function. Looking at the code in lib/rules/function.js, this is because funcs is initialized to the empty object {}, which has a toString method.
One other thing: I haven't tested this, but I assume this issue affects other Object.prototype methods like valueOf, toLocaleString, etc.
Hi @carlansley! Seems like a reasonable remark. In practice, I haven't expected this side effect while was using the function deprecation. But maybe using hasOwnProperty makes more sense here.