git提交报错:All input files were ignored because of the ignore pattern. Either change your input...

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

image.png

原因

报错中指出,输入的文件被忽略了,请更改输入或者使用忽略模式

解决方案

package.js文件中配置的"lint-staged"选项下,使用忽略模式 --allow-empty-input

git提交报错:All input files were ignored because of the ignore pattern. Either change your input..._第1张图片

  "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"
    ]
  },

然后再次执行提交命令即可

你可能感兴趣的:(日常问题,前端开发,git)