-
Notifications
You must be signed in to change notification settings - Fork 37
Description
When using events, a component has the option of choosing between the Event and CustomEvent interfaces. Our strong recommendation is to go with the CustomEvent interface because this will provide a more consistent experience. The framework may need to patch properties and methods of events to prevent component internals from leaking or to normalize implementations between browsers, and using CustomEvent guarantees that your component is covered.
I think it's ok to restrict usage of new Event() out of the gate unless we know of any use cases where users have to do that instead of new CustomEvent().
Edit: This issue has been migrated from the eslint-plugin repo. This restriction can be enforced by configuring the standard no-restricted-globals rule instead of creating a brand new rule.