Week 6 – TypeScript Programming Foundations

Objectives

  • Understand TypeScript fundamentals and static typing benefits.
  • Build maintainable modules with interfaces and types.
  • Set up TypeScript tooling for compile and test loops.
  • Manage Node.js dependencies with confidence.

Topics

  • TypeScript compiler and project configuration.
  • Primitive and complex types.
  • Interfaces, type aliases, generics.
  • Classes and object-oriented patterns.
  • Tooling: linting, formatting, test setup.
  • npm fundamentals: package.json, package-lock.json, and scripts.
  • Dependency groups (dependencies vs devDependencies).
  • Semantic versioning and version ranges.
  • npm audit and dependency update strategies.

Hands-On Activities

  • Convert a JavaScript module to TypeScript.
  • Implement typed domain models and utility functions.
  • Add compile checks and test scripts.
  • Configure package scripts for build, lint, test, and audit.
  • Pin and update dependencies, resolving an audit finding.

Deliverables

  • Typed TypeScript mini-project.
  • Build and test scripts in project configuration.
  • Reproducible dependency setup with a committed lock file.

Assessment

  • Code quality review with type-safety checklist.