Last active
April 13, 2023 16:03
-
-
Save lafarer/741a0e99335f8a76424a71920b1ce047 to your computer and use it in GitHub Desktop.
Conventional commits - Linting commit message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# https://conventionalcommits.org | |
# https://www.freecodecamp.org/news/how-to-use-commitlint-to-write-good-commit-messages/ | |
# Initialize git repository | |
git init | |
# Initialize node project | |
yarn init -y | |
# Initialize commitlint | |
yarn add @commitlint/cli @commitlint/config-conventional --dev | |
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js | |
# Initialize husky | |
npx husky-init -y | |
rm .husky/pre-commit | |
# Add pre-commit hook | |
npx husky add .husky/commit-msg "npx --no -- commitlint --edit $1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment