TsLint: function call denied

I have TypeScript code like this in my Visual Studio project

if (_.isNull(user)) {
  //Do stuff
}

And while saving TSLint gives me

Message TsLint: function invocation disallowed: _.isNull    BaseCtrl.ts    127

I do have TypeScript definitions for Underscore.js in my project.

What does this message mean and how can I fix my code to make TSLint happy or disable this message in my project settings tslint.json?

+4
source share
1 answer

I believe this is a problem using isNull, which seems to be on the list of feature prohibitions.

https://github.com/palantir/tslint/blob/master/src/rules/banRule.ts

, -Essentials, :

"ban": [true,
       ["_", "extend"],
       ["_", "isNull"],
       ["_", "isDefined"]
 ],
+3

All Articles