Lesson 8 of 8
Practice & Quiz - Modules, tsconfig & Tooling
Reinforce your TypeScript toolchain knowledge - ES modules, tsconfig options, path aliases, ESLint, and build tools - with a practical setup exercise and 5 quiz questions.
Practical: Minimal Production tsconfig
// Complete tsconfig.json for a production Node.js TypeScript project
// (copy, adjust outDir/rootDir for your project structure)
{
"compilerOptions": {
// ── Output ───────────────────────────────────────────────
"target": "ES2022", // async/await native, Array.at(), etc.
"module": "NodeNext", // ESM + CJS interop for Node 18+
"moduleResolution": "NodeNext",// Respects package.json exports map
// ── Strict checks ──────────────────────────────────────
"strict": true, // all 8 strict flags
"noUncheckedIndexedAccess": true, // arr[0] is T | undefined
"exactOptionalPropertyTypes": true, // field?: T ≠ T | undefined
"noImplicitOverride": true, // requires override keyword
"verbatimModuleSyntax": true, // enforces import type
// ── Paths ──────────────────────────────────────────────
"baseUrl": "./src",
"paths": { "@/*": ["./*"], "@lib/*": ["./lib/*"] },
// ── Output ─────────────────────────────────────────────
"outDir": "./dist",
"rootDir": "./src",
"declaration": true, // emit .d.ts files
"sourceMap": true,
"incremental": true, // faster rebuilds via .tsbuildinfo
// ── Compatibility ──────────────────────────────────────
"esModuleInterop": true,
"skipLibCheck": true,
"lib": ["ES2022"] // Node - NO dom
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}
// package.json quality scripts to run in CI:
// "type-check": "tsc --noEmit" ← blocks on type errors
// "lint": "eslint src --ext .ts"
// "qa": "npm run type-check && npm run lint"Module Quiz
What is the key advantage of using `import type { Task }` over `import { Task }` for type-only imports?
Tip
Tip
Practice Practice Quiz Modules tsconfig Tooling in small, isolated examples before integrating into larger projects. Breaking concepts into small experiments builds genuine understanding faster than reading alone.
TypeScript = JavaScript + static types → fewer bugs, better tooling
Practice Task
Note
Practice Task - (1) Write a working example of Practice Quiz Modules tsconfig Tooling from scratch without looking at notes. (2) Modify it to handle an edge case (empty input, null value, or error state). (3) Share your solution in the Priygop community for feedback.
Common Mistake
Warning
A common mistake with Practice Quiz Modules tsconfig Tooling is skipping edge case testing - empty inputs, null values, and unexpected data types. Always validate boundary conditions to write robust, production-ready typescript code.
Finished this lesson?