You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
The no-inferrable-types currently complains if a function parameter has both a type annotation and a default value.
TypeScript code being linted
functionfoo(bar: number=0){}
with tslint.json:
{
"rules: {"no-inferrable-types": true
}
}
Actual behavior
LHS type (number) inferred by RHS expression, remove type annotation
It would be nice if the rule had a configuration to skip function parameters. I prefer documenting the types of function parameters explicitly regardless of whether they're default-initialized or not.
The text was updated successfully, but these errors were encountered:
The
no-inferrable-types
currently complains if a function parameter has both a type annotation and a default value.TypeScript code being linted
with
tslint.json
:Actual behavior
LHS type (number) inferred by RHS expression, remove type annotation
It would be nice if the rule had a configuration to skip function parameters. I prefer documenting the types of function parameters explicitly regardless of whether they're default-initialized or not.
The text was updated successfully, but these errors were encountered: