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

Sometimes, we want to disable eslint rule max line length for paragraph in template of Vue.js.

In this article, we’ll look at how to disable eslint rule max line length for paragraph in template of Vue.js.

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

To disable eslint rule max line length for paragraph in template of Vue.js, we can add a comment to disable the rule for one or more lines.

For instance, we write

<template>
  <!-- eslint-disable-next-line max-len -->
  <my-long-component>...</my-long-component>
</template>

to disable the line length eslint rule for the line right after the comment.

And we write

<template>
  <!-- eslint-disable max-len -->
  <my-long-component> ... </my-long-component>
  <!-- eslint-enable max-len -->
</template>

to disable the line length eslint rule for the line between the disable and enable comment.

Conclusion

To disable eslint rule max line length for paragraph in template of Vue.js, we can add a comment to disable the rule for one or more lines.