Skip to content

"boundOnly" option for vue/v-on-function-call #1812

Closed
@iliubinskii

Description

@iliubinskii

Please describe what the rule should do:

Same as:
https://typescript-eslint.io/rules/unbound-method/

What category should the rule belong to?
[ ] Enforces code style (layout)
[+] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)

Provide 2-3 code examples that this rule should warn about:

<script lang="ts">
import { defineComponent } from "vue";

class C {
  public f(): number {
    return this.x;
  }

  protected x = 1;
}

export default defineComponent({
  name: "page-settings",
  setup() {
    return {
      c: new C()
    };
  }
});
</script>

<template>
  <q-button @click="c.f" />
</template>

Additional context

New rule should report missing brakets for <q-button @click="c.f" />

Without brackets it throws run-time error:
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions