Skip to content

Commit 5c6f565

Browse files
committed
@ path in example instead of baseUrl
1 parent 47bf702 commit 5c6f565

File tree

10 files changed

+16
-14
lines changed

10 files changed

+16
-14
lines changed

examples/example-app-router/src/app/[locale]/error.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import {useTranslations} from 'next-intl';
44
import {useEffect} from 'react';
5-
import PageLayout from 'components/PageLayout';
5+
import PageLayout from '@/components/PageLayout';
66

77
type Props = {
88
error: Error;

examples/example-app-router/src/app/[locale]/layout.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import clsx from 'clsx';
22
import {Inter} from 'next/font/google';
33
import {getTranslations, unstable_setRequestLocale} from 'next-intl/server';
44
import {ReactNode} from 'react';
5-
import Navigation from 'components/Navigation';
6-
import {locales} from '../../config';
5+
import Navigation from '@/components/Navigation';
6+
import {locales} from '@/config';
77

88
const inter = Inter({subsets: ['latin']});
99

examples/example-app-router/src/app/[locale]/not-found.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {useTranslations} from 'next-intl';
2-
import PageLayout from 'components/PageLayout';
2+
import PageLayout from '@/components/PageLayout';
33

44
// Note that `app/[locale]/[...rest]/page.tsx`
55
// is necessary for this page to render.

examples/example-app-router/src/app/[locale]/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {useTranslations} from 'next-intl';
22
import {unstable_setRequestLocale} from 'next-intl/server';
3-
import PageLayout from 'components/PageLayout';
3+
import PageLayout from '@/components/PageLayout';
44

55
type Props = {
66
params: {locale: string};

examples/example-app-router/src/app/[locale]/pathnames/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {useTranslations} from 'next-intl';
22
import {unstable_setRequestLocale} from 'next-intl/server';
3-
import PageLayout from 'components/PageLayout';
3+
import PageLayout from '@/components/PageLayout';
44

55
type Props = {
66
params: {locale: string};

examples/example-app-router/src/app/sitemap.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {MetadataRoute} from 'next';
2-
import {locales, pathnames, defaultLocale, host} from 'config';
3-
import {getPathname} from 'navigation';
2+
import {locales, pathnames, defaultLocale, host} from '@/config';
3+
import {getPathname} from '@/navigation';
44

55
export default function sitemap(): MetadataRoute.Sitemap {
66
const keys = Object.keys(pathnames) as Array<keyof typeof pathnames>;

examples/example-app-router/src/components/LocaleSwitcher.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {useLocale, useTranslations} from 'next-intl';
2-
import {locales} from '../config';
32
import LocaleSwitcherSelect from './LocaleSwitcherSelect';
3+
import {locales} from '@/config';
44

55
export default function LocaleSwitcher() {
66
const t = useTranslations('LocaleSwitcher');

examples/example-app-router/src/components/LocaleSwitcherSelect.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import clsx from 'clsx';
44
import {useParams} from 'next/navigation';
55
import {ChangeEvent, ReactNode, useTransition} from 'react';
6-
import {useRouter, usePathname} from '../navigation';
6+
import {useRouter, usePathname} from '@/navigation';
77

88
type Props = {
99
children: ReactNode;

examples/example-app-router/src/components/NavigationLink.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import clsx from 'clsx';
44
import {useSelectedLayoutSegment} from 'next/navigation';
55
import {ComponentProps} from 'react';
6-
import type {AppPathnames} from '../config';
7-
import {Link} from '../navigation';
6+
import type {AppPathnames} from '@/config';
7+
import {Link} from '@/navigation';
88

99
export default function NavigationLink<Pathname extends AppPathnames>({
1010
href,

examples/example-app-router/tsconfig.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"extends": "eslint-config-molindo/tsconfig.json",
33
"compilerOptions": {
4-
"baseUrl": "src",
54
"target": "es5",
65
"lib": [
76
"dom",
@@ -22,7 +21,10 @@
2221
{
2322
"name": "next"
2423
}
25-
]
24+
],
25+
"paths": {
26+
"@/*": ["./src/*"]
27+
}
2628
},
2729
"include": [
2830
"next-env.d.ts",

0 commit comments

Comments
 (0)