Skip to content

Commit

Permalink
Add precommit hook (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
idastambuk authored Aug 2, 2024
1 parent 3849be1 commit 22abc78
Show file tree
Hide file tree
Showing 5 changed files with 842 additions and 815 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ci/
dist/
.idea/
.DS_Store
.eslintcache
# until we can figure out how to install the mockery executable on circleci, leave this commented out
#**/mocks/*.*
__debug_bin
Expand Down
6 changes: 5 additions & 1 deletion cspell.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@
"combobox",
"Cacheable",
"Stalebot",
"ssjagad"
"gofmt",
"eslintcache",
"lefthook",
"ssjagad",
"jackspeak"
]
}
17 changes: 17 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
pre-commit:
parallel: true
commands:
frontend-lint:
glob: '*.{js,ts,tsx}'
run: |
eslint --cache --ignore-path ./.gitignore --fix {staged_files}
yarn prettier --write {staged_files}
stage_fixed: true
backend-format:
glob: '*pkg/**/*.go'
run: gofmt -w -s {staged_files}
stage_fixed: true
spellcheck:
run: yarn cspell -c cspell.config.json \"**/*.{ts,tsx,js,go,md,mdx,yml,yaml,json,scss,css}\" {staged_files}


4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"identity-obj-proxy": "3.0.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"lefthook": "^1.6.18",
"lodash": "^4.17.21",
"prettier": "^3.3.2",
"replace-in-file-webpack-plugin": "^1.0.6",
Expand All @@ -78,7 +79,8 @@
"webpack-livereload-plugin": "^3.0.2"
},
"resolutions": {
"cosmiconfig": "8.3.6"
"cosmiconfig": "8.3.6",
"jackspeak": "2.1.1"
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit 22abc78

Please sign in to comment.