Skip to content

Oxc should rewrite module to namespace in isolated declarations emit #12844

@nicolo-ribaudo

Description

@nicolo-ribaudo

TypeScript has been working over the past years to remove support for the module keyword when defining namespaces (module Foo {}), freeing up the syntax space for the module declarations TC39 proposal. The next step is to show a deprecation error about it, starting from TS 6.0: microsoft/TypeScript#62211.

As part of this process, DefinitelyTyped removed all their usages of this syntax in 2023 (DefinitelyTyped/DefinitelyTyped#66292), and TypeScript started emitting namespace in .d.ts files even when the input code uses module (microsoft/TypeScript#54134).

The goal was to make sure that no new code published on npm uses the module syntax, so that it can be eventually removed.

It seems however that Oxc still generates .d.ts files that use module, if the input code uses module: https://playground.oxc.rs/#eNo9j0FrwzAMhf+K0bmMrbBLx24j143tmovqqMXgSEGWu5aS/14laeKLJVt633t3iHAAug6iFnrpaqbQiIR7y8HP8+OCGjB8hv1Hy2PLLcMOBA530MrTVW5seIWDaaUd5MS21iXKQFtz64+S184UuZxE++Vh3MGAWkgnQcxZ/n/JqvJ3tZI6aipHS+K4ZXtQ8tkL/aASl40gVSM1KRNj71wwKvZi5QouP/ma5b3e4AvPUM/kpoHK/vXt3eOlIhmNui+KGRUn9JPi21E6OtMc3UHHTH8zt8dhG+kTp1NacVHYVHLjqaalC+lRivs7YS40Tn6cvaqOD5Xbj54=. Would it be possible to change this?

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions