noImplicitOverride
Overriding has to be deliberate
Requires the `override` keyword on any member that replaces one from the base class.
- Since
- TypeScript 4.3
- strict
- Not in strict
- In your tsconfig
"noImplicitOverride": true
The same snippet both times. Only the option changed.
With it off
"noImplicitOverride": falseclass Base {
greet() {
return 'hi'
}
}
export class Child extends Base {
greet() {
return 'yo'
}
}Compiles clean
With it on
"noImplicitOverride": trueclass Base {
greet() {
return 'hi'
}
}
export class Child extends Base {
greet() {
return 'yo'
}
}Emits TS4114
Why the compiler bothers
The failure this prevents runs in the other direction from the obvious one. The risk is not writing `override` on something that overrides nothing — it is a base class adding a method that a subclass already has, silently turning an independent member into an override nobody reviewed. With the keyword required, the compiler notices when the relationship changes underneath you, which is the only moment the information is useful.
Takeaway
The keyword is not documentation. It is a tripwire on the base class.
Where to go next
22 options

