Skip to content

Commit

Permalink
feat(docs): added husky and commitlint
Browse files Browse the repository at this point in the history
  • Loading branch information
demmorou committed Sep 30, 2021
1 parent 6f17f73 commit 7d407a2
Show file tree
Hide file tree
Showing 9 changed files with 1,367 additions and 27 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

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

yarn lint-staged
4 changes: 4 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

exec < /dev/tty && yarn cz --hook || true
4 changes: 4 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

{
"*.ts": ["yarn eslint --ext ts --fix", "yarn prettier --write"]
}
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
"main": "index.js",
"license": "MIT",
"scripts": {
"prepare": "husky install",
"build": "rimraf build; babel src --extensions \".js,.ts\" --out-dir build --copy-files --no-copy-ignored",
"dev": "tsnd -r tsconfig-paths/register --transpile-only --ignore-watch node_modules --respawn src/app.ts",
"dev:queue": "tsnd -r tsconfig-paths/register --transpile-only --ignore-watch node_modules --respawn src/infra/poller/QueuePoller.ts",
"lint": "eslint src --ext .ts --fix"
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"dependencies": {
"awilix": "^5.0.1",
"bullmq": "^1.48.2",
Expand All @@ -28,6 +34,8 @@
"@babel/plugin-proposal-decorators": "^7.14.2",
"@babel/preset-env": "^7.14.2",
"@babel/preset-typescript": "^7.13.0",
"@commitlint/cli": "^12.1.1",
"@commitlint/config-conventional": "^12.1.1",
"@types/debug": "^4.1.7",
"@types/handlebars": "^4.1.0",
"@types/node": "^16.7.11",
Expand All @@ -39,13 +47,16 @@
"@typescript-eslint/parser": "^4.22.1",
"babel-plugin-module-resolver": "^4.1.0",
"babel-plugin-transform-typescript-metadata": "^0.3.2",
"commitizen": "^4.2.4",
"eslint": "^7.26.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^8.3.0",
"eslint-import-resolver-typescript": "^2.4.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-import-helpers": "^1.1.0",
"eslint-plugin-prettier": "^3.4.0",
"husky": "6.0.0",
"lint-staged": "^11.1.2",
"prettier": "^2.2.1",
"ts-node": "^10.2.1",
"ts-node-dev": "^1.1.8",
Expand Down
Loading

0 comments on commit 7d407a2

Please sign in to comment.