npm run lint 报错 No files matching the pattern “‘./src/**/*.{ts,js,vue}‘“ were found.
npm run lint 报错 No files matching the pattern "'./src/**/*.{ts,js,vue}'" were found.
·
场景
在vue3项目配置hysky进行格式校验,在commit前会先运行npm run lint,但是npm run lint会报错
> eslint --fix './src/**/*.{ts,js,vue}'
Oops! Something went wrong! :(
ESLint: 8.18.0
No files matching the pattern "'./src/**/*.{ts,js,vue}'" were found.
Please check for typing mistakes in the pattern.
解决方案
将scripts中的"lint": "eslint --fix './src/**/*.{ts,js,vue}'"改为 "lint": "eslint --fix \"./src/**/*.{ts,js,vue}\""
即有些因为操作系统的缘故,需要将将单引号改成双引号,双引号需要加转义字符
参考文章
https://segmentfault.com/a/1190000038932542?utm_source=tag-newest
更多推荐
已为社区贡献1条内容
所有评论(0)