-
-
Notifications
You must be signed in to change notification settings - Fork 664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rule Proposal: Disallow shadowing of native HTML event names #2557
Comments
This was referenced Sep 16, 2024
JoCa96
added a commit
to SchwarzIT/onyx
that referenced
this issue
Sep 17, 2024
…tion here until it is [released offically](vuejs/eslint-plugin-vue#2557)
JoCa96
added a commit
to SchwarzIT/onyx
that referenced
this issue
Sep 17, 2024
…tion here until it is [released offically](vuejs/eslint-plugin-vue#2557)
JoCa96
added a commit
to SchwarzIT/onyx
that referenced
this issue
Sep 17, 2024
…lint-plugin-vue" until its released (#1877) Duplicate "no-shadow-native-events" from "eslint-plugin-vue" until it is released: - PR with `eslint-plugin-vue`: vuejs/eslint-plugin-vue#2558 - Tests can also be found in that PR - Official Rule proposal: vuejs/eslint-plugin-vue#2557 Relates to #1603
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please describe what the rule should do:
Using native HTML event names (like
click
) for Vue component emits can lead to incorrect assumptions about the emit and cause confusion. This is caused by Vue emits behaving differently from native events. E.g. :event.target
might not match the actual event-listener's location.The rule would mostly be aimed at developers of component libraries or web components.
What category should the rule belong to?
[ ] Enforces code style (layout)
[x] Warns about a potential error (problem)
[x] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)
Provide 2-3 code examples that this rule should warn about:
Additional context
From a clean code perspective it is preferable to use an emit name that communicates intent (e.g., "close", "accept", "loadMore") over generic names.
The text was updated successfully, but these errors were encountered: