简体   繁体   English

vue.js 禁用 max-len<template> 使用 eslint-plugin-vue

[英]vue.js disable max-len within <template> with eslint-plugin-vue

How can I disable the max-len warnings globally within the <template> </template> tags in the .vue files?如何在 .vue 文件的<template> </template>标签中全局禁用 max-len 警告?

The reason I want to do this is I don't want to write <!-- eslint-disable max-len --> each time.我想这样做的原因是我不想每次都写<!-- eslint-disable max-len -->

I also don't want to disable it globally for the whole vue file, so I still want to get a warning within the script tag.我也不想在整个 vue 文件中全局禁用它,所以我仍然想在脚本标签中收到警告。

Currently there is no way to do that.目前没有办法做到这一点。 Check this thread .检查这个线程

What you can do is use你可以做的是使用

<!-- eslint-disable --> <!-- eslint-enable -->

inside every template you want to disable.在您要禁用的每个模板中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM