Skip to content

Commit 3a4a7e5

Browse files
fix: resolve Next.js demo app ESLint errors (#1589)
* fix: resolve Next.js demo app ESLint errors Fixed two ESLint errors blocking the Next.js demo app build: 1. Replaced 'any' type with 'string | null' in layout.tsx loadDictionary callback 2. Replaced <a> tag with Next.js <Link> component in Navbar.tsx for proper navigation * fix: format files with Prettier Run Prettier to fix formatting issues in AnnouncementBar.tsx and od.md
1 parent 8019d0f commit 3a4a7e5

File tree

5 files changed

+54
-19
lines changed

5 files changed

+54
-19
lines changed

.changeset/quiet-pianos-sit.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
---
3+
4+
Fix Next.js demo app ESLint errors:
5+
- Replace `any` type with `string | null` in layout.tsx loadDictionary callback
6+
- Replace `<a>` tag with Next.js `<Link>` component in Navbar.tsx

demo/next-app/src/app/layout.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,18 @@ export default function RootLayout({
3030
}: Readonly<{ children: React.ReactNode }>) {
3131
// Compiler: wrap with LingoProvider and render LocaleSwitcher
3232
return (
33-
<LingoProvider loadDictionary={(Locale: any) => loadDictionary(Locale)}>
33+
<LingoProvider
34+
loadDictionary={(Locale: string | null) => loadDictionary(Locale)}
35+
>
3436
<html lang="en">
35-
<body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>
37+
<body
38+
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
39+
>
3640
{/* Locale switcher (kept as-is) */}
3741
<div className="absolute top-2 right-3">
38-
<LocaleSwitcher locales={["en", "es", "zh", "ja", "fr", "de", "ru", "ar", "ko"]} />
42+
<LocaleSwitcher
43+
locales={["en", "es", "zh", "ja", "fr", "de", "ru", "ar", "ko"]}
44+
/>
3945
</div>
4046

4147
{/* Full-bleed top bars */}

demo/next-app/src/components/AnnouncementBar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ export default function AnnouncementBar() {
55
<div className="w-full bg-lime-500 site-announcement">
66
<div className="mx-auto w-full max-w-[var(--max-container-width)] px-4 py-1 text-sm">
77
{/* Replace with real copy if you like */}
8-
<span className="font-medium">Lingo.dev</span>&nbsp;— experimental compiler & tooling demo
8+
<span className="font-medium">Lingo.dev</span>&nbsp;— experimental
9+
compiler & tooling demo
910
</div>
1011
</div>
1112
);

demo/next-app/src/components/Navbar.tsx

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import Link from "next/link";
2+
13
// Full-bleed navbar wrapper; inner container holds padding/centering.
24
// No 100vw/w-screen anywhere → avoids Windows scrollbar gutter.
35
export default function Navbar() {
@@ -6,18 +8,39 @@ export default function Navbar() {
68
<div className="mx-auto w-full max-w-[var(--max-container-width)] px-4">
79
<nav className="flex items-center h-12">
810
{/* Left: Logo */}
9-
<a href="/" className="flex items-center gap-2 no-underline">
11+
<Link href="/" className="flex items-center gap-2 no-underline">
1012
<span className="text-base font-semibold">Lingo.dev</span>
11-
</a>
13+
</Link>
1214

1315
{/* Spacer */}
1416
<div className="grow" />
1517

1618
{/* Right: Simple links (demo only) */}
1719
<ul className="flex items-center gap-2">
18-
<li><a className="px-3 py-1.5 rounded-lg hover:bg-black/10" href="/get-started">Get started</a></li>
19-
<li><a className="px-3 py-1.5 rounded-lg hover:bg-black/10" href="/cli">CLI</a></li>
20-
<li><a className="px-3 py-1.5 rounded-lg hover:bg-black/10" href="/sdk">SDK</a></li>
20+
<li>
21+
<a
22+
className="px-3 py-1.5 rounded-lg hover:bg-black/10"
23+
href="/get-started"
24+
>
25+
Get started
26+
</a>
27+
</li>
28+
<li>
29+
<a
30+
className="px-3 py-1.5 rounded-lg hover:bg-black/10"
31+
href="/cli"
32+
>
33+
CLI
34+
</a>
35+
</li>
36+
<li>
37+
<a
38+
className="px-3 py-1.5 rounded-lg hover:bg-black/10"
39+
href="/sdk"
40+
>
41+
SDK
42+
</a>
43+
</li>
2144
</ul>
2245
</nav>
2346
</div>

readme/od.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949

5050
## କମ୍ପାଇଲର୍ ସହିତ ପରିଚିତ ହୁଅନ୍ତୁ 🆕
5151

52-
**Lingo.dev କମ୍ପାଇଲର୍** ହେଉଛି ଏକ ମାଗଣା, ମୁକ୍ତ ଉତ୍ସ କମ୍ପାଇଲର୍ ମିଡଲୱେର୍, ଯାହା React କମ୍ପୋନେଣ୍ଟ୍ରେ ଗୁଡିକୁ ଅନେକ ଭାଷା ରେ ପରିବର୍ତନ ପାଇଁ ତିଆରି ହେଇଛି ଆଉ ଏହା ଦ୍ବାରା React କମ୍ପୋନେଣ୍ଟ ରେ କୌଣସି ପରିବର୍ତନ କରିବାକୁ ପଡିବ ନାହି |
52+
**Lingo.dev କମ୍ପାଇଲର୍** ହେଉଛି ଏକ ମାଗଣା, ମୁକ୍ତ ଉତ୍ସ କମ୍ପାଇଲର୍ ମିଡଲୱେର୍, ଯାହା React କମ୍ପୋନେଣ୍ଟ୍ରେ ଗୁଡିକୁ ଅନେକ ଭାଷା ରେ ପରିବର୍ତନ ପାଇଁ ତିଆରି ହେଇଛି ଆଉ ଏହା ଦ୍ବାରା React କମ୍ପୋନେଣ୍ଟ ରେ କୌଣସି ପରିବର୍ତନ କରିବାକୁ ପଡିବ ନାହି |
5353

54-
ଥରେ ଇନ୍ଷ୍ଟାଲ କରନ୍ତୁ:
54+
ଥରେ ଇନ୍ଷ୍ଟାଲ କରନ୍ତୁ:
5555

5656
```bash
5757
npm install lingo.dev
@@ -78,12 +78,12 @@ export default lingoCompiler.next({
7878

7979
### ଏହି ରେପୋରେ କ'ଣ ଅଛି?
8080

81-
| ଟୁଲ୍ | ସଂକ୍ଷିପ୍ତ ବିବରଣୀ | ଡକ୍ସ୍ |
82-
| ----------- | ---------------------------------------------------------------------------- | --------------------------------------- |
83-
| **କମ୍ପାଇଲର୍** | ବିଲ୍ଡ-ସମୟ React ସ୍ଥାନୀକରଣ | [/compiler](https://lingo.dev/compiler) |
84-
| **CLI** | ୱେବ ଓ ମୋବାଇଲ୍ ଆପ୍, JSON, YAML, ମାର୍କଡାଉନ୍, + ଅଧିକ ପାଇଁ ଏକ-କମାଣ୍ଡ ସ୍ଥାନୀକରଣ | [/cli](https://lingo.dev/cli) |
85-
| **CI/CD** | ପ୍ରତ୍ୟେକ ପୁସରେ ଅନୁବାଦଗୁଡ଼ିକୁ ସ୍ୱୟଂ-କମିଟ୍ କରନ୍ତୁ + ଆବଶ୍ୟକତା ଅନୁସାରେ ପୁଲ୍ ରିକ୍ୱେଷ୍ଟ ସୃଷ୍ଟି କରନ୍ତୁ | [/ci](https://lingo.dev/ci) |
86-
| **SDK** | ଉପଭୋକ୍ତା-ଜନିତ ବିଷୟବସ୍ତୁ ପାଇଁ ରିଅଲଟାଇମ୍ ଅନୁବାଦ | [/sdk](https://lingo.dev/sdk) |
81+
| ଟୁଲ୍ | ସଂକ୍ଷିପ୍ତ ବିବରଣୀ | ଡକ୍ସ୍ |
82+
| ------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------- |
83+
| **କମ୍ପାଇଲର୍** | ବିଲ୍ଡ-ସମୟ React ସ୍ଥାନୀକରଣ | [/compiler](https://lingo.dev/compiler) |
84+
| **CLI** | ୱେବ ଓ ମୋବାଇଲ୍ ଆପ୍, JSON, YAML, ମାର୍କଡାଉନ୍, + ଅଧିକ ପାଇଁ ଏକ-କମାଣ୍ଡ ସ୍ଥାନୀକରଣ | [/cli](https://lingo.dev/cli) |
85+
| **CI/CD** | ପ୍ରତ୍ୟେକ ପୁସରେ ଅନୁବାଦଗୁଡ଼ିକୁ ସ୍ୱୟଂ-କମିଟ୍ କରନ୍ତୁ + ଆବଶ୍ୟକତା ଅନୁସାରେ ପୁଲ୍ ରିକ୍ୱେଷ୍ଟ ସୃଷ୍ଟି କରନ୍ତୁ | [/ci](https://lingo.dev/ci) |
86+
| **SDK** | ଉପଭୋକ୍ତା-ଜନିତ ବିଷୟବସ୍ତୁ ପାଇଁ ରିଅଲଟାଇମ୍ ଅନୁବାଦ | [/sdk](https://lingo.dev/sdk) |
8787

8888
ପ୍ରତ୍ୟେକ ପାଇଁ ସଂକ୍ଷିପ୍ତ ସୂଚନା ତଳେ ଦିଆଯାଇଛି 👇
8989

@@ -181,5 +181,4 @@ const translated = await lingoDotDev.localizeObject(content, {
181181
[English](https://github.com/lingodotdev/lingo.dev) • [中文](/readme/zh-Hans.md) • [日本語](/readme/ja.md) • [한국어](/readme/ko.md) • [Español](/readme/es.md) • [Français](/readme/fr.md) • [Русский](/readme/ru.md) • [Українська](/readme/uk-UA.md) • [Deutsch](/readme/de.md) • [Italiano](/readme/it.md) • [العربية](/readme/ar.md) • [עברית](/readme/he.md) • [हिन्दी](/readme/hi.md) • [বাংলা](/readme/bn.md) • [فارسی](/readme/fa.md) • [ଓଡ଼ିଆ](/readme/od.md)
182182

183183
ଆପଣଙ୍କ ଭାଷା ଦେଖୁନାହାଁନ୍ତି? ଏହାକୁ [`i18n.json`](./i18n.json) ରେ ଯୋଡନ୍ତୁ ଏବଂ ଏକ PR ଖୋଲନ୍ତୁ!
184-
185-
````
184+
````

0 commit comments

Comments
 (0)