Giter VIP home page Giter VIP logo

commit-convention's Introduction

Commit convetion ๐ŸŽก

Checks if your commit messages meet the conventional commit format. It Helps either you or your team become more productive.

How to use ๐Ÿค”

Installing Dev Dependencies

Using yarn

yarn add -D husky cz-conventional-changelog @commitlint/config-conventional @commitlint/cli

Using npm

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

Create a commitlint config file on you root folder structure

touch commitlint.config.js

Insert the following code below into the file

module.exports = {
    extends: ['@commitlint/config-conventional']
}

Configuring your package.json

Add husky config in order to trigger for commit messages

  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
      "prepare-commit-msg": "exec < /dev/tty && git cz --hook || true"
    }
  },

Add your commitizen path

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

Add a script for an easy cli command

  "scripts": {
    "commit": "git-cz",
  },

Your package.json should be like this ๐Ÿ‘‡

{
  "name": "commit-convention",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
      "prepare-commit-msg": "exec < /dev/tty && git cz --hook || true"
    }
  },
  "scripts": {
    "commit": "git-cz",
  },
  "devDependencies": {
    "@commitlint/cli": "^11.0.0",
    "@commitlint/config-conventional": "^11.0.0",
    "@types/express": "^4.17.9",
    "cz-conventional-changelog": "^3.3.0",
    "husky": "^4.3.6",
    "ts-node-dev": "^1.0.0",
    "typescript": "^4.1.2"
  },
  "config": {
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog"
    }
  }
}

Happy Hacking ๐Ÿ’ป

commitlint gif

commit-convention's People

Contributors

dependabot[bot] avatar marcelogaldino avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.