Skip to content

Latest commit

 

History

History
65 lines (46 loc) · 1.43 KB

File metadata and controls

65 lines (46 loc) · 1.43 KB

ember/template-no-unnecessary-curly-parens

💼 This rule is enabled in the following configs: strict-gjs, strict-gts.

✅ The extends: 'plugin:ember/strict-gjs' or extends: 'plugin:ember/strict-gts' property in a configuration file enables this rule.

Disallow unnecessary curlies around simple values in templates. This is a stylistic rule that promotes cleaner template code. It only flags simple single identifiers without path separators or parameters.

Rule Details

This rule discourages the use of mustache curlies {{}} around simple single identifiers when they could potentially be expressed more simply.

Examples

Examples of incorrect code for this rule:

<template>
  {{value}}
</template>
<template>
  {{name}}
</template>
<template>
  {{count}}
</template>

Examples of correct code for this rule:

<template>
  {{helper param}}
</template>
<template>
  {{#if condition}}text{{/if}}
</template>
<template>
  {{this.property}}
</template>

References

  • strictGjs: true
  • strictGts: true