TypeScript Environment Setup
⚙️ TypeScript Environment Setup
1️⃣ Install Required Tools
Make sure these are installed:
-
Node.js (includes npm)
-
TypeScript
-
Code Editor (recommended: Visual Studio Code)
👉 You already installed TypeScript in the previous step.
Check:
2️⃣ Install Visual Studio Code (VS Code)
Download and install VS Code.
Recommended VS Code Extensions
-
ESLint
-
Prettier – Code Formatter
-
JavaScript and TypeScript Nightly (optional)
(VS Code has built-in TypeScript support)
3️⃣ Create a TypeScript Project
Create a new folder and open it in VS Code.
Initialize npm:
Install TypeScript locally:
4️⃣ Create tsconfig.json
Run:
This creates tsconfig.json, which controls how TypeScript behaves.
Important tsconfig.json Options
5️⃣ Project Folder Structure
Recommended structure:
6️⃣ Write Your First TypeScript Code
Create src/index.ts
7️⃣ Compile the Project
Compile all .ts files:
JavaScript output will be generated inside dist/.
8️⃣ Run the Output
Output:
9️⃣ Watch Mode (Auto Compile)
Automatically compile on file change:
🔑 Environment Setup Summary
| Step | Tool |
|---|---|
| Runtime | Node.js |
| Package Manager | npm |
| Compiler | TypeScript (tsc) |
| Editor | VS Code |
| Config File | tsconfig.json |
✅ You Are Ready!
Your TypeScript environment is now fully set up 🎉
