# svelte/spaced-html-comment

enforce consistent spacing after the <!-- and before the --> in a HTML comment

  • 🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

# 📖 Rule Details

This rule will enforce consistency of spacing after the start of a comment <!-- and before the end of a comment -->.

<script>
  /* eslint svelte/spaced-html-comment: "error" */
</script>

<!-- ✓ GOOD -->

<!--✗ BAD-->

You cannot enforce this style by using prettier-plugin-svelte. That is, this rule does not conflict with prettier-plugin-svelte and can be used with prettier-plugin-svelte.

# 🔧 Options

{
  "svelte/spaced-html-comment": [
    "error",
    "always" // or "never"
  ]
}
  • "always" … There must be at least one whitespace after <!-- and before -->.
  • "never" … There should be no leading or trailing whitespace. There should be no whitespace following.

# 🚀 Version

This rule was introduced in eslint-plugin-svelte v0.0.1

# 🔍 Implementation