beforeDestroy
should be typed as never
within defineComponent
#12111
Labels
beforeDestroy
should be typed as never
within defineComponent
#12111
Vue version
3.2+
Link to minimal reproduction
https://play.vuejs.org/#eNp9kk1P4zAQhv/KyJeCVDXS7p5Qd6X94MAeAAFHCyk408TgjKPxpE1V9b8zcRToAZAixZ55xn7f8RzM765bbXs0F2adHPtOIJRU/7RGkjW/LPm2iyxwgAo3nvBv1D0hCRxhw7GFhRYvLFnCIYOKlX3I/1P87GAJ4Ak3kfEfJuG4PzuHHAQoCngEiuIdgjSotR2jK8VHgl3J5KkebxhRaTjuYCGNT6BfCYzBu0nKt9WwhCtFPL1oRvYdAjJHhtTEPlR6/VRPKhjgaOl4bmldTL7Vq24E2y6UgroDWFd+mxcAKbaodzm1EvbQ+poVqsDN/jJeTPy6ODnFLLWTLtLG16vnFEkbnV1bM9b6gHzTjUa12xdzP6wpQ4i7/zkm3ONyjrsG3csH8ec0jDFrbhkT8hatectJyTXKlL68v8ZB12/JNlZ9UPqL5B2mGPpR44T96alS2SdcVnuVB0Wf6iFdDoKUZlOj0NzvzFujAzOOxWfW3+V+X/2Y38kcXwHt7uZ0
Steps to reproduce
Attempt to use
beforeDestroy
withindefineComponent
What is expected?
A type error should be thrown
What is actually happening?
Only a deprecation warning is shown in the editor
System Info
Any additional comments?
When migrating large codebases, it's easy to miss things or have team members not realize an API has changed. We recently had
beforeDestroy
hooks used after our migration, and the error went unnoticed.I've always understood the term "deprecated" to mean that something still works, but is on it's way out. Here, these functions have already been removed and no longer work.
I think typing these properties as
never
would be more helpful.The text was updated successfully, but these errors were encountered: