Files
codeql/javascript/ql/test/query-tests/Declarations/UnusedVariable/unusedShadowed.ts
2025-02-28 13:27:28 +01:00

19 lines
484 B
TypeScript

import T from 'somewhere'; // $ Alert - `T` is unused (it is shadowed by another T)
import object from 'somewhere'; // $ Alert - `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)
}