Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 1.35 KB

no-direct-composable-in-event-handler.md

File metadata and controls

43 lines (29 loc) · 1.35 KB
pageClass sidebarDepth title description since
rule-details
0
vue/no-direct-composable-in-event-handler
disallow direct composable usage in event handler
v10.1.0

vue/no-direct-composable-in-event-handler

disallow direct composable usage in event handler

  • ⚙️ This rule is included in all of "plugin:vue/essential", *.configs["flat/essential"], "plugin:vue/strongly-recommended", *.configs["flat/strongly-recommended"], "plugin:vue/recommended" and *.configs["flat/recommended"].

This rule prevents directly calling a composable function in an event handler.

📖 Rule Details

This rule prevents directly calling a composable function in an event handler. If something starts with use, it is considered a composable function.

<template>
  <!-- ✗ BAD -->
  <button @click="useFoo">Click me</button>
</template>

<script setup>
function useFoo() {}
</script>

🚀 Version

This rule was introduced in eslint-plugin-vue v10.1.0

🔍 Implementation