Error: No files matching the pattern "/xxx/xxx/..." were found.

created at 07-07-2021 views: 5

description

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)

Solution

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.

Please log in to leave a comment.