Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 903 Bytes

no-unbalanced-curlies.md

File metadata and controls

49 lines (35 loc) · 903 Bytes

no-unbalanced-curlies

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:

{{ x }
{{ x }}}
{{{ x }
{{{ x }}

Whereas these are not:

{ x }}
{ x }
}
}}
}}}
}}}}... (any number of closing curlies past one)

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

Examples

This rule forbids the following:

foo}}
{foo}}
foo}}}
{foo}}}

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:

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

References