89

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?

HDJEMAI
  • 9,436
  • 46
  • 67
  • 93

2 Answers2

136

"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;
}
basarat
  • 261,912
  • 58
  • 460
  • 511
22

To avoid the build error. in the tslint.json file write code like:-

"typedef": [
  false,
  "call-signature"
],

This line of code in tslint.json does not make the return type of method required.

Shashikant Pandit
  • 2,752
  • 22
  • 29