No files matching the pattern '/xxx/xxx/...' were found.

使用.stylelintignore添加忽略文件校验,在lint-staged执行校验规范时,报错

✖ stylelint --fix:
Error: No files matching the pattern "/Users/lyc/Desktop/tal/monkey-wukong-wap/src/pages/reportActivity/assets/iconfont/iconfont.css" were found.
    at /Users/lyc/Desktop/tal/monkey-wukong-wap/node_modules/stylelint/lib/standalone.js:212:12
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

解决方案:lint-staged stylelint添加--allow-empty-input

"lint-staged": {
  "*.{js,vue}": [
    "vue-cli-service lint"
  ],
  "*.{less,vue}": [
    "stylelint --allow-empty-input"
  ]
}

最终在 https://github.com/stylelint/stylelint/issues/4712 找到解决方案,

但是仍不是特别清楚具体原因以及什么时候添加这个--allow-empty-input属性。

打赏一个呗

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