Files
codeql/javascript/ql/test/query-tests/Declarations/UnusedVariable/unusedShadowed.ts
2018-08-02 17:53:23 +01:00

19 lines
479 B
TypeScript

import T from 'somewhere'; // NOT OK: `T` is unused (it is shadowed by another T)
import object from 'somewhere'; // NOT OK: `object` is unused (it is "shadowed" by a keyword)
import * as N from 'somewhere'; // OK: N is a namespace and thus not shadowed by 'interface N'.
{
var x: T = {};
console.log(x);
interface T {}
var z: object = null;
console.log(z)
interface N {} // unused (but not checked by this query)
var w: N.T = null;
console.log(w)
}