Skip to content

Commit 5a30466

Browse files
committed
chore: added husky for git hooks, commitlint and prettier
1 parent ffd668e commit 5a30466

File tree

8 files changed

+1509
-223
lines changed

8 files changed

+1509
-223
lines changed

.commitlintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ["@commitlint/config-conventional"],
3+
};

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn commitlint --edit "$1"

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn --silent lint-staged -r

.lintstagedrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"*.{js,jsx,ts,tsx,json,css,md,html}": "prettier --write"
3+
}

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.git
2+
node_modules

.prettierrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"printWidth": 160,
3+
"arrowParens": "always"
4+
}

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,20 @@
204204
}
205205
},
206206
"scripts": {
207+
"postinstall": "husky install",
207208
"vscode:prepublish": "npm run compile",
208209
"compile": "tsc -p ./",
209210
"watch": "tsc -watch -p ./"
210211
},
211212
"devDependencies": {
213+
"@commitlint/cli": "^16.1.0",
214+
"@commitlint/config-conventional": "^16.0.0",
212215
"@types/node": "^16.11.7",
213-
"typescript": "^4.4.4",
214-
"@types/vscode": "^1.1.59"
216+
"@types/vscode": "^1.1.59",
217+
"husky": "^7.0.4",
218+
"lint-staged": "^12.3.3",
219+
"prettier": "^2.5.1",
220+
"typescript": "^4.4.4"
215221
},
216222
"dependencies": {
217223
"array-flat-polyfill": "^1.0.1"

yarn.lock

Lines changed: 1481 additions & 221 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)