deno_lint logodeno_lint

All rules/no-misused-new

no-misused-new

Recommended

Disallows defining constructors for interfaces or new for classes

Specifying a constructor for an interface or defining a new method for a class is incorrect and should be avoided.

Invalid:

class C {
  new(): C;
}

interface I {
  constructor(): void;
}

Valid:

class C {
  constructor() {}
}

interface I {
  new (): C;
}