Understanding How TypeScript Works in Your IDE
Let's talk about how TypeScript works when you're in VS Code or any other IDE.
When you open VS Code, the TypeScript server starts in the background. It's kind of like a second set of eyes looking at your code.
For every change you make, the TypeScript server will check your code. If it sees any e
Transcript
00:00 Let's talk about how TypeScript works when you're in your IDE. You can think of two people looking at your code whenever you're writing TypeScript code. You've got you and you've got the TypeScript server. Now, you're both running on VS Code, let's say. This can happen in any IDE, but I'm going to use VS Code as the primary example
00:19 because it's very clean and you're probably using VS Code. So when you open VS Code, the TypeScript server starts in the background and it sort of sits there as a background process, just watching whatever's happening in your IDE. Now, when you change a file, then TypeScript server will check your code.
00:36 And if it sees any errors with that code, it tells VS Code to show a red line. Then when you go on to fix the error, it'll then check again and say no more error and the red line disappears. And it will only stop when you close VS Code. So the TypeScript server is basically the thing that powers everything inside VS Code
00:56 when it comes to TypeScript. So when it comes to hovers, when it comes to autocomplete, all of the in IDE things that you see with VS Code, that's what's driving them. So you can think of there being a co-pilot next to you, not GitHub co-pilots, but the TypeScript server as the thing riding next to you, checking your work as you go.