
package.json 相关配置如下
{
"scripts": {
"lint": "eslint pages/* component/* --fix"
}
}
问题描述: 当我执行 git commit 操作时, 报错如下
Oops! Something went wrong! :(
ESLint: 5.0.1.
No files matching the pattern "component/*" were found.
Please check for typing mistakes in the pattern.
pre-commit:
pre-commit: We've failed to pass the specified git pre-commit hooks as the `lint`
pre-commit: hook returned an exit code (2). If you're feeling adventurous you can
pre-commit: skip the git pre-commit hooks by adding the following flags to your commit:
pre-commit:
pre-commit: git commit -n (or --no-verify)
pre-commit:
pre-commit: This is ill-advised since the commit is broken.
pre-commit:
问题原因: 没有component目录