The Wire · Showcase
ESLINT-PLUGIN-VUE SHIPS NATIVE EVENT SHADOWING RULE, DEVTOOLS 8.2.0 LANDS
By RepoJournal · Filed · About Vue.js
Vue's linter just caught a footgun developers didn't know they had: shadowing native HTML events in component emits.
eslint-plugin-vue merged the `no-shadow-native-events` rule [1], a new check that prevents component events from accidentally overriding native DOM event names. The implementation draws from the `Events` interface in `@vue/runtime-dom` and follows the pattern of the existing `require-explicit-emits` rule [2]. Simultaneously, the plugin fixed a false positive in `use-v-on-exact` where `@keydown.stop` listeners were incorrectly flagged when paired with exact key-specific handlers [3]. A third PR expands rule support to cover `@nuxtjs/composition-api` as a recognized Vue package [4]. On the devtools front, v8.2.0 shipped with a no-op stub for the devtools-api under Node export conditions, solving compatibility issues in server-side environments [5], while fixing a UX bug that left pin reorder buttons active at list boundaries [6]. One more PR refactored `processInject` to eliminate a potential runtime error caused by calling `hasOwnProperty` on objects created with `Object.create(null)` [7]. All told: 7 commits, 6 PRs, 1 release across both repos.
One email a day. Unsubscribe in one click.
Keep up with Vue.js in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Review the new no-shadow-native-events rule for your component libraries vuejs/eslint-plugin-vue [plan]
- → Upgrade devtools to v8.2.0 if you're running Node-based development tooling vuejs/devtools [plan]
- → Check for false positives in use-v-on-exact rules with keydown.stop listeners vuejs/eslint-plugin-vue [monitor]
References
- [1] feat(no-shadow-native-events): initial implementation ↗ vuejs/eslint-plugin-vue
- [2] feat(no-shadow-native-events): initial implementation (#2558) vuejs/eslint-plugin-vue
- [3] Fix use-v-on-exact false positive for keydown stop listener ↗ vuejs/eslint-plugin-vue
- [4] feat: support `@nuxtjs/composition-api` ↗ vuejs/eslint-plugin-vue
- [5] v8.2.0 ↗ vuejs/devtools
- [6] fix(client): disable pin reorder buttons at list bounds (#1105) vuejs/devtools
- [7] refactor(kit): processInject ↗ vuejs/devtools