Vue 项目中的ESlint语法报错问题
在项目中的""和;经常会报错,真的很纠结,今天看到一个解决方法,可以不用卸载删除
在项目根目录中,新建一个.prettierrc文件,来移除分号,和替换为单引号。
{
"semi": false,
"singleQuote": true
}
这样就可以了,格式化也不会变为""了。
也可以禁用语法规则,修改.eslintrc.js文件:把报错的项禁用
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/essential',
'@vue/standard'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'space-before-function-paren': 0 //禁用这个规则
},
parserOptions: {
parser: 'babel-eslint'
}
}
Vue 项目中的ESlint语法报错问题的更多相关文章
- vue项目中使用echarts map报错Cannot read property 'push' of undefined nanhai.js
在vue中绘制地图需要加载一个本地china.json文件,我用的是get请求的方法加载的,而不是直接import,因为我怕import请求到的部署到线上的时候会有问题.如下是get请求方法: thi ...
- vue项目中echarts使用渐变效果报错echarts is not defined
解决办法:在当前单组件中在引用一次
- ESLint语法报错问题
编写javaScript过程中ESLint语法报错问题 ESLint语法要求: 双引号""需要替换成单引号'' 分号不允许出现 ()之前需要一个空格比如 login () (VSC ...
- 如何在VUE项目中添加ESLint
如何在VUE项目中添加ESLint 1. 首先在项目的根目录下 新建 .eslintrc.js文件,其配置规则可以如下:(自己小整理了一份),所有的代码如下: // https://eslint.or ...
- Vue 项目: npm run dev 报错 webpack-dev-server
从码云上下载vue项目,运行npm run dev 时报错: > webpack-dev-server --inline --progress --config build/webpack.de ...
- vue-cli创建的项目中引入第三方库报错 'caller', 'calle', and 'arguments' properties may not be...
http://blog.csdn.net/sophie_u/article/details/76223978 以在vue中引入mui第三方库为例: 虽然针对vue,有单独的vue-mui库可以使用,但 ...
- vue-cli创建的项目中引入第三方库报错'caller', 'calle', and 'arguments' properties may not be...
本文链接:https://blog.csdn.net/Sophie_U/article/details/76223978 问题: 在vue的main.js中引入mui.min.js时,报错. 如上,单 ...
- 在vue项目中添加eslint规则
自己配置脚手架时候如何安装eslint语法规则, 第一步安装 官方推荐的安装包如下 eslint eslint-config-standard eslint-plugin-standard eslin ...
- 在vue项目中禁用eslint
文章目录 1.在创建项目的时候不自动使用eslint 2.在package.json中删除所有的eslint,然后重新install 3.按照图片注释(亲测可用) 在使用eslin进行规则验证时,一点 ...
随机推荐
- mysql 5.7 增删改查及别名的用法
1.启动和停止服务 一)启动和停止 #启动服务: $sudo service mysql start #停止服务: $sudo service mysql stop 二)创建和选择数据库 [创建数据库 ...
- leetcode解题报告(26):Add Binary
描述 Given two binary strings, return their sum (also a binary string). For example, a = "11" ...
- 超炫酷的 Docker 终端 UI lazydocker
A simple terminal UI for both docker and docker-compose, written in Go with the gocui library. https ...
- Pytest权威教程07-Monkeypatching,对模块和环境进行Mock
目录 Monkeypatching,对模块和环境进行Mock 简单示例如: 猴子补丁方法 Monkeypatching 返回对象: 构建mock类 全局补丁示例如:阻止"requests&q ...
- [内网渗透]lcx端口转发
0x01 简介 lcx是一款端口转发工具,有三个功能: 第一个功能将本地端口转发到远程主机某个端口上 第二个功能将本地端口转发到本地另一个端口上 第三个功能是进行监听并进行转发使用 Lcx使用的前提是 ...
- Linux----添加zabbix-agent
1.zabbxi-agent安装及配置 1.1 获取官方zabbix源 [root@localhost ~]# rpm -ivh http://repo.zabbix.com/zabbix/3.4/r ...
- 记一次SpringContextHolder.getBean出现异常NoClassDefFoundError: Could not initialize class
代码如下: public class TestUtils { private static UserDao logDao = SpringContextHolder.getBean(UserDao.c ...
- Tensorflow object detection API(1)---环境搭建与测试
参考: https://blog.csdn.net/dy_guox/article/details/79081499 https://blog.csdn.net/u010103202/article/ ...
- mac环境使用python处理protobuf
安装 brew install protobuf 然后再安装protobuf需要的依赖 brew install autoconf automake libtool 验证是否安装成功 protoc – ...
- Mysql sql_mode设置 timestamp default 0000-00-00 00:00:00 创建表失败处理
往数据库里创建新表的时候报错: [Err] 1067 - Invalid default value for 'updateTime' DROP TABLE IF EXISTS `passwd_res ...