解决vue3引入字体图标iconfont.js时eslint报错的问题
解决vue3引入字体图标iconfont.js时eslint报错的问题
·
vue3
的项目之前一直使用的是iconfont
字体图标库,未出现eslint
报错的问题。
最新更新了一下图标,将新的图标代码放到项目里突然发现eslint
的报错提醒,具体如下:
1:70214 error 'c' is assigned to itself no-self-assign
✖ 1 problem (1 error, 0 warnings)
其实这个报错很简单,主要看关键提醒就行no-self-assign
,查一下eslint
的文档就知道
Disallow assignments where both sides are exactly the same
根据官方给出的配置是
This rule has the option to check properties as well.
{
"no-self-assign": ["error", {"props": true}]
}
props - if this is true, no-self-assign rule warns self-assignments of properties. Default is true.
但是这样的配置,在项目中貌似没有生效;
后来索性直接在.eslintrc.js
文件中配置off
,重启npm
项目,则无错误提醒;
"no-self-assign": "off"
更多推荐
已为社区贡献7条内容
所有评论(0)