应用.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
属性。