Skip to content

Implement autofix for this-in-template #1492

Closed
@NeonWizard

Description

@NeonWizard

What rule do you want to change?
eslint-plugin-vue/this-in-template

Does this change cause the rule to produce more or fewer warnings?
No.

How will the change be implemented? (New option, new default behavior, etc.)?
Adds the ability to try to automatically remove this from variables in the template.

Please provide some example code that this change will affect:

<template>
  <!-- ✓ AFTER -->
  <a :href="url">
    {{ text }}
  </a>
  
  <!-- ✗ BEFORE -->
  <a :href="this.url">
    {{ this.text }}
  </a>
</template>

What does the rule currently do for this code?
Just warns.

What will the rule do after it's changed?
Warns and attempts to fix if specified by removing this. prefix.

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