From 7ae86321c6be978df7d488de43f06f1752c27fce Mon Sep 17 00:00:00 2001 From: marcelovicentegc Date: Thu, 30 Nov 2023 15:08:27 -0300 Subject: [PATCH 1/2] chore: add commitlint on commit-msg hook --- .husky/commit-msg | 4 ++++ package.json | 17 +++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100755 .husky/commit-msg diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 0000000000..482222a2b0 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npm run commitlint ${1} diff --git a/package.json b/package.json index a157d2ea87..2b52d26509 100644 --- a/package.json +++ b/package.json @@ -38,10 +38,10 @@ "create-component": "plop component", "create-icon": "plop icon", "create-icon-variant": "plop icon-variant", - "prepare": "husky install" + "prepare": "husky install", + "commitlint": "commitlint --edit" }, "devDependencies": { - "@vtex/shoreline-test-utils": "workspace:*", "@commitlint/cli": "^9.1.2", "@commitlint/config-conventional": "^9.1.2", "@commitlint/prompt": "^9.1.2", @@ -62,6 +62,8 @@ "@vanilla-extract/vite-plugin": "3.9.0", "@vitejs/plugin-react": "4.1.0", "@vtex/prettier-config": "^0.3.1", + "@vtex/shoreline-stylelint": "workspace", + "@vtex/shoreline-test-utils": "workspace:*", "@vtex/tsconfig": "^0.5.6", "chromatic": "^9.1.0", "commitizen": "^4.2.0", @@ -70,8 +72,8 @@ "eslint-config-vtex-react": "9.0.3", "eslint-plugin-graphql": "4.0.0", "eslint-plugin-import": "2.27.5", - "eslint-plugin-vitest": "0.3.10", "eslint-plugin-tsc": "2.0.0", + "eslint-plugin-vitest": "0.3.10", "husky": "^8.0.3", "jsdom": "23.0.0", "lerna": "7.1.4", @@ -84,16 +86,15 @@ "react-dom": "18.2.0", "react-test-renderer": "18.2.0", "storybook": "^7.5.3", + "stylelint": "^15.11.0", + "stylelint-prettier": "^4.0.2", "tslib": "2.6.2", + "tsup": "8.0.1", "turbo": "1.4.3", "typescript": "4.9.5", "url-loader": "^4.1.0", "vite": "5.0.2", - "vitest": "0.34.6", - "tsup": "8.0.1", - "stylelint": "^15.11.0", - "stylelint-prettier": "^4.0.2", - "@vtex/shoreline-stylelint": "workspace" + "vitest": "0.34.6" }, "lint-staged": { "*.{ts,tsx,js,jsx}": [ From 63800d0ca780689e4b761e32befb96f1630d9d65 Mon Sep 17 00:00:00 2001 From: marcelovicentegc Date: Thu, 30 Nov 2023 15:13:28 -0300 Subject: [PATCH 2/2] chore: use pnpm instead of npm on commit-msg hook --- .husky/commit-msg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/commit-msg b/.husky/commit-msg index 482222a2b0..9ef2ef0b22 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -npm run commitlint ${1} +pnpm run commitlint ${1}