Skip to content

Transform namespaces declared with module keyword to namespace keyword in d.ts files #77

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

Conversation

CC972
Copy link

@CC972 CC972 commented Apr 20, 2023

Fixes microsoft#51825.

With this PR, we encourage people to move away from declaring namespaces with the module keyword.

Currently, if we have foo.ts:

module foo {}

This leads to the following foo.d.ts file:

declare module foo {}

This PR changes the declaration emit to transform module to namespace:

declare namespace foo {}

"Ambient module declarations", such as the below, will be unaffected:

declare module "bar" {}

@CC972 CC972 force-pushed the deprecate-namespaces-declared-with-module-keyword branch from 69c0ea1 to 2ca15ab Compare April 24, 2023 15:11
@CC972 CC972 changed the base branch from CC972/deprecate-namespaces-declared-with-module-keyword to master April 24, 2023 15:12
@CC972 CC972 changed the base branch from master to CC972/deprecate-namespaces-declared-with-module-keyword April 24, 2023 15:12
@CC972 CC972 force-pushed the deprecate-namespaces-declared-with-module-keyword branch from 2ca15ab to 171d3db Compare April 24, 2023 15:29
@dragomirtitian dragomirtitian merged commit 3c8ce2a into CC972/deprecate-namespaces-declared-with-module-keyword May 4, 2023
@dragomirtitian dragomirtitian deleted the deprecate-namespaces-declared-with-module-keyword branch November 17, 2023 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants