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

Latest commit

 

History

History
35 lines (26 loc) · 407 Bytes

no-declare-current-package.md

File metadata and controls

35 lines (26 loc) · 407 Bytes

no-declare-current-package

Avoid using declare module, and prefer to declare module contents in a file.

Bad:

// foo/index.d.ts
declare module "foo" {
    export const x = 0;
}

Good:

// foo/index.d.ts
export const x = 0;

Bad:

// foo/index.d.ts
declare module "foo/bar" {
    export const x = 0;
}

Good:

// foo/bar.d.ts
export const x = 0;