Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Latest commit

 

History

History
29 lines (21 loc) · 400 Bytes

export-just-namespace.md

File metadata and controls

29 lines (21 loc) · 400 Bytes

export-just-namespace

Declaring a namespace is unnecessary if that is the module's only content; just use ES6 export syntax instead.

Bad:

namespace MyLib {
    export function f(): number;
}
export = MyLib;

Good:

export function f(): number;

Also good:

namespace MyLib {
    export function f(): number;
}
function MyLib(): number;
export = MyLib;