Skip to content

Should the 'verbatimModuleSyntax' check the d.ts file? #53227

Closed
@xiaocaibird

Description

@xiaocaibird

Bug Report

We can no longer use export = in a d.ts file when 'verbatimModuleSyntax' is enabled ?

Should the 'verbatimModuleSyntax' check the d.ts file?

The d.ts file has no any side effects.

TS Version: 5.0.1-rc

💻 Code

// type1.d.ts
declare namespace NS {
    type A = object;
}

export = NS;
export as namespace MyTypes;
// type2.d.ts
import type * as NS from 'moduleA';

export = NS;
export as namespace ModuleATypes;

🙁 Actual behavior

TS1282: An 'export =' declaration must reference a value when 'verbatimModuleSyntax' is enabled, but 'NS' only refers to a type.

🙂 Expected behavior

compile success

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions