Skip to content

Commit 66a7844

Browse files
committed
Update Prettier and fix linting issues
1 parent 66ac33f commit 66a7844

File tree

12 files changed

+129
-73
lines changed

12 files changed

+129
-73
lines changed

client/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"@types/node": "^18.16.10",
3939
"@unhead/vue": "^1.1.26",
4040
"@vitejs/plugin-vue": "^4.1.0",
41-
"@vue/eslint-config-prettier": "^7.1.0",
41+
"@vue/eslint-config-prettier": "^9.0.0",
4242
"@vue/eslint-config-typescript": "^11.0.0",
4343
"@vue/tsconfig": "^0.4.0",
4444
"eslint": "^8.36.0",

client/src/App.vue

+8-2
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,18 @@ footer.page-footer {
8686
max-width: 16rem;
8787
opacity: 0.6;
8888
clip-path: polygon(0 5%, 100% 5%, 100% 55%, 0 55%);
89-
transition: 15s ease-in opacity, 20s ease-in clip-path, 5s ease-in max-width;
89+
transition:
90+
15s ease-in opacity,
91+
20s ease-in clip-path,
92+
5s ease-in max-width;
9093
}
9194
9295
&:hover img {
9396
opacity: 1;
94-
transition: 1s ease-out opacity, 1s ease-out clip-path, 1s ease-out max-width;
97+
transition:
98+
1s ease-out opacity,
99+
1s ease-out clip-path,
100+
1s ease-out max-width;
95101
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
96102
max-width: 25rem;
97103
}

client/src/components/LightDarkToggler.vue

+15-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,18 @@
1111

1212
<style lang="scss">
1313
.emoji {
14-
font-family: Apple Color Emoji, Segoe UI Emoji, Noto Color Emoji, Android Emoji, EmojiSymbols, EmojiOne Mozilla, Twemoji Mozilla,
15-
Segoe UI Symbol, Noto Color Emoji Compat, emoji, noto-emojipedia-fallback;
14+
font-family:
15+
Apple Color Emoji,
16+
Segoe UI Emoji,
17+
Noto Color Emoji,
18+
Android Emoji,
19+
EmojiSymbols,
20+
EmojiOne Mozilla,
21+
Twemoji Mozilla,
22+
Segoe UI Symbol,
23+
Noto Color Emoji Compat,
24+
emoji,
25+
noto-emojipedia-fallback;
1626
font-weight: 400;
1727
}
1828
@@ -62,7 +72,9 @@
6272
height: calc(var(--element-size) * 0.4);
6373
width: calc(var(--element-size) * 0.4);
6474
transform: translateX(0);
65-
transition: transform 0.3s ease, background-color 0.5s ease;
75+
transition:
76+
transform 0.3s ease,
77+
background-color 0.5s ease;
6678
}
6779
6880
.modeswitch-toggle-checked {

client/src/components/SplitFlap.vue

+13-10
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,19 @@ function animate() {
4444
if (numStepsRemaining > 0) {
4545
isAnimated.isAnimated = true;
4646
// Wait for the animation to finish
47-
setTimeout(() => {
48-
currentChar.value = nextChar.value;
49-
// Execute immediately before the style calculations for the next frame
50-
requestAnimationFrame(() => {
51-
isAnimated.isAnimated = false;
52-
nextChar.value = findNextChar(currentChar.value) ?? " ";
53-
// Wait with continuing the animation until immediately before the style calculations for the next frame
54-
requestAnimationFrame(animate);
55-
});
56-
}, timeout.value + Math.random() * 50);
47+
setTimeout(
48+
() => {
49+
currentChar.value = nextChar.value;
50+
// Execute immediately before the style calculations for the next frame
51+
requestAnimationFrame(() => {
52+
isAnimated.isAnimated = false;
53+
nextChar.value = findNextChar(currentChar.value) ?? " ";
54+
// Wait with continuing the animation until immediately before the style calculations for the next frame
55+
requestAnimationFrame(animate);
56+
});
57+
},
58+
timeout.value + Math.random() * 50,
59+
);
5760
}
5861
}
5962

client/src/debounce.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ export const debounce = <T>(callback: () => T, timeout = 500): ComputedRef<T> =>
1616
if (lastTimeout !== null) {
1717
clearTimeout(lastTimeout);
1818
}
19-
lastTimeout = window.setTimeout(() => {
20-
current.value = newValue;
21-
}, Math.max(timeout, 1));
19+
lastTimeout = window.setTimeout(
20+
() => {
21+
current.value = newValue;
22+
},
23+
Math.max(timeout, 1),
24+
);
2225
}
2326
});
2427
return computed(() => current.value);

