dtslint/docs/no-redundant-undefined.md

369 B

no-redundant-undefined

Avoid explicitly specifying undefined as a type for a parameter or property which is already optional.

Bad:

function f(s?: string | undefined): void {}

Good:

function f(s?: string): void {}

Bad:

interface I {
    s?: string | undefined;
}

Good:

interface I {
    s?: string;
}