I'm not a total typescript guru, so this could definitely be a "me" problem but based on the docs for the typescript/no-misused-new rule I would expect this example
interface TestInterface {
new (config: Record<string, any>): TestInterface;
}
interface SomeObject {
Test: TestInterface
}
class TestClass {
constructor(config: Record<string, any>) {
console.log({config});
}
}
const someObject: SomeObject = {
Test: TestClass
}
new someObject.Test({config: 'value'});
Specifically because of the second example of correct code:
interface I {
new (): C;
}
Instead, I'm seeing an Oxc warning
Oxc Warning: Interfaces cannot be constructed, only classes.
Playground link
I'm not a total typescript guru, so this could definitely be a "me" problem but based on the docs for the
typescript/no-misused-newrule I would expect this exampleSpecifically because of the second example of correct code:
Instead, I'm seeing an Oxc warning
Playground link