Browse Source

fix: remove file extension & some revert

- add: script to run checks script
pull/1397/head
tetuaoro 7 months ago
committed by Bernd Storath
parent
commit
d2e73ec9d0
  1. 2
      src/app/components/ui/ChooseLang.vue
  2. 3
      src/package.json
  3. 8
      src/server/utils/types.ts

2
src/app/components/ui/ChooseLang.vue

@ -31,7 +31,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { LOCALES } from '~/../i18n.config.js'; import { LOCALES } from '~/../i18n.config';
const { lang } = defineProps<{ const { lang } = defineProps<{
lang: string; lang: string;

3
src/package.json

@ -13,7 +13,8 @@
"lint": "eslint .", "lint": "eslint .",
"format": "prettier . --write", "format": "prettier . --write",
"format:check": "prettier . --check", "format:check": "prettier . --check",
"typecheck": "nuxt typecheck" "typecheck": "nuxt typecheck",
"check:runall": "nuxt build && nuxt typecheck && eslint . && prettier . --check"
}, },
"dependencies": { "dependencies": {
"@eschricht/nuxt-color-mode": "^1.1.5", "@eschricht/nuxt-color-mode": "^1.1.5",

8
src/server/utils/types.ts

@ -1,9 +1,7 @@
import type { ZodSchema } from 'zod'; import type { ZodSchema } from 'zod';
import { z, ZodError } from 'zod'; import { z, ZodError } from 'zod';
import type { H3Event, EventHandlerRequest } from 'h3'; import type { H3Event, EventHandlerRequest } from 'h3';
import { useI18n } from '#i18n'; import { LOCALES } from '~~/i18n.config';
const { availableLocales } = useI18n();
// TODO: use i18n for messages // TODO: use i18n for messages
@ -77,8 +75,8 @@ const statistics = z.object(
const objectMessage = 'zod.body'; // i18n key const objectMessage = 'zod.body'; // i18n key
// const langs = LOCALES.map((lang) => lang.value); const langs = LOCALES.map((lang) => lang.value);
const lang = z.enum(['', ...availableLocales]); const lang = z.enum(['', ...langs]);
export const langType = z.object({ export const langType = z.object({
lang: lang, lang: lang,
}); });

Loading…
Cancel
Save