client/src/util/api-client.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ interface ApiRequestJsonPayload<T> {
6969
json: NonNullable<T>;
7070
}
7171
class ApiRequestJsonPayloadWithFiles<T> implements ApiRequestJsonPayload<T> {
72-
constructor(public json: NonNullable<T>, public files: File[]) {}
72+
constructor(
73+
public json: NonNullable<T>,
74+
public files: File[],
75+
) {}
7376
}
7477

7578
function toFormData<T>(payload: ApiRequestJsonPayloadWithFiles<T> | null): FormData | null {

client/src/views/PostFormView.vue

+6-2
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,9 @@
203203
text-align: center;
204204
border-radius: 0.375rem;
205205
box-shadow: inset 0 0 0 0 #ffc377;
206-
transition: 0.5s ease-out box-shadow, 3s ease border-color;
206+
transition:
207+
0.5s ease-out box-shadow,
208+
3s ease border-color;
207209
width: 100%;
208210
209211
.plus {
@@ -219,7 +221,9 @@
219221
&:active {
220222
border: 2px dashed #aaa;
221223
box-shadow: inset 0 -15rem 0 0 #ffc377;
222-
transition: 0.5s ease-in box-shadow, 3s ease border-color;
224+
transition:
225+
0.5s ease-in box-shadow,
226+
3s ease border-color;
223227
}
224228
}
225229

package-lock.json

+58-36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
"devDependencies": {
2727
"@types/multer": "^1.4.7",
2828
"concurrently": "^8.0.1",
29-
"eslint-plugin-prettier": "4.2.1",
29+
"eslint-plugin-prettier": "5.1.3",
3030
"eslint-plugin-unused-imports": "2.0.0",
3131
"json-source-map": "0.6.1",
3232
"lerna": "8.1.3",
3333
"npm-run-all": "4.1.5",
34-
"prettier": "3.3.2"
34+
"prettier": "^3.3.2"
3535
},
3636
"author": "fumiX GmbH & Co KG",
3737
"bugs": {

portal/src/routes/login.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ router.get("/", async (req, res) => {
4747
<span>Code <code>${userInfosById[it.oauthId].code}</code></span><br>
4848
${it.user.roles.map((r) => '<span class="badge rounded-pill text-bg-info m-1">' + r + "</span>").join("")}<br>
4949
<a class="btn btn-outline-primary" href="${req.query.redirect_uri}?state=${req.query.state ?? ""}&code=${
50-
userInfosById[it.oauthId].code
51-
}">Login</a>
50+
userInfosById[it.oauthId].code
51+
}">Login</a>
5252
</form>
5353
</div>
5454
</li>`;

server/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"node-fetch": "^3.3.1",
4545
"nodemon": "^2.0.20",
4646
"openid-client": "^5.4.0",
47-
"prettier": "^2.8.4",
47+
"prettier": "^3.3.2",
4848
"ts-node": "^10.9.1",
4949
"typescript": "^5.0.4"
5050
}

server/src/service/opengraph.ts

+13-10
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,19 @@ export function generateShareImage(title: string, date: Date, image: Image | Can
1111
const titleWords = title.split(/\s+/).map((word) => ({ word, width: context.measureText(word).width }));
1212

1313
const lines = titleWords
14-
.reduce((acc, current) => {
15-
const lastLineIndex = acc.length - 1;
16-
if (lastLineIndex >= 0 && acc[lastLineIndex].width + current.width < 600) {
17-
acc[lastLineIndex].line += ` ${current.word}`;
18-
acc[lastLineIndex].width += current.width;
19-
} else {
20-
acc.push({ line: current.word, width: current.width });
21-
}
22-
return acc;
23-
}, [] as { line: string; width: number }[])
14+
.reduce(
15+
(acc, current) => {
16+
const lastLineIndex = acc.length - 1;
17+
if (lastLineIndex >= 0 && acc[lastLineIndex].width + current.width < 600) {
18+
acc[lastLineIndex].line += ` ${current.word}`;
19+
acc[lastLineIndex].width += current.width;
20+
} else {
21+
acc.push({ line: current.word, width: current.width });
22+
}
23+
return acc;
24+
},
25+
[] as { line: string; width: number }[],
26+
)
2427
.map((line) => line.line);
2528
const overlong = lines.length > 6;
2629
lines.length = Math.min(lines.length, 6); // max 4 lines

0 commit comments

Comments
 (0)