Skip to content

List of syntactic definition file errors we could detect #9027

@RyanCavanaugh

Description

@RyanCavanaugh

Signatures that differ only by a single parameter type

declare function fn2(x: number): void;
// Error, write one signature taking string|number
declare function fn2(x: string): void;

Signatures that differ only by omitting by a parameter

declare function fn6(): void;
// Error, write one signature with one optional parameter
declare function fn6(s: string): void;

Use of the non-primitive names anywhere

(except in a interface Number { declaration)

declare var var1: Number; // Error, use 'number'

Optional parameters in callback positions:

declare function fn5(callback: (key: string, value?: number) => void): void;

Metadata

Metadata

Assignees

Labels

@typesRelates to working with .d.ts files (declaration/definition files) from DefinitelyTypedCommunity ToolingThis might be better handled by tooling from the community instead of built into TypeScript

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions