Skip to content

Commit

Permalink
chore(husky): update husky and commitlint
Browse files Browse the repository at this point in the history
To not have weird charactors in vim using fugitive i needed to find the
options to disable them.

- For lint-staged i had to set the following env vars
  * FORCE_COLOR=0
    + a flag from https://github.com/chalk/supports-color#readme
  * TERM=dumb
    + this has an effect since https://github.com/okonet/lint-staged/pull/782/files
    + this should be set my vim-fugitive but for some reason i have to set
      it up manually tpope/vim-fugitive#1446
- For commitlint the flag `--color=false` was sufficient
  • Loading branch information
Samuel Hobl committed Feb 18, 2021
1 parent 3d81333 commit 87494dd
Show file tree
Hide file tree
Showing 5 changed files with 399 additions and 477 deletions.
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 --color=false --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"

env FORCE_COLOR=0 TERM=dumb yarn lint-staged
18 changes: 8 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,12 @@
"scripts": {
"build": "yarn workspaces run build",
"clean": "yarn workspaces run clean",
"postinstall": "husky install",
"lint": "eslint .",
"prepublishOnly": "pinst --disable",
"postpublish": "pinst --enable",
"test": "yarn workspaces run test"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
Expand All @@ -33,8 +30,8 @@
"*.{ts,tsx,js,jsx}": "npm run lint"
},
"devDependencies": {
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@types/jest": "^25.2.3",
"@types/react-test-renderer": "^16.9.2",
"@typescript-eslint/eslint-plugin": "^3.4.0",
Expand All @@ -46,10 +43,11 @@
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^4.0.0",
"husky": "^4.2.5",
"husky": "^5.0.9",
"jest": "^26.0.1",
"lint-staged": "^10.1.3",
"lint-staged": "^10.5.4",
"nodemon": "^2.0.3",
"pinst": "^2.1.4",
"prettier": "^2.0.5",
"prettier-plugin-packagejson": "^2.2.3",
"react": "^16.13.1",
Expand Down
Loading

0 comments on commit 87494dd

Please sign in to comment.