When using a simple ternary operator with JSHint, may cause the build error shown below,
someExpressionThatIsEitherTrueOrFalse ? someFunctionThatIsCalledIfExpressionIsTrue(x, y) :
setOtherVariableIfExpressionIsFalse = true;
^ Expected an assignment or function call and instead saw an expression.
Solution
Add below JSHint Comments where expression has been written
/* jshint expr: true */
Ex:
/* jshint expr: true */ nameController.isMiddleNameNullOrEmpty ? submit() : validate();
Note: The important thing to remember is to have this JSHint comments (/* jshint expr: true */ ) be used only within the function where the expression is being used, else it would turn off the JShint globally.