Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork688
feat(no-shadow-native-events): initial implementation#2558
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Could you please fix the lint and test failures? |
@FloEdelmann Of course! Done! |
…lint-plugin-vue" until its released (#1877)Duplicate "no-shadow-native-events" from "eslint-plugin-vue" until it isreleased:- 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#2557Relates to#1603
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I haven't looked at the code yet, only at docs and tests. Apart from a few minor suggestions, those look good already!
{ | ||
filename: 'test.vue', | ||
code: ` | ||
<template> | ||
<div @click="$emit('click')"/> | ||
</template> | ||
<script setup> | ||
defineEmits(['click']) | ||
</script> | ||
`, | ||
errors: [ | ||
{ | ||
messageId: 'violation', | ||
line: 6, | ||
column: 20, | ||
endLine: 6, | ||
endColumn: 27 | ||
} | ||
] | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Shouldn't this report both the$emit()
call and thedefineEmits
definition?
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
…a96/eslint-plugin-vue into joca96/feat-no-shadow-native
Co-authored-by: Flo Edelmann <git@flo-edelmann.de>
Co-authored-by: Flo Edelmann <git@flo-edelmann.de>
{ | ||
messageId: 'violation', | ||
line: 4, | ||
column: 32, | ||
endLine: 4, | ||
endColumn: 37 | ||
}, | ||
{ | ||
messageId: 'violation', | ||
line: 4, | ||
column: 32, | ||
endLine: 4, | ||
endColumn: 37 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Should only report once
Uh oh!
There was an error while loading.Please reload this page.
Implementation of my proposed rule#2557 Rule Proposal: Disallow shadowing of native HTML event names.
The implementation is heavily based onrequire-explicit-emits.
The
dom-events.json
file is based on theEvents
interface of@vue/runtime-dom/dist/runtime-dom.d.ts
.