Skip to content

Commit

Permalink
chore: deps husky and commitlint
Browse files Browse the repository at this point in the history
  • Loading branch information
balaji-sivasakthi committed Jul 19, 2023
1 parent 60a18ee commit 3a1518f
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": ["@commitlint/config-conventional"],
"rules": {
"type-enum": [
2,
"always",
[
"ci",
"chore",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"assets"
]
]
}
}
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install commitlint --edit
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged --allow-empty
3 changes: 3 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"**/*.{js,json}": ["prettier --write"]
}
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"type": "module",
"main": "src/index.js",
"scripts": {
"start": "nodemon -r dotenv/config src/index.js"
"start": "nodemon -r dotenv/config src/index.js",
"pre-commit": "lint-staged",
"prepare": "husky install"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -51,6 +53,10 @@
"yaml": "^2.3.1"
},
"devDependencies": {
"@commitlint/cli": "^17.6.6",
"@commitlint/config-conventional": "^17.6.5",
"husky": "^8.0.0",
"lint-staged": "^13.2.2",
"nodemon": "^2.0.22",
"prettier": "^3.0.0"
}
Expand Down

0 comments on commit 3a1518f

Please sign in to comment.