Disallow ++ and – (no-plusplus)
no-plusplus rule flags the use of unary operators,
var foo = 0; foo++;
-- operators are subject to automatic semicolon insertion. When their use is allowed, introducing whitespace may change semantics of source code. Enabling the rule may prevent this kind of errors.
var i = 10; var j = 20; i ++ j // i = 11, j = 20
var i = 10; var j = 20; i ++ j // i = 10, j = 21
This rule is aimed at flagging the use of
--. Some believe that the use of these unary operators reduces code quality and clarity. There are some programming languages that completely exclude these operators.
The following patterns are considered warnings:
var foo = 0; foo++; var bar = 42; bar--;
The following patterns are not considered warnings:
var foo = 0; foo += 1; var bar = 42; bar -= 1;
This rule was introduced in ESLint 0.0.9.