Как отключить эту ошибку Eslint «Ожидается новый разрыв строки до и после HTML-теги»? - PullRequest
0 голосов
/ 09 февраля 2019

Я использую nuxt JS и каждый раз, когда я запускаю 'npm run dev', я получаю эту ошибку:

       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

Как отключить эту ошибку?

Ответы [ 2 ]

0 голосов
/ 01 августа 2019

Это предупреждение говорит о том, что вам следует избегать однострочных тегов.Например, вместо

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

просто используйте это:

<nuxt-link to="/test">
  Another page
</nuxt-link>
0 голосов
/ 09 февраля 2019

ок, исправил проблему.Ошибка произошла из-за

eslint-plugin-vue

Итак, я добавил следующий код в мой файл eslintrc.js

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