

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Install TypeScript
incomplete
2: tsconfig.json
incomplete
3: More tsconfig.json
incomplete
4: Declaration Files
incomplete
5: Using JS Libraries
incomplete
6: TypeScript Language Server
incomplete
7: TypeScript Ignore
incomplete
8: Vanilla Vite
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
We've used tsc from the command line to compile our TypeScript code, but that's often not how it's used in practice... at least not directly. In many projects, TypeScript is primarily used as a language server to provide type checking and other features in your IDE. It powers stuff like:
That's why we sometimes joke about TypeScript being a "glorified linter". There are a few reasons I point out this distinction, but the first is to understand that your editor tooling and your build tooling are separate. If your editor is using TypeScript 4 and one tsconfig.json file, but your build tooling is using TypeScript 5 and another tsconfig.json file, you can run into scenarios where your editor and what's being compiled in production are out of sync.
All this to say... keep them in sync! Most editors are smart at this and do it automatically, but it's worth knowing how to check what your editor is using under the hood.
node_modules folder, it will use that version..vscode/settings.json, .zed/settings.json, etc.)Pin the version of TypeScript in your project to avoid this confusion, and make sure your editor is using that version.
Language servers are notorious for kinda just... getting stuck. If you notice that your editor is not picking up on type errors, or is not providing auto-completion, step #1 should probably be to restart the TypeScript language server.
TypeScript: Restart TS ServerRestart Language Server:lsp restart (or :LspRestart)Let's pin the version of TypeScript used in our moonshot proof of concept AI Support site.
npm i -D typescript
Notice that this adds the TypeScript version to your package.json file.
Run and submit the CLI tests.