Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 814 Bytes

no-expression-like-strings.md

File metadata and controls

27 lines (17 loc) · 814 Bytes

no-expression-like-strings

This lint rule helps catch typos around Handlebars expressions that are missing the initial curly brace.

If you happen to accidentally put something like this in your template:

<FooBar @prop='{value}}' />

Or this:

<FooBar @prop='{value}' />

You probably wanted to actually write this instead:

<FooBar @prop={{value}} />

Somewhat surprisingly, all three are valid, but the first two examples treat {value}} and {value} as strings, while the last is a Handlebars expression accessing the value variable within the current context.

When Not To Use This

If you are actually trying to pass a string literal that starts with { and ends with }, then you should disable this rule for that line in your template.