JS: document limitation of js/useless-assignment-to-local

This commit is contained in:
Esben Sparre Andreasen
2019-03-12 15:30:28 +01:00
parent c8556bdbfc
commit 408ac9878b
2 changed files with 10 additions and 0 deletions

View File

@@ -9,3 +9,4 @@
| tst.js:45:6:45:11 | x = 23 | This definition of x is useless, since its value is never read. |
| tst.js:51:6:51:11 | x = 23 | This definition of x is useless, since its value is never read. |
| tst.js:132:7:132:13 | {x} = o | This definition of x is useless, since its value is never read. |
| tst.js:162:6:162:14 | [x] = [0] | This definition of x is useless, since its value is never read. |

View File

@@ -157,3 +157,12 @@ function v() {
(function() {
for (var a = (x, -1) in v = a, o);
});
(function() {
let [x] = [0], // OK, but flagged due to destructuring limitations
y = 0;
x = 42;
y = 87;
x;
y;
});