Skip to content

Latest commit

 

History

History
52 lines (41 loc) · 822 Bytes

README.md

File metadata and controls

52 lines (41 loc) · 822 Bytes

tslint-rules

currently it contains only one rule:

{
  "no-inferrable-return-types": true
}

which is the same as no-inferrable-types, but for Return Types

Supported

  • function declarations
  • function expressions
  • arrow functions
  • class methods (including static methods and generators)
  • getter/setter (not tested)

install

npm i -D @ibezkrovnyi/tslint-rules

and add to tslint.json

"extends": [
  "@ibezkrovnyi/tslint-rules"
],
"rules": {
  "no-inferrable-return-types": true
}

example

function sum(a, b): number {
  return a + b;
}

may be safely replaced with

function sum(a, b) {
  return a + b;
}

fix

tslint --fix is available