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

Latest commit

 

History

History
88 lines (61 loc) · 1.47 KB

dt-header.md

File metadata and controls

88 lines (61 loc) · 1.47 KB

dt-header

(This rule is specific to DefinitelyTyped.)

Checks the format of DefinitelyTyped header comments.


Bad:

// Type definitions for foo v1.2.3
  • Don't include v
  • Don't include a patch version

Good:

// Type definitions for foo 1.2

Bad:

// Definitions by: My Name <http://geocities.com/myname>

Good:

// Definitions by: My Name <https://github.com/myname>
  • Prefer a GitHub username, not a personal web site.

Bad:

foo/index.d.ts:

// Type definitions for abs 1.2
// Project: https://github.com/foo/foo
// Definitions by: My Name <https://github.com/myname>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export { f } from "./subModule";

foo/subModule.d.ts:

// Type definitions for abs 1.2
// Project: https://github.com/foo/foo
// Definitions by: My Name <https://github.com/myname>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export function f(): number;

foo/ts3.1/index.d.ts:

// Type definitions for abs 1.2
// Project: https://github.com/foo/foo
// Definitions by: My Name <https://github.com/myname>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export function f(): number;

Good:

foo/index.d.ts: Same

foo/subModule.d.ts:

export function f(): number;

foo/ts3.1/index.d.ts:

export function f(): number;

Don't repeat the header -- only do it in the index of the root.