一切都很好,直到我使用lint-staged添加了husky。
我发现了与README.md相关的错误
packages\README.md
1:1 error Parsing error: Unexpected character '#'
> 1 | # @folo/forms
| ^在package.json中
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,jsx,md}": [
"eslint --fix",
"prettier --write",
"git add"
]
}我错过了什么?为什么只有当我运行eslint Atom 而不在Atom编辑器中抛出错误时才会发生这种情况呢?
发布于 2018-12-24 15:19:55
以下是我对此的谦逊解决方案:
"lint-staged": {
"*.{js,jsx}": [
"eslint --fix",
"prettier --write",
"git add"
],
"*.{md}": [
"prettier --write",
"git add"
]
}我不需要粘贴我的.md文件。只需运行prettier。
https://stackoverflow.com/questions/53914602
复制相似问题