For one shot small project, this is fine.
For a big complex project, If you see they already use this. You are mostly already screwed.
They eventually moved to flux pattern due to this.
That said. It is possible to avoid such situation with strong lint rule. Like you did here. But you can avoid it completely with ~~JUST DON'T~~ .
Why should a framework encourage people to do bad things?
It `is` fine to use it and only use on notification purpose, but there is no way to enforce everyone to do so.
More of time it `will` be used in a terrible way that I just described (something like .emit('login') and trigger some random function causing xhr and emit notification everywhere).
You can't really assume everyone will use them nicely instead of resulting in spaghetti code. It is not the case most of time.
The experience I learned from I start coding is. `Anything designed to be easy to mess up will eventually mess up`
Basically, it’s not like they added a formalized way to create notification buses. They simply removed a useful and widely used feature because they didn’t like how people were using it. This is exactly the kind of shit that killed Angular and honestly makes me reevaluate the trust I’ve placed in Vue. Improvements are always welcome. Wholesale removing useful features without providing an alternative, not so much.
Moreover, You can polyfill it simply in one line. And it actually exist long before the vue ever exist.
const { EventEmitter } = require('events').
It always make me wonder why was vue ever want to pack this into itself given it did not use it as all.