currently it contains only one rule:
{
"no-inferrable-return-types": true
}
which is the same as no-inferrable-types, but for Return Types
- function declarations
- function expressions
- arrow functions
- class methods (including static methods and generators)
- getter/setter (not tested)
npm i -D @ibezkrovnyi/tslint-rules
and add to tslint.json
"extends": [
"@ibezkrovnyi/tslint-rules"
],
"rules": {
"no-inferrable-return-types": true
}
function sum(a, b): number {
return a + b;
}
may be safely replaced with
function sum(a, b) {
return a + b;
}
tslint --fix
is available