An interface declares a method named constructor where a new signature was meant
What it finds
interface Shape { constructor(size: number): Shape; }: in an interface or object type, constructor is an ordinary method named "constructor", not a description of how instances are made. A class implementing the interface would need a method of that name. A construct signature, new (size: number): Shape, describes what new accepts. Files marked @flow, where declare class bodies use constructor as in classes, are left alone.
From the rule's source, interface_constructor_method.rs.
interface Shape { constructor(size: number): Shape;tx0 reports: constructor here is a method name new (size: number): Shape; area(): number;} Turn it on, off or suppress it
The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/ts:interface-constructor-method" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/ts:interface-constructor-method] reason="..."tx0 explain tx0/ts:interface-constructor-method shows the same in the terminal. Found a false positive? Report it.