Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 1017 Bytes

File metadata and controls

42 lines (29 loc) · 1017 Bytes

ember/template-no-html-comments

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

Disallow HTML comments in templates. HTML comments will be visible in the rendered output, which may expose sensitive information or clutter the DOM.

Rule Details

This rule disallows HTML comments (<!-- -->) in templates and suggests using Glimmer comments ({{! }} or {{!-- --}}) instead.

Examples

Examples of incorrect code for this rule:

<template>
  <!-- This is an HTML comment -->
  <div>Content</div>
</template>

Examples of correct code for this rule:

<template>
  {{! This is a Glimmer comment }}
  <div>Content</div>
</template>

<template>
  {{!-- This is a block Glimmer comment --}}
  <div>Content</div>
</template>
  • strictGjs: true
  • strictGts: true