⚙️ This rule is included in the following preset configs:
*.configs["flat/base"]
*.configs["flat/vue2-essential"]
*.configs["flat/essential"]
*.configs["flat/vue2-strongly-recommended"]
*.configs["flat/strongly-recommended"]
*.configs["flat/vue2-recommended"]
*.configs["flat/recommended"]
"plugin:vue/base"
"plugin:vue/vue2-essential"
"plugin:vue/essential"
"plugin:vue/vue2-strongly-recommended"
"plugin:vue/strongly-recommended"
"plugin:vue/vue2-recommended"
"plugin:vue/recommended"
Sole purpose of this rule is to provide eslint-disable functionality in the <template> and in the block level. It supports usage of the following comments:
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.
Now loading...
The eslint-disable-like comments can be used in the <template> and in the block level.
Now loading...
The eslint-disable comments has no effect after one block.
Now loading...
The eslint-disable-like comments can include descriptions to explain why the comment is necessary. The description must occur after the directive and is separated from the directive by two or more consecutive - characters. For example:
vue/comment-directive
*.configs["flat/base"]*.configs["flat/vue2-essential"]*.configs["flat/essential"]*.configs["flat/vue2-strongly-recommended"]*.configs["flat/strongly-recommended"]*.configs["flat/vue2-recommended"]*.configs["flat/recommended"]"plugin:vue/base""plugin:vue/vue2-essential""plugin:vue/essential""plugin:vue/vue2-strongly-recommended""plugin:vue/strongly-recommended""plugin:vue/vue2-recommended""plugin:vue/recommended"Sole purpose of this rule is to provide
eslint-disablefunctionality in the<template>and in the block level. It supports usage of the following comments:eslint-disableeslint-enableeslint-disable-lineeslint-disable-next-lineNote
We can't write HTML comments in tags.
📖 Rule Details
ESLint doesn't provide any API to enhance
eslint-disablefunctionality 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.vuefile processor, then the post-process removes allvue/comment-directiveerrors and the reported errors in disabled areas.The
eslint-disable-like comments can be used in the<template>and in the block level.The
eslint-disablecomments has no effect after one block.The
eslint-disable-like comments can include descriptions to explain why the comment is necessary. The description must occur after the directive and is separated from the directive by two or more consecutive-characters. For example:🔧 Options
reportUnusedDisableDirectives... Iftrue, to report unusedeslint-disableHTML comments. defaultfalse{ "reportUnusedDisableDirectives": true }Note
Unused reports cannot be suppressed with
eslint-disableHTML comments.📚 Further Reading
🚀 Version
This rule was introduced in eslint-plugin-vue v4.1.0
🔍 Implementation