解决You may use special comments to disable some warnings.

解决You may use special comments to disable some warnings.

有时候我们在运行vue项目的时候,会弹出以下警告信息:

You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.

You may use special comments to disable some warnings.的翻译是:你可以使用一些特殊的注释来禁用一些警告

警告信息是提示你可以使用:
// eslint-disable-next-line来标记下一行内容不被eslint检测
/* eslint-disable */ 来标记整个文件不被eslint检测

使用方法如下:

// 下一行eslint规则失效
// eslint-disable-next-line
console.log(add(1, 10));

解决方法:
出现这个提示的原因是因为我们使用了eslint语法检测工具(初学者不推荐使用,很容易让人崩溃的),如果我们不想出现上述提示,有两种解决方法:

  1. 根据eslint的提示,将代码修改成符合格式的样子,使用webstorm或者vscode下载eslint插件,都会有提示功能,根据提示进行修改即可。
  2. 新手推荐: 关闭eslint语法检测,在.eslintrc.js文件中,注释掉 eslint:recommended。如图:
    在这里插入图片描述
  • 8
    点赞
  • 26
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值