Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
xiaocaibird opened this issue Mar 12, 2023 · 0 comments · Fixed by #53385
Closed

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

xiaocaibird opened this issue Mar 12, 2023 · 0 comments · Fixed by #53385
Assignees
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue

Comments

@xiaocaibird
Copy link

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

@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Mar 14, 2023
@andrewbranch andrewbranch added Bug A bug in TypeScript and removed Needs Investigation This issue needs a team member to investigate its status. labels Mar 20, 2023
@andrewbranch andrewbranch added this to the TypeScript 5.0.3 milestone Mar 20, 2023
@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants