From 9bdd716dd2307221d65623c55e0b7ac69b93d054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=A1=C4=8Dak?= Date: Mon, 4 Dec 2023 11:45:26 +0100 Subject: [PATCH 1/2] feat: no literals eslint rule --- .eslintrc.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.eslintrc.json b/.eslintrc.json index 8a07304..83850f9 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -43,6 +43,13 @@ } ] } + ], + "react/jsx-no-literals": [ + "error", + { + "noStrings": true, + "ignoreProps": true + } ] } } From cbc4c54043cdb5d509fb60df5740657fde5172b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=A1=C4=8Dak?= Date: Mon, 4 Dec 2023 11:55:06 +0100 Subject: [PATCH 2/2] fix: lint errors --- src/app/[locale]/page.tsx | 13 +++++++------ src/i18n/en/common.ts | 3 +++ src/i18n/sl/common.ts | 3 +++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/app/[locale]/page.tsx b/src/app/[locale]/page.tsx index 07f5fac..bc0c088 100644 --- a/src/app/[locale]/page.tsx +++ b/src/app/[locale]/page.tsx @@ -1,11 +1,16 @@ +'use client'; + import { Inter } from 'next/font/google'; import SampleForm from '@/components/sample-form'; import serverLogger from '@/lib/axiom/log-server'; +import { useScopedI18n } from '@/i18n/client'; const inter = Inter({ subsets: ['latin'] }); export default function Page() { + const t = useScopedI18n('common'); + const logger = serverLogger(); logger.info('Hello from server logger!'); @@ -13,12 +18,8 @@ export default function Page() { return (
-

- Next.js + Tailwind CSS + TypeScript -

-

- with i18n, jest, zod, react-hook-form -

+

{t('title')}

+

{t('subtitle')}

); diff --git a/src/i18n/en/common.ts b/src/i18n/en/common.ts index 0732d55..9e856c8 100644 --- a/src/i18n/en/common.ts +++ b/src/i18n/en/common.ts @@ -1,4 +1,7 @@ export default { 'test#other': '{count} tests', 'test#one': 'test', + + title: 'Next.js + Tailwind CSS + TypeScript', + subtitle: 'with i18n, jest, zod, react-hook-form', } as const; diff --git a/src/i18n/sl/common.ts b/src/i18n/sl/common.ts index f7a53a7..c5eeef1 100644 --- a/src/i18n/sl/common.ts +++ b/src/i18n/sl/common.ts @@ -3,4 +3,7 @@ export default { 'test#two': '{count} testa', 'test#few': '{count} testi', 'test#other': '{count} testov', + + title: 'Next.js + Tailwind CSS + TypeScript', + subtitle: 'with i18n, jest, zod, react-hook-form', } as const;