用低版本脚手架安装vue项目时若选上ESLint时若出现No ESLint configuration found这样的错,解决方法如下:
npm init -y
npm install eslint --save-dev
./node_modules/.bin/eslint --init
以上三步执行完后No ESLint configuration found的问题便解决了,但会有其他的错误,因此,如果项目中有.eslintrc.js文件则把里面的内容改为以下内容,若没有该文件建立后写入以下代码:
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint'
},
env: {
browser: true,
},
extends: [
error-prevention
'plugin:vue/essential',
'standard'
],
plugins: [
'vue'
],
rules: {
'generator-star-spacing': 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
现在在运行项目就没有错啦!✌️✌️✌️✌️✌️✌️
————————————————
版权声明:本文为CSDN博主「smile@qingqing」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_43363871/article/details/94838553
网友评论