Vue中Eslint报错整理

本文深入探讨了ESLint中常见的缩进错误,包括'Expected indentation of 2 spaces but found 8'和'Expected indentation of 0 spaces but found 8',并提供了具体的解决办法,帮助开发者理解并修正代码中的缩进问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

错误提示:

1、缩进空格不规范,导致一场

EslintL Excepted indentation of 2 spaces but found 8 意思是只能有两个space,但是发现了8个,超出了6个的意思

EslintL Excepted indentation of 0 spaces but found 8 意思是只能有0个space,但是发现了8个,超出了8个的意思

总而言之,这两个异常基本都是超出了空间,如图:

fdfd6b5fe6345e2ac0f5e3e9c87bf738bb7.jpg

但是我把这个export缩紧两个空格,就不报错了,如下,这是占位符空间的问题

3fb35b79084b74e919147a52581caf0b5d0.jpg

2、

转载于:https://my.oschina.net/mdxlcj/blog/3001711

现在npm install 报错 F:\008717hz\houtai>npm install npm error code ERESOLVE npm error ERESOLVE could not resolve npm error npm error While resolving: @vue/cli-plugin-eslint@4.5.15 npm error Found: eslint@8.4.1 npm error node_modules/eslint npm error dev eslint@"8.4.1" from the root project npm error peer eslint@"^7.5.0 || ^8.0.0" from @babel/eslint-parser@7.16.5 npm error node_modules/@babel/eslint-parser npm error dev @babel/eslint-parser@"7.16.5" from the root project npm error 3 more (eslint-plugin-vue, eslint-utils, vue-eslint-parser) npm error npm error Could not resolve dependency: npm error peer eslint@">= 1.6.0 < 7.0.0" from @vue/cli-plugin-eslint@4.5.15 npm error node_modules/@vue/cli-plugin-eslint npm error dev @vue/cli-plugin-eslint@"4.5.15" from the root project npm error npm error Conflicting peer dependency: eslint@6.8.0 npm error node_modules/eslint npm error peer eslint@">= 1.6.0 < 7.0.0" from @vue/cli-plugin-eslint@4.5.15 npm error node_modules/@vue/cli-plugin-eslint npm error dev @vue/cli-plugin-eslint@"4.5.15" from the root project npm error npm error Fix the upstream dependency conflict, or retry npm error this command with --force or --legacy-peer-deps npm error to accept an incorrect (and potentially broken) dependency resolution. npm error npm error npm error For a full report see: npm error C:\Users\www87\AppData\Local\npm-cache\_logs\2025-03-26T08_12_06_109Z-eresolve-report.txt npm error A complete log of this run can be found in: C:\Users\www87\AppData\Local\npm-cache\_logs\2025-03-26T08_12_06_109Z-debug-0.log F:\008717hz\houtai>
03-27
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值