We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

tsconfig.json

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.

A Simple 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.

Assignment

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.