0

我必须运行一个命令,该命令在使用 husky 钩子进行预提交期间验证架构。

Husky 包含在根目录的 package.json 中,如下所示:

"workspaces": {
        "packages": [
            "apps",
            "vendors/*"
        ],
        "nohoist": [
            "**/husky",
            "**/husky/**"
        ]
}

在子目录中,它被定义为:

"devDependencies": {
    "husky": "^1.3.1"
},
"husky": {
    "hooks": {
        "commit-msg": "yarn commitlint -E HUSKY_GIT_PARAMS",
        "pre-commit": "yarn lint",
        "post-merge": "git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD | grep --quiet config.json && cd .. && yarn compose"
    }
},

如何在根目录中定义一个挂钩,就像在子目录中定义的那样?

谢谢。

4

0 回答 0