google / google/closure-compiler
Boolean operations on non-boolean literals should cause compiler warnings
Open
enhancement
lint
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
I accidentally wrote a bit of code that looks like this:
``` js
var myString = 'string1' || 'string2';
```
This ought to be caught at compile time, as myString will never have a value of 'string2'.
Contributor guide
Assessment
This issue has not been assessed yet.