API reference/Semantic analysis

Semantic analysis

Semantic analysis tracks scopes, declarations, and references, so tools can determine which binding a name refers to. It also reports early errors, but does not perform TypeScript type checking.

Example

Input
const value = 1;
function read(value) {
  return value;
}
console.log(value);

The two uses of value resolve to different declarations:

ReferenceDeclaration
value in return valueThe parameter of read.
value in console.log(value)The outer const value = 1.