marisLincoln
marisLincoln

Reputation: 39

Vue: ESlint rule to remove "this" from template

I am trying to see if there's an existing ESlint rule that would remove this used before props or data.

Example:

<template>
  <div v-if="this.foo"></div>
</template>

Ideally, this would get caught by the linter because of this.foo rather than just foo. Does a rule for this exist? I tried searching the last few days but I had no luck finding one.

Upvotes: 0

Views: 52

Answers (1)

Riza Khan
Riza Khan

Reputation: 3158

this (no pun intended) is what you are looking for. Though it won't explicitly 'remove' it, it will throw an error for you to review I believe.

Upvotes: 3

Related Questions