We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deno-lint(constructor-super)
class Base { #name: string #index: number constructor(foo: { name: string, index: number }) { this.#name = foo.name this.#index = foo.index } print() { console.log(`${this.#name} - ${this.#index}`) } } class Derived extends Base { constructor(foo: string) constructor(foo: { name: string, index: number } | string) { if (typeof foo === "string") { super({ name: foo, index: 0 }) } else { super(foo) } } } new Derived('hello').print()
No warning. (the ts playground site is happy with it as well)
deno 1.43.1 (release, x86_64-pc-windows-msvc) v8 12.4.254.12 typescript 5.4.3
As i was writing this I found a workaround (apart from disabling the lint)
class Derived extends Base { constructor(foo: string) constructor(foo: { name: string, index: number } | string) { let arg: { name: string, index: number } | string; if (typeof foo === "string") { arg = { name: foo, index: 0 } } else { arg = foo } super(arg) } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Lint Name
deno-lint(constructor-super)
Code Snippet
Expected Result
No warning. (the ts playground site is happy with it as well)
Actual Result
Additional Info
Version
deno 1.43.1 (release, x86_64-pc-windows-msvc)
v8 12.4.254.12
typescript 5.4.3
workaround
As i was writing this I found a workaround (apart from disabling the lint)
The text was updated successfully, but these errors were encountered: