Skip to content

Commit

Permalink
chore: setup commitizen (#80)
Browse files Browse the repository at this point in the history
* chore: setup commitizen

* chore: revert commit-msg

* chore: setup for windows
  • Loading branch information
agustinusnathaniel authored Apr 22, 2022
1 parent 8f9c50a commit 0b1c61b
Show file tree
Hide file tree
Showing 6 changed files with 406 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .czrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"path": "@commitlint/cz-commitlint"
}
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit $1
yarn commitlint --edit "$1"
5 changes: 5 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
[[ "$(uname -a)" = *"MINGW64"* ]] && exit 0
. "$(dirname "$0")/_/husky.sh"

exec < /dev/tty && yarn cz --hook || true
12 changes: 9 additions & 3 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
/** @type {import('@commitlint/types').UserConfig} */
const CommitLintConfiguration = {
extends: ["@commitlint/config-conventional"],
// add your own scope here if needed
// "scope-enum": [2, "always", ["components", "pages", "utils"]],
"scope-case": [2, "always", "kebab-case"],
rules: {
// add your own scope here if needed
"scope-enum": [
2,
"always",
["components", "layout", "pages", "styles", "utils", "types"],
],
"scope-case": [2, "always", "kebab-case"],
},
};

module.exports = CommitLintConfiguration;
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
},
"devDependencies": {
"@commitlint/config-conventional": "^16.2.1",
"@commitlint/cz-commitlint": "^16.2.3",
"@types/react": "^18.0.6",
"commitizen": "^4.2.4",
"commitlint": "^16.2.3",
"eslint": "^8.13.0",
"eslint-config-next": "^12.1.5",
Expand Down
Loading

1 comment on commit 0b1c61b

@vercel
Copy link

@vercel vercel bot commented on 0b1c61b Apr 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.