Skip to content

Commit 5381c5b

Browse files
committed
style: fix lint errors and format codebase with prettier/stylelint
1 parent 64eb5cc commit 5381c5b

66 files changed

Lines changed: 2467 additions & 2417 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<script setup lang="ts">
2-
import { useDisplay } from "vuetify";
3-
import { mdiCheck, mdiInformation } from "@mdi/js";
2+
import { useDisplay } from 'vuetify'
3+
import { mdiCheck, mdiInformation } from '@mdi/js'
44
5-
const { lgAndUp } = useDisplay();
6-
const notificationsStore = useNotificationsStore();
5+
const { lgAndUp } = useDisplay()
6+
const notificationsStore = useNotificationsStore()
77
88
const notificationActive = computed({
99
get: () => notificationsStore.notification.active,
1010
set: () => notificationsStore.disableNotification(),
11-
});
11+
})
1212
</script>
1313

1414
<template>
1515
<v-snackbar
16-
variant="tonal"
1716
v-model="notificationActive"
17+
variant="tonal"
1818
:color="notificationsStore.notification.type"
1919
:timeout="notificationsStore.notification.timeout"
2020
>

web/app/components/BackButton.vue

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
<script setup lang="ts">
2-
import { useDisplay } from "vuetify";
3-
import { mdiArrowLeft } from "@mdi/js";
4-
import type { RouteLocationRaw } from "vue-router";
2+
import { useDisplay } from 'vuetify'
3+
import { mdiArrowLeft } from '@mdi/js'
4+
import type { RouteLocationRaw } from 'vue-router'
55
66
const props = withDefaults(
77
defineProps<{
8-
route?: RouteLocationRaw;
9-
block?: boolean;
8+
route?: RouteLocationRaw
9+
block?: boolean
1010
}>(),
1111
{
1212
block: false,
1313
},
14-
);
14+
)
1515
16-
const router = useRouter();
17-
const { smAndDown } = useDisplay();
16+
const router = useRouter()
17+
const { smAndDown } = useDisplay()
1818
1919
function goBack() {
2020
if (props.route) {
21-
router.push(props.route);
22-
return;
21+
router.push(props.route)
22+
return
2323
}
2424
if (window.history.length > 1) {
25-
router.back();
26-
return;
25+
router.back()
26+
return
2727
}
28-
router.push({ name: "index" });
28+
router.push({ name: 'index' })
2929
}
3030
</script>
3131

web/app/components/BlogAuthorBio.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { mdiTwitter, mdiGithub } from "@mdi/js";
2+
import { mdiTwitter, mdiGithub } from '@mdi/js'
33
</script>
44

55
<template>

web/app/components/BlogInfo.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script setup lang="ts">
22
const props = defineProps<{
3-
date: string;
4-
readTime: string;
5-
}>();
3+
date: string
4+
readTime: string
5+
}>()
66
</script>
77

88
<template>

web/app/components/BlogSidebar.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
2-
import { mdiBookOpenVariant } from "@mdi/js";
2+
import { mdiBookOpenVariant } from '@mdi/js'
33
4-
const appStore = useAppStore();
4+
const appStore = useAppStore()
55
</script>
66

77
<template>

