knowledge icon indicating copy to clipboard operation
knowledge copied to clipboard

Don't force typedefs for arrow functions

Open matejchalk opened this issue 6 years ago • 4 comments

Proposal

Recently, the "arrow-call-signature" option was added to the TSLint "typedef" rule. This proposal is to revert that change.

Motivation

Forcing type definitions for arrow functions is too strict, since these are often one-liners where the return type is easily inferred by Typescript. Requiring return type annotation would create unnecessary overhead.

matejchalk avatar Feb 26 '20 13:02 matejchalk

I also encountered a problem where you need to "ignore" this rule for all of your dynamic import in project's routing.

vmasek avatar Feb 26 '20 13:02 vmasek

For other cases like Array operations or RxJS operators, it seems like a little too much and doesn't bring the value.

vmasek avatar Feb 26 '20 13:02 vmasek

We tried this rule on our project and we did not see any added value, contrariwise this was causing us problems, so we turned this rule off.

PeterSisovsky avatar Feb 26 '20 14:02 PeterSisovsky

I Agree, this rule is not useful for all projects. Might cause unnecessary overhead and be counterproductive.

estankovic avatar Feb 26 '20 21:02 estankovic