美文网首页
commit 提交规范

commit 提交规范

作者: 三七_小九 | 来源:发表于2019-10-24 15:42 被阅读0次

    1.依赖的包(使用yarn commit):


    npm i @commitlint/cli @commitlint/config-conventional commitizen cz-conventional-changelog husky -D

    2.json配置:


         "scripts": {

                "commit": "git add -A && git-cz"
         },

           "config": {

                "commitizen": { "path": "./node_modules/cz-conventional-changelog" } },

                "husky": { "hooks": { "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" }

        }

    }

    3. .commitlintrc.js配置文件


    module.exports = {    

                            extends: ['@commitlint/config-conventional'],  

                            rules: {       

                                     'typeenum': [2, 'always', ['feat', 'fix', 'docs', 'style', 'refactor', 'perf', 'test', 'build', 'ci', 'chore', 'revert', 'other']],    },

                                }

    相关文章

      网友评论

          本文标题:commit 提交规范

          本文链接:https://www.haomeiwen.com/subject/pbqdvctx.html