1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-05-29 22:37:44 +02:00

chore: simplify TypeScript config

This commit is contained in:
2024-09-11 23:53:26 +02:00
parent 6853ac6884
commit 386f407f21
98 changed files with 2355 additions and 2682 deletions

View File

@ -16,6 +16,7 @@
"test": "vitest run"
},
"dependencies": {
"@repo/utils": "workspace:*",
"deepmerge": "catalog:",
"next": "catalog:",
"next-intl": "catalog:",

View File

@ -1,10 +1,6 @@
import type { Locale } from "@repo/utils/constants"
import type { RichTranslationValues } from "next-intl"
export const LOCALES = ["en-US", "fr-FR"] as const
export type Locale = (typeof LOCALES)[number]
export const LOCALE_DEFAULT = "en-US" satisfies Locale
export const LOCALE_PREFIX = "never"
export interface LocaleProps {
params: {
locale: Locale

View File

@ -3,8 +3,9 @@ import type { AbstractIntlMessages } from "next-intl"
import { getRequestConfig } from "next-intl/server"
import { notFound } from "next/navigation"
import type { Locale } from "./config"
import { defaultTranslationValues, LOCALE_DEFAULT, LOCALES } from "./config"
import type { Locale } from "@repo/utils/constants"
import { LOCALE_DEFAULT, LOCALES } from "@repo/utils/constants"
import { defaultTranslationValues } from "./config.tsx"
export default getRequestConfig(async ({ locale }) => {
if (!LOCALES.includes(locale as Locale)) {

View File

@ -1,6 +1,6 @@
import { createSharedPathnamesNavigation } from "next-intl/navigation"
import { LOCALES, LOCALE_PREFIX } from "./config"
import { LOCALES, LOCALE_PREFIX } from "@repo/utils/constants"
export const { Link, redirect, usePathname, useRouter, permanentRedirect } =
createSharedPathnamesNavigation({

View File

@ -1,14 +1,7 @@
{
"extends": "@repo/config-typescript/tsconfig.json",
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"types": ["@total-typescript/ts-reset"],
"jsx": "preserve",
"noEmit": true
"types": ["@total-typescript/ts-reset"]
}
}