Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 456 Bytes

restrict-plus-operands.md

File metadata and controls

25 lines (17 loc) · 456 Bytes

When adding two variables, operands must both be of type number or of type string. (restrict-plus-operands)

Examples of correct code:

var foo = parseInt('5.5', 10) + 10;

Examples of incorrect code:

var foo = '5.5' + 5;

Options

{
  "@typescript-eslint/restrict-plus-operands": "error"
}

Compatibility