JS: support noop parentheses in js/useless-assignment-to-local

The syntatic recognizer `isNullOrUndef` did not handle expressions
that were wrapped in parentheses.

This eliminates some results here:
https://lgtm.com/projects/g/vuejs/vue/alerts?mode=tree&ruleFocus=7900088
This commit is contained in:
Esben Sparre Andreasen
2018-10-02 09:31:32 +02:00
parent d2f11dc18c
commit 595fe217dd
3 changed files with 22 additions and 7 deletions

View File

@@ -141,4 +141,15 @@ function v() {
x = 23;
x = 42;
return x;
}
}
(function(){
var x = (void 0);
var y = ((void 0));
var z1 = z2 = (void 0);
x = 42;
y = 42;
z1 = 42;
z2 = 42;
return x + y + z1 + z2;
});