Lint-staged无法找到与glob相匹配的文件 [英] Lint-staged can't find staged files matching glob
本文介绍了Lint-staged无法找到与glob相匹配的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用NodeJS Typescript,我想设置 lint-staged
来在提交之前验证我的文件,但是它不起作用。我从指南中添加了以下内容:
I'm working with NodeJS Typescript and I wanted to set lint-staged
to validate my files before commit but it is not working. I added from a guide as following:
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js, jsx, ts, tsx, md, html}": [
"eslint --fix",
"prettier --write",
"git add"
]
}
我遇到的错误:
No staged files match any of provided globs.
package.json $ c $的正确配置是什么c>?
推荐答案
逗号后的空格可能会破坏这些问题-尝试删除它们:
Spaces after commas can break the globs - try removing them:
"*.{js,jsx,ts,tsx,md,html}"
这篇关于Lint-staged无法找到与glob相匹配的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文