vue/no-deprecated-events-api
eslint-plugin-vue
No autofixRecommended
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-deprecated-events-api": "error",
},
},
];<script>
export default {
mounted() {
this.$on('event', () => {})
this.$off('event')
this.$once('event', () => {})
}
}
</script><script>
import mitt from 'mitt'
const emitter = mitt()
export default {
mounted() {
emitter.on('event', () => {})
emitter.off('event')
emitter.once('event', () => {})
}
}
</script>Examples from the Oxlint documentation.
vue/no-deprecated-events-api
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-deprecated-events-api": "error",
},
},
];vue/no-deprecated-events-api
vue plugin · correctness
{
"plugins": [
"vue"
],
"rules": {
"vue/no-deprecated-events-api": "error"
}
}nursery/noVueDeprecatedEventsApi
nursery · since 2.6.5
{
"linter": {
"rules": {
"nursery": {
"noVueDeprecatedEventsApi": "error"
}
}
}
}Disallow using deprecated destroyed and beforeDestroy lifecycle hooks (in Vue.js 3.0.0+)
Disallow deprecated model definition (in Vue.js 3.0.0+)
Disallow using deprecated $delete and $set (in Vue.js 3.0.0+)
Disallow deprecated this access in props default function (in Vue.js 3.0.0+)
Disallow using deprecated object declaration on data (in Vue.js 3.0.0+)
Disallow using deprecated Vue.config.keyCodes (in Vue.js 3.0.0+)