【问题标题】:Prevent git commit if Typescript error is detected如果检测到 Typescript 错误,则阻止 git commit
【发布时间】:2020-06-20 04:20:30
【问题描述】:

我在 Visual Code 中使用 Typscript 进行编程,我注意到我能够 git (azure) 提交并推送到服务器,即使我的代码中有错误导致构建失败。当然,我应该始终确保我的代码可以构建,但作为一项安全措施,如果代码中存在 Typescript 错误,是否可以自动阻止提交或推送?

【问题讨论】:

标签: git typescript azure-devops


【解决方案1】:

您应该在 package.json 中使用 linter 添加到 pre-commit / pre-push 钩子

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-12-09
    • 2014-12-02
    • 1970-01-01
    • 1970-01-01
    • 2021-07-04
    • 2016-12-04
    • 1970-01-01
    相关资源
    最近更新 更多