Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

How do I turn off this Eslint error "Expected new line break before and after html tags"?

Ask Question

I am using nuxt JS and everytime I run 'npm run dev', I get this error:

       7:40  warning  Expected 1 line break after opening tag (`<v-card-title>`), but no line breaks found    vue/singleline-html-element-content-newline
      17:81  warning  Expected 1 line break before closing tag (`</v-card-title>`), but no line breaks found  vue/singleline-html-element-content-newline
      20:14  warning  Expected 1 line break after opening tag (`<p>`), but no line breaks found               vue/multiline-html-element-content-newline
      23:12  warning  Expected 1 line break after opening tag (`<a>`), but no line breaks found               vue/multiline-html-element-content-newline
      23:25  warning  Expected 1 line break before closing tag (`</a>`), but no line breaks found             vue/multiline-html-element-content-newline
      23:30  warning  Expected 1 line break before closing tag (`</p>`), but no line breaks found             vue/multiline-html-element-content-newline
      24:14  warning  Expected 1 line break after opening tag (`<p>`), but no line breaks found               vue/multiline-html-element-content-newline
      28:12  warning  Expected 1 line break after opening tag (`<a>`), but no line breaks found               vue/multiline-html-element-content-newline
      28:19  warning  Expected 1 line break before closing tag (`</a>`), but no line breaks found             vue/multiline-html-element-content-newline
      28:24  warning  Expected 1 line break before closing tag (`</p>`), but no line breaks found             vue/multiline-html-element-content-newline
      29:14  warning  Expected 1 line break after opening tag (`<p>`), but no line breaks found               vue/multiline-html-element-content-newline
      33:12  warning  Expected 1 line break after opening tag (`<a>`), but no line breaks found               vue/multiline-html-element-content-newline
      33:23  warning  Expected 1 line break before closing tag (`</a>`), but no line breaks found             vue/multiline-html-element-content-newline
      33:28  warning  Expected 1 line break before closing tag (`</p>`), but no line breaks found             vue/multiline-html-element-content-newline
      42:12  warning  Expected 1 line break after opening tag (`<a>`), but no line breaks found               vue/multiline-html-element-content-newline
      42:30  warning  Expected 1 line break before closing tag (`</a>`), but no line breaks found             vue/multiline-html-element-content-newline
      47:12  warning  Expected 1 line break after opening tag (`<a>`), but no line breaks found               vue/multiline-html-element-content-newline
      47:23  warning  Expected 1 line break before closing tag (`</a>`), but no line breaks found             vue/multiline-html-element-content-newline
      56:12  warning  Expected 1 line break after opening tag (`<v-btn>`), but no line breaks found           vue/multiline-html-element-content-newline
      56:20  warning  Expected 1 line break before closing tag (`</v-btn>`), but no line breaks found         vue/multiline-html-element-content-newline

How do I turn off this error?

Are you using VS Code? If so you need to turn off that rule check in VS Code settings for linting. – Len Joseph Feb 9, 2019 at 5:48

So, I added following code in my eslintrc.js file

'vue/singleline-html-element-content-newline': 'off',
'vue/multiline-html-element-content-newline': 'off',

This warning says that you should avoid single line tags. For example, instead of

<nuxt-link to="/test">Another page</nuxt-link>

just use this:

<nuxt-link to="/test">
  Another page
</nuxt-link>
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.