Skip to content

Deno.bundle() should accept the compiler flag importsNotUsedAsValues #6663

Closed
@timonson

Description

@timonson

This tsc compiler flag was implemented in TypeScript 3.8. You can find the merged PR here: microsoft/TypeScript#35200

This flag takes 3 different values:

  • remove: this is today’s behavior of dropping these imports. It’s going to continue to be the default, and is a non-breaking change.
  • preserve: this preserves all imports whose values are never used. This can cause imports/side-effects to be preserved.
  • error: this preserves all imports (the same as the preserve option), but will error when a value import is only used as a type. This might be useful if you want to ensure no values are being accidentally imported, but still make side-effect imports explicit.

It would be very helpful for Web Components and other stuff.

Metadata

Metadata

Assignees

Labels

clirelated to cli/ dirfeatnew feature (which has been agreed to/accepted)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions