Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript TypeScript Basics Getting Started with TypeScript Going Through the TypeScript Configuration File

Janina Alvarez
PLUS
Janina Alvarez
Courses Plus Student 7,964 Points

"isolatedModules": true in tsconfig.json is not throwing errors for my typescipt file that doesn't have an import/export

I am watching the following vide: https://teamtreehouse.com/library/typescript-basics/going-through-the-typescript-configuration-file

Towards the end of the video, he talks about setting isolatedModules to true in tsconfig.json. The index.ts file has the following code:

function logName(){
    const name: string = "Lucas";
    const msg: string = `Hello ${name}`;

    console.log(msg);
};

In his example, he gets an error saying index.ts cannot be compiled under '--isolatedModules

However, when I put the exact same code and tsconfig in my own local project, I don't get that error. Can someone explain why? Thank you!