git提交过程中报错:
Error: All input files were ignored because of the ignore pattern. Either change your input, ignore pattern or use “–allow-empty-input” to allow no inputs
原因
报错中指出,输入的文件被忽略了,请更改输入或者使用忽略模式
解决方案
在package.js
文件中配置的"lint-staged"选项下,使用忽略模式 --allow-empty-input
"lint-staged": {
"*.{js,ts}": [
"eslint --fix",
"prettier --write"
],
"*.{cjs,json}": [
"prettier --write"
],
"*.{vue,html}": [
"eslint --fix",
"prettier --write",
"stylelint --fix"
],
"*.{scss,less,css}": [
"stylelint --fix --allow-empty-input",
"prettier --write"
],
"*.md": [
"prettier --write"
]
},
然后再次执行提交命令即可