Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 1.89 KB

comment-directive.md

File metadata and controls

51 lines (36 loc) · 1.89 KB
pageClass sidebarDepth title description
rule-details
0
vue/comment-directive
support comment-directives in `<template>`

vue/comment-directive

support comment-directives in <template>

  • ⚙️ This rule is included in all of "plugin:vue/base", "plugin:vue/essential", "plugin:vue/vue3-essential", "plugin:vue/strongly-recommended", "plugin:vue/vue3-strongly-recommended", "plugin:vue/recommended" and "plugin:vue/vue3-recommended".

Sole purpose of this rule is to provide eslint-disable functionality in <template>. It supports usage of the following comments:

  • eslint-disable
  • eslint-enable
  • eslint-disable-line
  • eslint-disable-next-line

::: warning Note We can't write HTML comments in tags. :::

This rule doesn't throw any warning.

📖 Rule Details

ESLint doesn't provide any API to enhance eslint-disable functionality and ESLint rules cannot affect other rules. But ESLint provides processors API.

This rule sends all eslint-disable-like comments as errors to the post-process of the .vue file processor, then the post-process removes all vue/comment-directive errors and the reported errors in disabled areas.

<template>
  <!-- eslint-disable-next-line vue/max-attributes-per-line -->
  <div a="1" b="2" c="3" d="4">
  </div>
</template>

📚 Further reading

🔍 Implementation