Skip to content

Maintenance: enable isolatedModule #1764

Closed
@dreamorosi

Description

@dreamorosi

Summary

Currently the project does not have the isolatedModules compiler option enabled. We should look into enabling it unless it causes extensive disruption and/or it's not compatible with other existing settings.

From the TypeScript docs:

While you can use TypeScript to produce JavaScript code from TypeScript code, it’s also common to use other transpilers such as Babel to do this. However, other transpilers only operate on a single file at a time, which means they can’t apply code transforms that depend on understanding the full type system. This restriction also applies to TypeScript’s ts.transpileModule API which is used by some build tools.
These limitations can cause runtime problems with some TypeScript features like const enums and namespaces. Setting the isolatedModules flag tells TypeScript to warn you if you write certain code that can’t be correctly interpreted by a single-file transpilation process.
It does not change the behavior of your code, or otherwise change the behavior of TypeScript’s checking and emitting process.

Why is this needed?

Enabling this feature increases the chances of being compatible with a wider range of compilers & bundlers that our customers might be using.

Which area does this relate to?

Other

Solution

No response

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

Metadata

Metadata

Assignees

Labels

completedThis item is complete and has been merged/shippedinternalPRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)

Type

No type

Projects

Status

Shipped

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions