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

前端 未结 2 1469
梦毁少年i
梦毁少年i 2021-02-03 17:04

I have a function in my code:

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


        
2条回答
  •  长情又很酷
    2021-02-03 17:37

    "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;
    }
    

提交回复
热议问题