vue.jsvuejs2vuejs3eslintairbnb-js-styleguide

How to disable eslint rule max line length for paragraph in <template> of vue.js?


I am using airbnb eslint and currently I am getting error:

error: Line 6 exceeds the maximum line length of 100 (max-len) at path/to/file.vue:6:1:

<template lang="pug">
  div
    .container
      .row
        .col-xl-10.mx-auto
          p Please let us know how you got here, and use the header buttons to navigate back to safe harbor.
</template>

Is there a way to disable lint for paragraph text like above?
Also, how to increase the line length from 100 to 120?


Solution

  • For eslint-plugin-vue >= 4.1.0 you can use directive comments to disable eslint.

    https://github.com/vuejs/eslint-plugin-vue/commit/ad84e0ba6d81f24583e65fc70b1d9803d73d3ed9

    <template>
      <!-- eslint-disable-next-line vue/max-attributes-per-line -->
      <div a="1" b="2" c="3" d="4">
      </div>
    </template>