Skip to content

Commit

Permalink
chore: husky세팅
Browse files Browse the repository at this point in the history
  • Loading branch information
HoberMin committed Apr 18, 2024
1 parent bc5fa12 commit 09291c1
Show file tree
Hide file tree
Showing 7 changed files with 632 additions and 1 deletion.
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm commitlint --edit ${1}
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm lint-staged
8 changes: 8 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const path = require('path');

const buildEslintCommand = filenames =>
`next lint --fix --file ${filenames.map(f => path.relative(process.cwd(), f)).join(' --file ')}`;

module.exports = {
'*.{js,jsx,ts,tsx}': [buildEslintCommand],
};
7 changes: 7 additions & 0 deletions .vscode/setting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"css.lint.unknownAtRules": "ignore",
"tailwindCSS.experimental.classRegex": [
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
]
}
17 changes: 17 additions & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
extends: ['@commitlint/config-conventional'],

rules: {
'header-max-length': [0],
'subject-case': [0],
'subject-full-stop': [0],
'subject-empty': [2, 'never'],
'type-case': [2, 'never'],
'type-empty': [2, 'never'],
'type-enum': [
2,
'always',
['feat', 'fix', 'docs', 'refactor', 'chore', 'style'],
],
},
};
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"lint": "next lint",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"chromatic": "npx chromatic --project-token=chpt_5fc52fe9d01c621"
"chromatic": "npx chromatic --project-token=chpt_5fc52fe9d01c621",
"prepare": "husky"
},
"dependencies": {
"clsx": "^2.1.0",
Expand All @@ -20,6 +21,8 @@
},
"devDependencies": {
"@chromatic-com/storybook": "^1.3.3",
"@commitlint/cli": "^19.2.2",
"@commitlint/config-conventional": "^19.2.2",
"@storybook/addon-essentials": "^8.0.8",
"@storybook/addon-interactions": "^8.0.8",
"@storybook/addon-links": "^8.0.8",
Expand All @@ -45,6 +48,8 @@
"eslint-plugin-react-refresh": "^0.4.5",
"eslint-plugin-storybook": "^0.8.0",
"eslint-plugin-unused-imports": "^3.1.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"postcss": "^8",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.14",
Expand Down
Loading

0 comments on commit 09291c1

Please sign in to comment.