google / google/closure-compiler

Boolean operations on non-boolean literals should cause compiler warnings

Open
#1,290 3 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.