-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
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
Consider enabling "noImplicitOverride"
by default
#11836
Comments
I think it's a good to enable |
I think it is one of the best improvements they ever made! I always hated inheritance due to not being sure if the extended class method was overriding the base class. It would be great to enable |
for future searchers to enable this add to deno.json {
"compilerOptions": {
"noImplicitOverride": true
}
} (take from denoland/std#1933) |
Maybe this can be considered for deno 2.0 ? |
though I just discovered this issue microsoft/TypeScript#47250 which makes this feature in my opinion partially finished |
We're doing this for Deno 2. |
I think this one hasn't been decided yet or implemented, so reopening. |
In TypeScript 4.3, the
override
keyword was introduced which ensure when type checking code that a method with theoverride
keyword is present in the base class. This helps make it more explicit when extending classes. In addition, there is the flag"noImplicitOverride"
which enforces that if a method is present in a base class and the extended class that theoverride
keyword is present in the extended class, helping ensure that users don't "accidentally" override a method unintentionally.I am personally not sure about this, as it has a lot of potential to break existing code, but I wanted to bring it up so that we can try to consider what "version" of TypeScript we want to support in Deno. The existing behaviour allows people to opt-in to using
override
for the protection it offers, but essentially doesn't deliver as "safe" as code as possible.The text was updated successfully, but these errors were encountered: