关于css:Error-No-files-matching-the-pattern-xxxxxx-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/… 找到解决方案,然而仍不是特地分明具体起因以及什么时候增加这个--allow-empty-input属性。

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理