Closed WalkingLianShou closed 4 months ago
文件位置:packages/utils/src/base.ts 方法名:getUrlPath 26行:
packages/utils/src/base.ts
getUrlPath
const path = `${(url || '').replace(/^http(s|):/, '').split('?')[0]}`;
在进行Eslint校验的时候,提示 This empty alternative might be a mistake. If not, use a quantifier instead regexp/no-empty-alternative 经查看代码,是因为http(s|)后面是空的,所以报错了
This empty alternative might be a mistake. If not, use a quantifier instead regexp/no-empty-alternative
是不是应该修改成
const path = `${(url || '').replace(/^https?:/, '').split('?')[0]}`;
原先的正则是有点问题,已修复,重新拉一下项目
文件位置:
packages/utils/src/base.ts
方法名:getUrlPath
26行:在进行Eslint校验的时候,提示
This empty alternative might be a mistake. If not, use a quantifier instead regexp/no-empty-alternative
经查看代码,是因为http(s|)后面是空的,所以报错了是不是应该修改成
const path = `${(url || '').replace(/^https?:/, '').split('?')[0]}`;