What does it mean when TsLint says "expected callSignature to have a typedef."

user1679941 picture user1679941 · Aug 23, 2014 · Viewed 75.6k times · Source

I have a function in my code:

networkStop = (action: string = null) => {
    this.action[action] = false;
    this.net = false;
    this.netd = false;
}

I'm getting a TsLint error saying:

Message 4   TsLint: expected callSignature to have a typedef.

Can someone explain what this means?

Answer

basarat picture basarat · Aug 23, 2014

"Missing Type definition" See : https://github.com/palantir/tslint/blob/master/src/rules/typedefRule.ts for details. Basically some annotation (for a function because callSignature) is missing.

Probably the fix (specify the return type explicitly) :

networkStop = (action: string = null):void => {
    this.action[action] = false;
    this.net = false;
    this.netd = false;
}