no-misused-new
NOTE: this rule is part of the
recommended
rule set.Enable full set in
deno.json
:{ "lint": { "tags": ["recommended"] } }
Enable full set using the Deno CLI:
deno lint --tags=recommended
Disallows defining constructor
s 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;
}