web/app/components/CopyButton.vue

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
<script setup lang="ts">
2-
import { useDisplay } from "vuetify";
3-
import { mdiContentCopy } from "@mdi/js";
2+
import { useDisplay } from 'vuetify'
3+
import { mdiContentCopy } from '@mdi/js'
44
55
const props = withDefaults(
66
defineProps<{
7-
value: string;
8-
color?: string;
9-
block?: boolean;
10-
large?: boolean;
11-
copyText?: string;
12-
notificationText?: string;
7+
value: string
8+
color?: string
9+
block?: boolean
10+
large?: boolean
11+
copyText?: string
12+
notificationText?: string
1313
}>(),
1414
{
15-
color: "default",
15+
color: 'default',
1616
block: false,
1717
large: false,
18-
copyText: "Copy",
19-
notificationText: "Copied",
18+
copyText: 'Copy',
19+
notificationText: 'Copied',
2020
},
21-
);
21+
)
2222
23-
const { smAndDown } = useDisplay();
24-
const notificationsStore = useNotificationsStore();
25-
const disabled = ref(false);
23+
const { smAndDown } = useDisplay()
24+
const notificationsStore = useNotificationsStore()
25+
const disabled = ref(false)
2626
2727
async function copy() {
28-
disabled.value = true;
29-
await navigator.clipboard.writeText(props.value);
28+
disabled.value = true
29+
await navigator.clipboard.writeText(props.value)
3030
notificationsStore.addNotification({
3131
message: props.notificationText,
32-
type: "success",
33-
});
32+
type: 'success',
33+
})
3434
setTimeout(() => {
35-
disabled.value = false;
36-
}, 5000);
35+
disabled.value = false
36+
}, 5000)
3737
}
3838
</script>
3939

