vue项目如何关闭eslint语法检测

2025年02月02日 建站教程

在新增vue项目的时候不小心开启了eslint语法检测​,导致页面经常性报错,那么如何关闭eslint语法检测呢?下面给大家简单介绍一下!

全局禁用eslint检测

//.eslintrc.js

rules: {
 'max-len': 'off',
 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
}

单个文件禁用eslint检测

//1、放置于文件最顶部
/* eslint-disable */

//2、文件中临时禁止规则出现警告
/* eslint-disable */
...代码
/* eslint-enable */

//3、对指定规则的启用或者禁用警告
/* eslint-disable no-alert, no-console */
...代码
/* eslint-enable no-alert, no-console */

本文链接:http://so.lmcjl.com/news/22526/

展开阅读全文
相关内容