Typed superset of JavaScript adding optional static types, improving developer productivity, error detection, and code maintainability.
TypeScript is a superset of JavaScript that adds optional static types. All valid JavaScript is valid TypeScript, but TypeScript allows declaring types that the compiler verifies before execution, catching errors in development instead of production.
string | numberstrictStrict mode enables all type checks. It is the recommended configuration for new projects:
{
"compilerOptions": {
"strict": true,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"skipLibCheck": true,
"outDir": "dist"
}
}Individual flags that strict enables:
| Flag | What it prevents |
|---|---|
strictNullChecks | Accessing null/undefined without checking |
noImplicitAny | Variables without explicit or inferred type |
strictFunctionTypes | Incorrect contravariant function parameters |
strictPropertyInitialization | Uninitialized class properties |
noImplicitThis | Using this without a known type |
TypeScript turns runtime errors into compile-time errors. In projects of any size, the type system acts as living documentation, enables safe refactoring, and reduces the most common category of bugs: type errors.
JavaScript library for building user interfaces through declarative, reusable components, with an ecosystem spanning from SPAs to full-stack applications with Server Components.
Development methodology where the specification is written before the code, serving as a contract between teams and as the source of truth for implementation.
Automated tools that verify style, detect potential errors, and format code consistently, eliminating style debates and improving quality.
AWS infrastructure as code framework that allows defining cloud resources using programming languages like TypeScript, Python, or Java, generating CloudFormation.