Use .stylelintignore
to add ignore file verification. When lint-staged executes the verification specification, an error is reported.
✖ 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)
add --allow-empty-input
to lint-staged
stylelint:
"lint-staged": {
"*.{js,vue}": [
"vue-cli-service lint"
],
"*.{less,vue}": [
"stylelint --allow-empty-input"
]
}
Finally found a solution at here, but it is still not particularly clear about the specific reason and when to add this --allow-empty-input attribute.