Skip to content

isolatedModules option is not work in ^5.0.0 versionΒ #53683

Closed
@winterlood

Description

@winterlood

Bug Report

πŸ”Ž Search Terms

isolatedModules

πŸ•— Version & Regression Information

This changed between versions 4.9.5 and 5.0.3

⏯ Playground Link

https://www.typescriptlang.org/play?isolatedModules=true#code/PTAEEsGcHsBsEMAuBTAJgWWqgrrZlRoAHRcaAO1EmUVAHJEAnbZOgKBFHnNVHOlDIAHkWiNaYiAFtR40AGtkATwDuY1BzAAjbLW5LBjRpP56iRZPEabQASQBmoJdGygAxgAtuAc2ShEHn4AbsiMkGSUiAIALAB0AJyxAKwANP6BkYGGxoygKuCwsFzmlrkqyIVsbG4UkLQodaAAvPQNiHQA3FX22ORupBSg9uQAFACUoADeAL5AA

πŸ’» Code

tsconfig.json

{
  "compilerOptions": {
    "isolatedModules": true
  }
}

index.ts

const a = 1;

isolatedModules option set 'true'
and this code has no export or import keyword
but any error not appear

πŸ™ Actual behavior

it seems in 4.9.5 isolatedModules option work
but in 5.0.3 isolatedModules option not work

πŸ™‚ Expected behavior

I think the error should occur in 5.0.3, just like 4.9.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions