Skip to content

Commit

Permalink
chore: add commit lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pnodet committed Aug 30, 2024
1 parent 1d35859 commit 1ea15a4
Show file tree
Hide file tree
Showing 4 changed files with 553 additions and 39 deletions.
6 changes: 6 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const commitLintConfig = {
extends: ['@commitlint/config-conventional'],
'type-enum': ['feat', 'fix', 'style', 'refactor', 'test', 'revert', 'build'],
};

export default commitLintConfig;
44 changes: 5 additions & 39 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,8 @@
pre-push:
parallel: false
piped: false
follow: false
commit-msg:
commands:
commitlint:
run: pnpm commitlint --edit
pre-commit:
commands:
lint:
run: pnpm lint-staged
# EXAMPLE USAGE:
#
# Refer for explanation to following link:
# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md
#
# pre-push:
# commands:
# packages-audit:
# tags: frontend security
# run: yarn audit
# gems-audit:
# tags: backend security
# run: bundle audit
#
# pre-commit:
# parallel: true
# commands:
# eslint:
# glob: "*.{js,ts,jsx,tsx}"
# run: yarn eslint {staged_files}
# rubocop:
# tags: backend style
# glob: "*.rb"
# exclude: '(^|/)(application|routes)\.rb$'
# run: bundle exec rubocop --force-exclusion {all_files}
# govet:
# tags: backend style
# files: git ls-files -m
# glob: "*.go"
# run: go vet {files}
# scripts:
# "hello.js":
# runner: node
# "any.go":
# runner: go run
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
"typescript-eslint": "8.2.0"
},
"devDependencies": {
"@commitlint/cli": "19.4.1",
"@commitlint/config-conventional": "19.4.1",
"@eslint/js": "^9.9.1",
"@nivalis/prettier-config": "^3.3.3",
"@swc/core": "^1.7.18",
Expand Down
Loading

0 comments on commit 1ea15a4

Please sign in to comment.