vue/no-arrow-functions-in-watch
eslint-plugin-vue
No autofixRecommended
eslint.config.js
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-arrow-functions-in-watch": "error",
},
},
];<script>
export default {
watch: {
foo: () => {},
bar: {
handler: () => {}
},
baz: [
(val) => {},
{
handler: () => {}
}
]
}
}
</script><script>
export default {
watch: {
foo() {},
bar: function() {},
baz: {
handler: function() {}
},
}
}
</script>Examples from the Oxlint documentation.
vue/no-arrow-functions-in-watch
eslint-plugin-vue
import vue from "eslint-plugin-vue";
export default [
{
plugins: { vue },
rules: {
"vue/no-arrow-functions-in-watch": "error",
},
},
];vue/no-arrow-functions-in-watch
vue plugin · correctness
{
"plugins": [
"vue"
],
"rules": {
"vue/no-arrow-functions-in-watch": "error"
}
}suspicious/noVueArrowFuncInWatch
suspicious · since 2.3.14
{
"linter": {
"rules": {
"suspicious": {
"noVueArrowFuncInWatch": "error"
}
}
}
}Disallow asynchronous actions in computed properties
Disallow accessing computed properties in data
Disallow using deprecated object declaration on data (in Vue.js 3.0.0+)
Disallow using deprecated $delete and $set (in Vue.js 3.0.0+)
Disallow using deprecated destroyed and beforeDestroy lifecycle hooks (in Vue.js 3.0.0+)
Disallow using deprecated events api (in Vue.js 3.0.0+)