How disable eslint warning for a specific line in a template in a .vue file in VS Code How disable eslint warning for a specific line in a template in a .vue file in VS Code vue.js vue.js

How disable eslint warning for a specific line in a template in a .vue file in VS Code


See Vetur's documentation:

Install ESLint plugin for the best linting experience. Vetur's template linting is only for quick start and does not support rule configuration.

So, you have to:

  1. Install ESLint plugin

  2. Enable vue plugin and disable Vetur's linting (add to VS Code config):

    "vetur.validation.template": false,"eslint.validate": [  "javascript",  "javascriptreact",  "vue"]

If you don't have eslint and/or eslint-plugin-vue already installed, you should do that:

npm i eslint babel-eslint eslint-plugin-vue --save-dev

Simple config for ESLint:

{  "root": true,  "env": {    "node": true  },  "extends": ["plugin:vue/essential", "eslint:recommended"],  "rules": {  },  "parserOptions": {    "parser": "babel-eslint"  }}

You should save it either to .eslintrc file or to package.json under eslintConfig name.

And, it works:


If you really want to disable it, try the solution below (it works for me). Since you are specific about the rule it doesn't disable other warnings:

<!-- eslint-disable vue/no-v-html --><textarea  type="email"  name="message"  required  aria-required="true"  v-html="form.inputs.name.placeholder"/><!-- eslint-enable -->