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:
@ -16,6 +16,7 @@
|
||||
"test": "vitest run"
|
||||
},
|
||||
"dependencies": {
|
||||
"@repo/utils": "workspace:*",
|
||||
"deepmerge": "catalog:",
|
||||
"next": "catalog:",
|
||||
"next-intl": "catalog:",
|
||||
|
@ -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
|
||||
|
@ -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)) {
|
||||
|
@ -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({
|
||||
|
@ -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"]
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user