Skip to content

Latest commit

 

History

History
61 lines (45 loc) · 1.2 KB

File metadata and controls

61 lines (45 loc) · 1.2 KB

ember/template-no-unbalanced-curlies

💼 This rule is enabled in the 📋 template-lint-migration config.

Normally, the compiler will find stray curlies and throw a syntax error. However, it won't be able to catch every case.

For example, these are all syntax errors:

<template>
  {{ x }
  {{ x }}}
  {{{ x }
  {{{ x }}
</template>

Whereas these are not:

<template>
  { x }}
  { x }
  }
  }}
  }}}
  }}}}... (any number of closing curlies past one)
</template>

This rule focuses on closing double }} and triple }}} curlies with no matching opening curlies.

Examples

This rule forbids the following:

<template>
  foo}}
  {foo}}
  foo}}}
  {foo}}}
</template>

Migration

If you have curlies in your code that you wish to show verbatim, but are flagged by this rule, you can formulate them as a handlebars expression:

<template>
  <p>This is a closing double curly: {{ '}}' }}</p>
  <p>This is a closing triple curly: {{ '}}}' }}</p>
</template>

References