Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Latest commit

 

History

History
41 lines (30 loc) · 613 Bytes

no-misused-new.md

File metadata and controls

41 lines (30 loc) · 613 Bytes

Enforce valid definition of new and constructor. (no-misused-new)

Warns on apparent attempts to define constructors for interfaces or new for classes.

Rule Details

Examples of incorrect code for this rule.

class C {
    new(): C;
}

interface I {
    new (): I;
    constructor(): void;
}

Examples of correct code for this rule.

class C {
    constructor() {}
}
interface I {
    new (): C;
}

Options

{
    "typescript/no-misused-new": "error"
}

Compatibility