Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 440 Bytes

no-single-declare-module.md

File metadata and controls

19 lines (14 loc) · 440 Bytes

no-single-declare-module

declare module should typically be avoided. Instead, the file itself should be used as the declaration for the module. TypeScript uses module resolution to determine what files are associated with what modules.

Bad:

declare module "mylib" {
    function foo(): number;
}

Good:

export function foo(): number;