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

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;