Skip to content

Commit

Permalink
[Feature/BAR-40] husky, lint-staged, commitlint 설정 (#18)
Browse files Browse the repository at this point in the history
* chore(.gitignore): .tsbuildinfo 추가

* chore: node 버전 추가

* chore: husky, commitlint 설정

* fix: eol 추가
  • Loading branch information
dmswl98 authored Dec 27, 2023
1 parent a11d969 commit 832db45
Show file tree
Hide file tree
Showing 8 changed files with 778 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules
.next
*.log
.tsbuildinfo
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"

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

branch="$(git rev-parse --abbrev-ref HEAD)"

if [ "$branch" = "main" ]; then
echo "You can't commit directly to main branch"
exit 1
fi

pnpm lint-staged --no-stash
4 changes: 4 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.{js,jsx,ts,tsx}": ["prettier --write", "eslint --fix"],
"*.{ts,tsx}": "tsc --noEmit"
}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.9.0
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
};
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"prepare": "husky install",
"postinstall": "husky install",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
Expand All @@ -26,6 +28,8 @@
"zustand": "^4.4.7"
},
"devDependencies": {
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@storybook/addon-essentials": "^7.6.4",
"@storybook/addon-interactions": "^7.6.4",
"@storybook/addon-links": "^7.6.4",
Expand Down Expand Up @@ -53,6 +57,8 @@
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-storybook": "^0.6.15",
"eslint-plugin-unused-imports": "^3.0.0",
"husky": "^8.0.0",
"lint-staged": "^15.2.0",
"mini-css-extract-plugin": "^2.7.6",
"prettier": "^3.1.0",
"storybook": "^7.6.4",
Expand Down
Loading

0 comments on commit 832db45

Please sign in to comment.