refactor: migrate to common eslint+prettier configs (#4168)

* refactor: migrate to common eslint+prettier configs

* fix: prettier frontend

* feat: config changes

* fix: lint issues

* fix: lint

* fix: type imports

* fix: cyclical import issue

* fix: lockfile

* fix: missing dep

* fix: switch to tabs

* fix: continue switch to tabs

* fix: rustfmt parity

* fix: moderation lint issue

* fix: lint issues

* fix: ui intl

* fix: lint issues

* Revert "fix: rustfmt parity"

This reverts commit cb99d2376c321d813d4b7fc7e2a213bb30a54711.

* feat: revert last rs
This commit is contained in:
Cal H.
2025-08-14 21:48:38 +01:00
committed by GitHub
parent 82697278dc
commit 2aabcf36ee
702 changed files with 101360 additions and 102020 deletions
@@ -1,46 +1,46 @@
<script setup lang="ts">
import { getChangelog } from "@modrinth/utils";
import { ChangelogEntry, Timeline } from "@modrinth/ui";
import { ChevronLeftIcon } from "@modrinth/assets";
import { ChevronLeftIcon } from '@modrinth/assets'
import { ChangelogEntry, Timeline } from '@modrinth/ui'
import { getChangelog } from '@modrinth/utils'
const route = useRoute();
const route = useRoute()
const changelogEntry = computed(() =>
route.params.date
? getChangelog().find((x) => {
if (x.product === route.params.product) {
console.log("Found matching product!");
route.params.date
? getChangelog().find((x) => {
if (x.product === route.params.product) {
console.log('Found matching product!')
if (x.version && x.version === route.params.date) {
console.log("Found matching version!");
return x;
} else if (x.date.unix() === Number(route.params.date as string)) {
console.log("Found matching date!");
return x;
}
}
return undefined;
})
: undefined,
);
if (x.version && x.version === route.params.date) {
console.log('Found matching version!')
return x
} else if (x.date.unix() === Number(route.params.date as string)) {
console.log('Found matching date!')
return x
}
}
return undefined
})
: undefined,
)
const isFirst = computed(() => changelogEntry.value?.date === getChangelog()[0].date);
const isFirst = computed(() => changelogEntry.value?.date === getChangelog()[0].date)
if (!changelogEntry.value) {
createError({ statusCode: 404, statusMessage: "Version not found" });
createError({ statusCode: 404, statusMessage: 'Version not found' })
}
</script>
<template>
<div v-if="changelogEntry">
<nuxt-link
:to="`/news/changelog?filter=${changelogEntry.product}`"
class="mb-4 mt-4 flex w-fit items-center gap-2 text-link"
>
<ChevronLeftIcon /> View full changelog
</nuxt-link>
<Timeline fade-out-end :fade-out-start="!isFirst">
<ChangelogEntry :entry="changelogEntry" :first="isFirst" show-type />
</Timeline>
</div>
<div v-if="changelogEntry">
<nuxt-link
:to="`/news/changelog?filter=${changelogEntry.product}`"
class="mb-4 mt-4 flex w-fit items-center gap-2 text-link"
>
<ChevronLeftIcon /> View full changelog
</nuxt-link>
<Timeline fade-out-end :fade-out-start="!isFirst">
<ChangelogEntry :entry="changelogEntry" :first="isFirst" show-type />
</Timeline>
</div>
</template>
@@ -1,65 +1,66 @@
<script setup lang="ts">
import { type Product, getChangelog } from "@modrinth/utils";
import { ChangelogEntry } from "@modrinth/ui";
import Timeline from "@modrinth/ui/src/components/base/Timeline.vue";
import NavTabs from "~/components/ui/NavTabs.vue";
import { ChangelogEntry } from '@modrinth/ui'
import Timeline from '@modrinth/ui/src/components/base/Timeline.vue'
import { getChangelog, type Product } from '@modrinth/utils'
const route = useRoute();
import NavTabs from '~/components/ui/NavTabs.vue'
const filter = ref<Product | undefined>(undefined);
const allChangelogEntries = ref(getChangelog());
const route = useRoute()
const filter = ref<Product | undefined>(undefined)
const allChangelogEntries = ref(getChangelog())
function updateFilter() {
if (route.query.filter) {
filter.value = route.query.filter as Product;
} else {
filter.value = undefined;
}
if (route.query.filter) {
filter.value = route.query.filter as Product
} else {
filter.value = undefined
}
}
updateFilter();
updateFilter()
watch(
() => route.query,
() => updateFilter(),
);
() => route.query,
() => updateFilter(),
)
const changelogEntries = computed(() =>
allChangelogEntries.value.filter((x) => !filter.value || x.product === filter.value),
);
allChangelogEntries.value.filter((x) => !filter.value || x.product === filter.value),
)
</script>
<template>
<NavTabs
:links="[
{
label: 'All',
href: '',
},
{
label: 'Website',
href: 'web',
},
{
label: 'Servers',
href: 'servers',
},
{
label: 'App',
href: 'app',
},
]"
query="filter"
class="mb-4"
/>
<Timeline fade-out-end>
<ChangelogEntry
v-for="(entry, index) in changelogEntries"
:key="entry.date"
:entry="entry"
:first="index === 0"
:show-type="filter === undefined"
has-link
/>
</Timeline>
<NavTabs
:links="[
{
label: 'All',
href: '',
},
{
label: 'Website',
href: 'web',
},
{
label: 'Servers',
href: 'servers',
},
{
label: 'App',
href: 'app',
},
]"
query="filter"
class="mb-4"
/>
<Timeline fade-out-end>
<ChangelogEntry
v-for="(entry, index) in changelogEntries"
:key="entry.date"
:entry="entry"
:first="index === 0"
:show-type="filter === undefined"
has-link
/>
</Timeline>
</template>