Linting Nested Comment Erorr Vue VS Code

Viewed 43

Developing a vue application with the eslint-plugin-vue, I am getting the following error when trying to use the comment shortcut in VS code over a template section that contains a nested comment:

Parsing error: nested-comment. eslint-plugin-vue

Is there a setting in the linter config file that I can change to allow commenting over nested comments or do I need to restart the linter somehow?

enter image description here

Update: it would appear if I added the following line to my .eslintrc.js file, from this site https://eslint.vuejs.org/rules/no-parsing-error.html#vue-no-parsing-error I should not be seeing this error:

   'vue/no-parsing-error': ["error", {
      'nested-comment': false
    }]

However, it still remains. I do not have the option to run ESLint restart lint server in my command palette.

1 Answers

If you do have a .eslintrc.cjs file or anything alike, you could probably put that in there

/* eslint-env node */
module.exports = {
  [...],
  rules: {
    'vue/html-comment-indent': 'off',
  },
}

off is to say that you don't even want to hear about it anytime soon.
Otherwise, you can also use 'warn', if you want a warning.

Here is an official reference: https://eslint.vuejs.org/rules/html-comment-indent.html#vue-html-comment-indent

Related