diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f824432e29..7a1fdee31d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,8 +48,8 @@ Thank you for your PR! Before creating a PR, please check the following: - If there is an Issue which will be resolved by this PR, please include a reference to the Issue in the text. Good examples include `Closing: #21` or `Resolves: #21` - Check if there are any documents that need to be created or updated due to this change. - If you have added a feature or fixed a bug, please add a test case if possible. -- Please make sure that tests and Lint are passed in advance. - - You can run it with `pnpm run test` and `pnpm run lint`. [See more info](#testing) +- Please make sure that formatting, tests and Lint are passed in advance. + - You can run it with `pnpm run format`, `pnpm run test` and `pnpm run lint`. [See more info](#testing) - If this PR includes UI changes, please attach a screenshot in the text. Thanks for your cooperation 🤗 diff --git a/package.json b/package.json index e990a5851e..3a324fa0b5 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "e2e": "start-server-and-test start:test http://localhost:61812 cy:run", "mocha": "pnpm --filter backend run mocha", "test": "pnpm run mocha", - "format": "gulp format", + "format": "pnpm rome format packages/**/* --write && pnpm --filter client run format", "clean": "pnpm node ./scripts/clean.js", "clean-all": "pnpm node ./scripts/clean-all.js", "cleanall": "pnpm run clean-all" diff --git a/packages/client/.prettierrc b/packages/client/.prettierrc new file mode 100644 index 0000000000..77a5016a4d --- /dev/null +++ b/packages/client/.prettierrc @@ -0,0 +1,15 @@ +{ + "tabWidth": 4, + "useTabs": true, + "singleQuote": false, + "vueIndentScriptAndStyle": false, + "plugins": ["vue"], + "overrides": [ + { + "files": "*.vue", + "options": { + "parser": "vue" + } + } + ] +} diff --git a/packages/client/package.json b/packages/client/package.json index b1da8e0a01..24af5b1431 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -4,7 +4,8 @@ "scripts": { "watch": "pnpm vite build --watch --mode development", "build": "pnpm vite build", - "lint": "pnpm rome check \"src/**/*.{ts,vue}\"" + "lint": "pnpm rome check \"src/**/*.{ts,vue}\"", + "format": "pnpm prettier --write '**/*.vue'" }, "devDependencies": { "@discordapp/twemoji": "14.0.2", @@ -54,6 +55,8 @@ "matter-js": "0.18.0", "mfm-js": "0.23.2", "photoswipe": "5.3.4", + "prettier": "2.8.7", + "prettier-plugin-vue": "1.1.6", "prismjs": "1.29.0", "punycode": "2.1.1", "querystring": "0.2.1", diff --git a/packages/client/src/components/MkAbuseReport.vue b/packages/client/src/components/MkAbuseReport.vue index 9a3464b640..ccb85d7222 100644 --- a/packages/client/src/components/MkAbuseReport.vue +++ b/packages/client/src/components/MkAbuseReport.vue @@ -1,64 +1,93 @@ @@ -81,7 +110,16 @@ function resolve() { padding: 14px; border-radius: 8px; --c: rgb(255 196 0 / 15%); - background-image: linear-gradient(45deg, var(--c) 16.67%, transparent 16.67%, transparent 50%, var(--c) 50%, var(--c) 66.67%, transparent 66.67%, transparent 100%); + background-image: linear-gradient( + 45deg, + var(--c) 16.67%, + transparent 16.67%, + transparent 50%, + var(--c) 50%, + var(--c) 66.67%, + transparent 66.67%, + transparent 100% + ); background-size: 16px 16px; > .avatar { diff --git a/packages/client/src/components/MkAbuseReportWindow.vue b/packages/client/src/components/MkAbuseReportWindow.vue index f1b3ae4312..19b8ba5264 100644 --- a/packages/client/src/components/MkAbuseReportWindow.vue +++ b/packages/client/src/components/MkAbuseReportWindow.vue @@ -1,35 +1,52 @@ diff --git a/packages/client/src/components/MkAnalogClock.vue b/packages/client/src/components/MkAnalogClock.vue index 40ef626aed..43d81f2a96 100644 --- a/packages/client/src/components/MkAnalogClock.vue +++ b/packages/client/src/components/MkAnalogClock.vue @@ -1,32 +1,62 @@ @@ -214,11 +269,11 @@ onBeforeUnmount(() => { transform-origin: 50% 50%; &.animate.elastic { - transition: transform .2s cubic-bezier(.4,2.08,.55,.44); + transition: transform 0.2s cubic-bezier(0.4, 2.08, 0.55, 0.44); } &.animate.easeOut { - transition: transform .7s cubic-bezier(0,.7,.3,1); + transition: transform 0.7s cubic-bezier(0, 0.7, 0.3, 1); } } } diff --git a/packages/client/src/components/MkAutocomplete.vue b/packages/client/src/components/MkAutocomplete.vue index ae708026e0..0455bd9d54 100644 --- a/packages/client/src/components/MkAutocomplete.vue +++ b/packages/client/src/components/MkAutocomplete.vue @@ -1,49 +1,107 @@ @@ -399,7 +484,8 @@ onBeforeUnmount(() => { font-size: 0.9em; cursor: default; - &, * { + &, + * { user-select: none; } @@ -412,10 +498,11 @@ onBeforeUnmount(() => { background: var(--X3); } - &[data-selected='true'] { + &[data-selected="true"] { background: var(--accent); - &, * { + &, + * { color: #fff !important; } } @@ -423,7 +510,8 @@ onBeforeUnmount(() => { &:active { background: var(--accentDarken); - &, * { + &, + * { color: #fff !important; } } @@ -431,7 +519,6 @@ onBeforeUnmount(() => { } > .users > li { - .avatar { min-width: 28px; min-height: 28px; @@ -447,7 +534,6 @@ onBeforeUnmount(() => { } > .emojis > li { - .emoji { display: inline-block; margin: 0 4px 0 0; @@ -465,7 +551,6 @@ onBeforeUnmount(() => { } > .mfmTags > li { - .name { } } diff --git a/packages/client/src/components/MkAvatars.vue b/packages/client/src/components/MkAvatars.vue index 52fda8b1db..d92eee22c1 100644 --- a/packages/client/src/components/MkAvatars.vue +++ b/packages/client/src/components/MkAvatars.vue @@ -1,14 +1,14 @@ diff --git a/packages/client/src/components/MkButton.vue b/packages/client/src/components/MkButton.vue index 9042500b4e..5f1a5bdb7e 100644 --- a/packages/client/src/components/MkButton.vue +++ b/packages/client/src/components/MkButton.vue @@ -1,34 +1,36 @@ diff --git a/packages/client/src/components/MkChannelFollowButton.vue b/packages/client/src/components/MkChannelFollowButton.vue index 7c23b91ed7..b4cb1a87f7 100644 --- a/packages/client/src/components/MkChannelFollowButton.vue +++ b/packages/client/src/components/MkChannelFollowButton.vue @@ -1,34 +1,41 @@