Skip to content

No error using imports/exports with --module=none and --target=es2015+ #39603

@andrewbranch

Description

@andrewbranch

TypeScript Version: 4.0.0-dev.20200713

Search Terms: module none target

Code

// @module: none
// @target: es2015
export class Foo {}

Expected behavior:

TS1148 Cannot use imports, exports, or module augmentations when '--module' is 'none' and emits export class Foo {}

Actual behavior:

No error, and emits as CommonJS.

Playground Link: https://www.typescriptlang.org/play/?module=0#code/KYDwDg9gTgLgBAYwDYEMDOa4DEITgbwF8AoIA

Related issues: #39597

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking ChangeWould introduce errors in existing codeBugA bug in TypeScriptDomain: ES ModulesThe issue relates to import/export style module behaviorRescheduledThis issue was previously scheduled to an earlier milestone

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions