vue/no-shadow-native-events
eslint-plugin-vue
No autofix
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-shadow-native-events": "error",
},
},
];Disallow the use of event names that collide with native web event names
<button @click="$emit('click')">Close</button>
</template><button @click="$emit('close')">Close</button>Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
vue/no-shadow-native-events
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-shadow-native-events": "error",
},
},
];Oxlint does not have this rule.
nursery/noVueShadowNativeEvents
nursery · since 2.6.0
{
"linter": {
"rules": {
"nursery": {
"noVueShadowNativeEvents": "error"
}
}
}
}Disallow usages that lose the reactivity of props passed to setup
Disallow target="_blank" attribute without rel="noopener noreferrer"