Merge pull request #656 from xiemaisi/js/unused-local-underscore

Approved by esben-semmle
This commit is contained in:
semmle-qlci
2018-12-12 08:11:37 +00:00
committed by GitHub
7 changed files with 26 additions and 5 deletions

View File

@@ -33,4 +33,8 @@ var g = f3;
// OK
define(function (require, exports, module) {
module.x = 23;
});
});
// OK: starts with underscore
function f(_p) {
}

View File

@@ -9,5 +9,7 @@
| multi-imports.js:2:1:2:42 | import ... om 'x'; | Unused imports alphabetically, ordered. |
| require-react-in-other-scope.js:2:9:2:13 | React | Unused variable React. |
| typeoftype.ts:9:7:9:7 | y | Unused variable y. |
| underscore.js:6:7:6:7 | e | Unused variable e. |
| underscore.js:7:7:7:7 | f | Unused variable f. |
| unusedShadowed.ts:1:1:1:26 | import ... where'; | Unused import T. |
| unusedShadowed.ts:2:1:2:31 | import ... where'; | Unused import object. |

View File

@@ -0,0 +1,10 @@
function f(a) {
const [a, // OK: used
_, // OK: starts with underscore
_c, // OK: starts with underscore
d, // OK: used
e, // NOT OK
f] // NOT OK
= a;
return a + d;
}