-
Notifications
You must be signed in to change notification settings - Fork 887
arrow-call-signature Not working with arrow function missing type definition #2000
Comments
Looks like this behavior is intentional: it doesn't lint arrow functions inside CallExpressions. (https://github.com/palantir/tslint/blob/master/src/rules/typedefRule.ts#L83) |
@YuichiNukiyama: was it intentional to not warn on callbacks? I see one of the revisions in #1284 which disables the warning for the line @andy-hanson mentioned. If so, what was the thought behind that? |
@nchen63 |
@YuichiNukiyama I thought that the point of the rule wasn't to declare types because they were necessary, but to do it to be explicit, as a matter of style |
He is an example of where linting would be valuable. Currently, no linting error is generated:
Having said that, it does appear that such a problem is picked up by the TypeScript compiler. |
Sounds like the general thought is that the rule should be given an opt-in option to allow this behavior. Perhaps |
I agree with @nchen63 ; this rule is not to declare types because they are necessary, but to document the code. If you want to only declare type because they are necessary, use @JoshuaKGoldberg I don't think a
Since Then Plus, |
This was fixed by #4533 🎉 |
Bug Report
4.3.1
2.1.4
TypeScript code being linted
with
tslint.json
configuration:Actual behavior
I don't get a warning about the arrow function call signature not having a type defined.
Expected behavior
I should get a warning about the arrow function call signature not having a type defined.
The text was updated successfully, but these errors were encountered: