

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
The tsconfig.json file configures TypeScript compiler behavior. There are a lot of options when it comes to configuring TypeScript, and they change the way the compiler and tooling work. It's often not fair to say "In TypeScript X will throw an error" because there are almost always options that can be set to make that not true.
tsconfig.json{
"compilerOptions": {
"lib": ["esnext"],
"target": "esnext",
"strict": false
}
}
lib specifies the library files to include in the compilation. It's what APIs are available for us to use in our code.target specifies the ECMAScript target version for the JavaScript output.esnext is great for us, because we're "starting a new project" and we want to use the latest. I recommend pegging this to a specific version before you ship version 1.0 of your project. e.g. es2024.
npm init -y
function main(): void {
const projectName = "support.ai";
welcome(projectName);
}
function welcome(name) {
return "Hello, " + name.toLowerCase();
}
main();
Okay, this one's a bit weird, but just roll with it for now.
Run and submit the CLI tests from the root of the project.