Skip to content

Does @override will be mandatory in the future? #3494

Answered by urugator
gcattan asked this question in General
Discussion options

You must be logged in to vote

required in the future

Will likely depend on ES decorators spec status/implementation.
https://github.com/tc39/proposal-decorators

it is a good practice to put it

It is:

  1. It makes sure the field in super is decorated, which provides similar benefits to TS's override keyword:
    https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-3.html#override-and-the---noimplicitoverride-flag
  2. It's easier to eventually remove it than add it where necessary.
  3. It's possible you will have to replace it with different decorator (again depens on ES spec) - besides being easier to locate, we can change the override implementation to provide a friendly warning/instruction (or perhaps even a …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gcattan
Comment options

Answer selected by kubk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants