I need an eslint rule to disallow the usage of a specific variable / method. In particular, I don't want anyone to use Array.from in our project.
I've looked into http://eslint.org/docs/rules/ and searched for custom rules, however, I'm not sure if this is even how rules work. It seems to me that rules are either turned on or off, not configured like “disallow usage of x, x.y and z()”
Is the way to go to write a custom rule?
babel-polyfillpackage, since we useArray.fromonly one time. Older browsers don't support it, but we have lodash anyway included, so we prefer to use that. To prevent future errors, eslint should help us avoiding Array.from - soerfacefromofArray. - soerfaceArray.from. It definitely does not deserve downvotes. As for why I specifically like this question: I find myself in a situation where I've had to extend a third-party library (Highcharts), but the extension precludes the use of another one of the library's functions. Naturally, I want others to be avoid using that function, and if they really do need it, to fix the extension code first. - Vicky Chijwani