diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 000000000..5cf6aa7f8 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" +cd js +yarn run lint-staged diff --git a/js/package.json b/js/package.json index 8be62536e..9ff77f8fc 100644 --- a/js/package.json +++ b/js/package.json @@ -14,7 +14,14 @@ "story:build": "histoire build", "story:preview": "histoire preview", "test": "vitest", - "coverage": "vitest run --coverage" + "coverage": "vitest run --coverage", + "prepare": "cd ../ && husky install" + }, + "lint-staged": { + "**/*.{js,ts,vue}": [ + "eslint --fix", + "prettier --write" + ] }, "dependencies": { "@absinthe/socket": "^0.2.1", @@ -116,7 +123,9 @@ "eslint-plugin-vue": "^9.3.0", "flush-promises": "^1.0.2", "histoire": "^0.16.1", + "husky": "^8.0.3", "jsdom": "^22.0.0", + "lint-staged": "^13.2.2", "mock-apollo-client": "^1.1.0", "prettier": "^2.2.1", "prettier-eslint": "^15.0.1", @@ -124,7 +133,7 @@ "sass": "^1.34.1", "typescript": "~5.0.0", "vite": "^4.0.4", - "vite-plugin-pwa": "^0.14.1", + "vite-plugin-pwa": "^0.15.1", "vitest": "^0.31.0", "vue-i18n-extract": "^2.0.4" } diff --git a/js/src/assets/oruga-tailwindcss.css b/js/src/assets/oruga-tailwindcss.css index 06e5fd8c2..4bb4a1d4e 100644 --- a/js/src/assets/oruga-tailwindcss.css +++ b/js/src/assets/oruga-tailwindcss.css @@ -42,13 +42,13 @@ body { @apply bg-transparent text-black dark:text-white font-semibold py-2 px-4 border border-mbz-bluegreen dark:border-violet-3; } .btn-outlined-success { - @apply border-mbz-success; + @apply border-mbz-success hover:bg-mbz-success; } .btn-outlined-warning { @apply bg-transparent border dark:text-white hover:dark:text-slate-900 hover:bg-mbz-warning border-mbz-warning; } .btn-outlined-danger { - @apply border-mbz-danger; + @apply border-mbz-danger hover:bg-mbz-danger; } .btn-outlined-text { @apply bg-transparent hover:text-slate-900; diff --git a/js/src/components/Discussion/DiscussionListItem.vue b/js/src/components/Discussion/DiscussionListItem.vue index ecc982a2b..08808bcae 100644 --- a/js/src/components/Discussion/DiscussionListItem.vue +++ b/js/src/components/Discussion/DiscussionListItem.vue @@ -1,10 +1,10 @@