Skip to content

Files

Latest commit

 

History

History
54 lines (37 loc) · 1.13 KB

mustache-interpolation-spacing.md

File metadata and controls

54 lines (37 loc) · 1.13 KB

Pattern: Malformed spacing for mustache interpolation

Issue: -

Description

This rule aims at enforcing unified spacing in mustache interpolations.

<template>
  <!-- ✓ GOOD -->
  <div>{{ text }}</div>
  <div>{{   text   }}</div><!-- Use vue/no-multi-spaces rule to disallow multiple spaces. -->

  <!-- ✗ BAD -->
  <div>{{text}}</div>
</template>

Options

{
  "vue/mustache-interpolation-spacing": ["error", "always" | "never"]
}
  • "always" (default) ... Expect one space between expression and curly brackets.
  • "never" ... Expect no spaces between expression and curly brackets.

"never"

<template>
  <!-- ✓ GOOD -->
  <div>{{text}}</div>

  <!-- ✗ BAD -->
  <div>{{   text   }}</div>
  <div>{{ text }}</div>
</template>

Further Reading