vue cli3及以上如何禁用eslint检查?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vue cli3及以上如何禁用eslint检查?相关的知识,希望对你有一定的参考价值。

参考技术A

方法一、创建配置文件来定义禁用范围
在根目录创建文件.eslintignore
加入如下内容
* / .js
* / .vue

方法二、在文件某行上面写以下标识,禁用下一行
// eslint-disable-next-line to ignore the next line.
console.log("这行esline不检查")

方法三、在文件中写上以下标识,禁用整个文件
/* eslint-disable */

方法四、修改package.json文件禁用全局:
"eslintConfig":
"root": true,
"env":
"node": true
,
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions":
"parser": "@babel/eslint-parser"
,
"rules":
"no-unused-vars":"off", //新增此行

,

以上是关于vue cli3及以上如何禁用eslint检查?的主要内容,如果未能解决你的问题,请参考以下文章