JS.VUE.MUSTACHE.INTERPOLATION.SPACING

Enforce unified spacing in mustache interpolations

Rule Details

This rule aims at enforcing unified spacing in mustache interpolations.

{'vue/mustache-interpolation-spacing': ['error']}

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

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

Options

Copy
{
  "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"

{'vue/mustache-interpolation-spacing': ['error', 'never']}

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

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

The content on this page is adapted from the ESLint User Guide. Copyright © OpenJS Foundation and other contributors, www.openjsf.org. All rights reserved. https://eslint.org/docs/rules/