web/app/components/FirebaseAuth.vue

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -6,114 +6,114 @@ import {
66
GithubAuthProvider,
77
signInWithEmailAndPassword,
88
createUserWithEmailAndPassword,
9-
} from "firebase/auth";
10-
import { mdiGoogle, mdiGithub, mdiEmail } from "@mdi/js";
9+
} from 'firebase/auth'
10+
import { mdiGoogle, mdiGithub, mdiEmail } from '@mdi/js'
1111
1212
const props = withDefaults(
1313
defineProps<{
14-
to?: string;
14+
to?: string
1515
}>(),
16-
{ to: "/" },
17-
);
16+
{ to: '/' },
17+
)
1818
19-
const router = useRouter();
20-
const authStore = useAuthStore();
21-
const notificationsStore = useNotificationsStore();
22-
const appStore = useAppStore();
19+
const router = useRouter()
20+
const authStore = useAuthStore()
21+
const notificationsStore = useNotificationsStore()
22+
const appStore = useAppStore()
2323
24-
const loading = ref(false);
25-
const showEmailForm = ref(false);
26-
const isSignUp = ref(false);
27-
const email = ref("");
28-
const password = ref("");
29-
const emailError = ref("");
24+
const loading = ref(false)
25+
const showEmailForm = ref(false)
26+
const isSignUp = ref(false)
27+
const email = ref('')
28+
const password = ref('')
29+
const emailError = ref('')
3030
3131
async function signInWithGoogle() {
32-
loading.value = true;
32+
loading.value = true
3333
try {
34-
const auth = getAuth();
35-
const result = await signInWithPopup(auth, new GoogleAuthProvider());
36-
onSuccess(result.user);
34+
const auth = getAuth()
35+
const result = await signInWithPopup(auth, new GoogleAuthProvider())
36+
onSuccess(result.user)
3737
} catch (error: unknown) {
38-
handleError(error, true);
38+
handleError(error, true)
3939
} finally {
40-
loading.value = false;
40+
loading.value = false
4141
}
4242
}
4343
4444
async function signInWithGithub() {
45-
loading.value = true;
45+
loading.value = true
4646
try {
47-
const auth = getAuth();
48-
const result = await signInWithPopup(auth, new GithubAuthProvider());
49-
onSuccess(result.user);
47+
const auth = getAuth()
48+
const result = await signInWithPopup(auth, new GithubAuthProvider())
49+
onSuccess(result.user)
5050
} catch (error: unknown) {
51-
handleError(error, true);
51+
handleError(error, true)
5252
} finally {
53-
loading.value = false;
53+
loading.value = false
5454
}
5555
}
5656
5757
async function submitEmail() {
58-
emailError.value = "";
59-
loading.value = true;
58+
emailError.value = ''
59+
loading.value = true
6060
try {
61-
const auth = getAuth();
62-
let result;
61+
const auth = getAuth()
62+
let result
6363
if (isSignUp.value) {
6464
result = await createUserWithEmailAndPassword(
6565
auth,
6666
email.value,
6767
password.value,
68-
);
68+
)
6969
} else {
7070
result = await signInWithEmailAndPassword(
7171
auth,
7272
email.value,
7373
password.value,
74-
);
74+
)
7575
}
76-
onSuccess(result.user);
76+
onSuccess(result.user)
7777
} catch (error: unknown) {
78-
handleError(error);
78+
handleError(error)
7979
} finally {
80-
loading.value = false;
80+
loading.value = false
8181
}
8282
}
8383
8484
function onSuccess(user: unknown) {
8585
notificationsStore.addNotification({
86-
message: "Login successful!",
87-
type: "success",
88-
});
89-
authStore.onAuthStateChanged(user);
90-
router.push({ path: props.to });
86+
message: 'Login successful!',
87+
type: 'success',
88+
})
89+
authStore.onAuthStateChanged(user)
90+
router.push({ path: props.to })
9191
}
9292
9393
function handleError(error: unknown, isSocial = false) {
94-
const firebaseError = error as { code?: string; message?: string };
95-
const code = firebaseError.code || "";
96-
let message = "";
97-
if (code === "auth/user-not-found" || code === "auth/invalid-credential") {
98-
message = "Invalid email or password";
99-
} else if (code === "auth/email-already-in-use") {
100-
message = "An account with this email already exists";
101-
} else if (code === "auth/weak-password") {
102-
message = "Password must be at least 6 characters";
94+
const firebaseError = error as { code?: string; message?: string }
95+
const code = firebaseError.code || ''
96+
let message = ''
97+
if (code === 'auth/user-not-found' || code === 'auth/invalid-credential') {
98+
message = 'Invalid email or password'
99+
} else if (code === 'auth/email-already-in-use') {
100+
message = 'An account with this email already exists'
101+
} else if (code === 'auth/weak-password') {
102+
message = 'Password must be at least 6 characters'
103103
} else if (
104-
code === "auth/popup-closed-by-user" ||
105-
code === "auth/cancelled-popup-request"
104+
code === 'auth/popup-closed-by-user' ||
105+
code === 'auth/cancelled-popup-request'
106106
) {
107107
// User closed the popup, no error to show
108-
return;
108+
return
109109
} else {
110-
message = firebaseError.message || "An error occurred";
110+
message = firebaseError.message || 'An error occurred'
111111
}
112112
113113
if (isSocial) {
114-
notificationsStore.addNotification({ message, type: "error" });
114+
notificationsStore.addNotification({ message, type: 'error' })
115115
} else {
116-
emailError.value = message;
116+
emailError.value = message
117117
}
118118
}
119119
</script>
@@ -190,7 +190,7 @@ function handleError(error: unknown, isSocial = false) {
190190
type="submit"
191191
:loading="loading"
192192
>
193-
{{ isSignUp ? "Sign Up" : "Sign In" }}
193+
{{ isSignUp ? 'Sign Up' : 'Sign In' }}
194194
</v-btn>
195195
<v-btn
196196
block
@@ -200,7 +200,7 @@ function handleError(error: unknown, isSocial = false) {
200200
@click="isSignUp = !isSignUp"
201201
>
202202
{{
203-
isSignUp ? "Already have an account? Sign In" : "No account? Sign Up"
203+
isSignUp ? 'Already have an account? Sign In' : 'No account? Sign Up'
204204
}}
205205
</v-btn>
206206
</v-form>

web/app/components/FixedHeader.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
2-
import { useDisplay } from "vuetify";
2+
import { useDisplay } from 'vuetify'
33
4-
const { lgAndUp, mdAndDown } = useDisplay();
4+
const { lgAndUp, mdAndDown } = useDisplay()
55
</script>
66

77
<template>

0 commit comments

Comments
 (0)