I have the following code and inside of it the WebStorm inspection Binary operation argument type newVal is not compatible with type string appears:
Binary operation argument type newVal is not compatible with type string
AngularJS's JSDoc definition makes WebStorm think the path argument is a boolean.
path
You can make WebStorm stop complaining by adding your own JSDoc:
if (path !== /** @type {boolean} */"") {