no-misused-new
What it does
Section titled “What it does”Reports new and constructor declarations that do not describe a constructor: a class method signature new(): C; without a body that returns the class itself, an interface signature new (): I that returns the interface itself, and an interface member named constructor(). A class method named new with a body is not reported.
Why it matters
Section titled “Why it matters”An interface cannot be constructed, so new (): I inside interface I describes a constructor that does not exist, and an interface member constructor() is only a method with that name, not a constructor. The code reads as a constructor but is not one.
To fix, declare the constructor in the class (constructor()), or put the new signature on a separate interface that types the constructor.
Example
Section titled “Example”...function local(require: (id: string) => void) { require("d"); }...class K { new(): K; new(): number; new() {} }interface I { new (): I; new (): number; constructor(): void }function f(): void;function g(): void {}...Configuration
Section titled “Configuration”js: lint: rules: no-misused-new: error # off, warn, error (default)Enabled by the presets: js/typescript-eslint-recommended, js/biome-recommended, js/oxlint.
Suppress one line with sudsy-disable-next-line no-misused-new in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| typescript-eslint | no-misused-new |
full |