Skip to content

Commit

Permalink
Move to @, fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
amannn committed Oct 23, 2024
1 parent 5d070d3 commit e2f6eea
Show file tree
Hide file tree
Showing 41 changed files with 102 additions and 88 deletions.
10 changes: 9 additions & 1 deletion docs/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
import {getPresets} from 'eslint-config-molindo';
import globals from 'globals';

export default await getPresets('typescript', 'react', 'tailwind');
export default (await getPresets('typescript', 'react', 'tailwind')).concat({
languageOptions: {
globals: {
...globals.browser,
...globals.node
}
}
});
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"autoprefixer": "^10.4.19",
"eslint": "^9.11.1",
"eslint-config-molindo": "^8.0.0",
"globals": "^15.11.0",
"next-sitemap": "^4.2.3",
"prettier": "^3.3.3",
"typescript": "^5.5.3"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/redirect/route.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {StatusCodes} from 'http-status-codes';
import {NextResponse} from 'next/server';
import ServerTracker from 'services/ServerTracker';
import ServerTracker from '@/services/ServerTracker';

export async function GET(request: Request) {
const {searchParams} = new URL(request.url);
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/Details.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {useMDXComponents} from 'nextra/mdx';
import {ComponentProps, useEffect, useReducer} from 'react';
import useLocationHash from 'hooks/useLocationHash';
import useLocationHash from '@/hooks/useLocationHash';

type Props = ComponentProps<'details'>;

Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/Example.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {clsx} from 'clsx';
import Image from 'next/image';
import useLocationHash from 'hooks/useLocationHash';
import useLocationHash from '@/hooks/useLocationHash';

type Props = {
demoLink?: string;
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useRouter} from 'next/router';
import config from 'config';
import config from '@/config';
import FooterLink from './FooterLink';
import FooterSeparator from './FooterSeparator';

Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/PartnerLink.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {HTMLAttributes} from 'react';
import BrowserTracker from 'services/BrowserTracker';
import BrowserTracker from '@/services/BrowserTracker';

type Props = HTMLAttributes<HTMLAnchorElement> & {
as?: React.ElementType;
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {SpeedInsights} from '@vercel/speed-insights/next';
import {AppProps} from 'next/app';
import {Inter} from 'next/font/google';
import {ReactNode} from 'react';
import Analytics from 'components/Analytics';
import Analytics from '@/components/Analytics';
import 'nextra-theme-docs/style.css';
import '../styles.css';

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/api/og-image.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {ImageResponse} from '@vercel/og';
import siteConfig from 'config';
import siteConfig from '@/config';

export const config = {
runtime: 'edge'
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/blog/index.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import BlogPostLink from 'components/BlogPostLink';
import BlogPostLink from '@/components/BlogPostLink';

# next-intl blog

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/blog/next-intl-3-0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: next-intl 3.0
---

import PartnerContentLink from 'components/PartnerContentLink';
import PartnerContentLink from '@/components/PartnerContentLink';

# next-intl 3.0

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/docs/design-principles.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import PartnerContentLink from 'components/PartnerContentLink';
import PartnerContentLink from '@/components/PartnerContentLink';

# Design principles

Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/docs/environments.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Card from 'components/Card';
import Cards from 'components/Cards';
import Card from '@/components/Card';
import Cards from '@/components/Cards';

# Environments

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Callout from 'components/Callout';
import Details from 'components/Details';
import Callout from '@/components/Callout';
import Details from '@/components/Details';

# Server Actions, Metadata & Route Handlers

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/docs/environments/error-files.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Callout from 'components/Callout';
import Callout from '@/components/Callout';

# Internationalization in Next.js error files

Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/docs/environments/mdx.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Details from 'components/Details';
import PartnerContentLink from 'components/PartnerContentLink';
import Details from '@/components/Details';
import PartnerContentLink from '@/components/PartnerContentLink';

# Markdown (MDX)

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/docs/environments/runtime-requirements.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Callout from 'components/Callout';
import Callout from '@/components/Callout';

# Runtime requirements

Expand Down
6 changes: 3 additions & 3 deletions docs/src/pages/docs/environments/server-client-components.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Callout from 'components/Callout';
import Details from 'components/Details';
import Callout from '@/components/Callout';
import Details from '@/components/Details';

# Internationalization of Server & Client Components

Expand Down Expand Up @@ -170,7 +170,7 @@ If you implement a locale switcher as an interactive select, you can keep intern

```tsx filename="LocaleSwitcher.tsx"
import {useLocale, useTranslations} from 'next-intl';
import {locales} from 'config';
import {locales} from '@/config';

// A Client Component that registers an event listener for
// the `change` event of the select, uses `useRouter`
Expand Down
8 changes: 4 additions & 4 deletions docs/src/pages/docs/getting-started.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Callout from 'components/Callout';
import Chip from 'components/Chip';
import Card from 'components/Card';
import Cards from 'components/Cards';
import Callout from '@/components/Callout';
import Chip from '@/components/Chip';
import Card from '@/components/Card';
import Cards from '@/components/Cards';

# Next.js internationalization (i18n)

Expand Down
10 changes: 5 additions & 5 deletions docs/src/pages/docs/getting-started/app-router.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Card from 'components/Card';
import Cards from 'components/Cards';
import Callout from 'components/Callout';
import Steps from 'components/Steps';
import Details from 'components/Details';
import Card from '@/components/Card';
import Cards from '@/components/Cards';
import Callout from '@/components/Callout';
import Steps from '@/components/Steps';
import Details from '@/components/Details';

# Next.js App Router Internationalization (i18n)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Tabs} from 'nextra/components';
import Callout from 'components/Callout';
import Steps from 'components/Steps';
import Details from 'components/Details';
import Callout from '@/components/Callout';
import Steps from '@/components/Steps';
import Details from '@/components/Details';

# App Router setup with i18n routing

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Tabs} from 'nextra/components';
import Callout from 'components/Callout';
import Steps from 'components/Steps';
import Details from 'components/Details';
import Callout from '@/components/Callout';
import Steps from '@/components/Steps';
import Details from '@/components/Details';

# App Router setup without i18n routing

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/docs/getting-started/pages-router.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Tabs} from 'nextra/components';
import Callout from 'components/Callout';
import Callout from '@/components/Callout';

# Next.js Pages Router internationalization (i18n)

Expand Down
8 changes: 4 additions & 4 deletions docs/src/pages/docs/routing.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Details from 'components/Details';
import Card from 'components/Card';
import Cards from 'components/Cards';
import Callout from 'components/Callout';
import Details from '@/components/Details';
import Card from '@/components/Card';
import Cards from '@/components/Cards';
import Callout from '@/components/Callout';

# Next.js internationalized routing

Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/docs/routing/middleware.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Callout from 'components/Callout';
import Details from 'components/Details';
import Callout from '@/components/Callout';
import Details from '@/components/Details';

# Middleware

Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/docs/routing/navigation.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Callout from 'components/Callout';
import Details from 'components/Details';
import Callout from '@/components/Callout';
import Details from '@/components/Details';

# Navigation APIs

Expand Down
6 changes: 3 additions & 3 deletions docs/src/pages/docs/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Callout from 'components/Callout';
import Card from 'components/Card';
import Cards from 'components/Cards';
import Callout from '@/components/Callout';
import Card from '@/components/Card';
import Cards from '@/components/Cards';

# Usage guide

Expand Down
6 changes: 3 additions & 3 deletions docs/src/pages/docs/usage/configuration.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PartnerContentLink from 'components/PartnerContentLink';
import Callout from 'components/Callout';
import PartnerContentLink from '@/components/PartnerContentLink';
import Callout from '@/components/Callout';
import {Tabs} from 'nextra/components';
import Details from 'components/Details';
import Details from '@/components/Details';

# Global configuration

Expand Down
6 changes: 3 additions & 3 deletions docs/src/pages/docs/usage/dates-times.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Callout from 'components/Callout';
import PartnerContentLink from 'components/PartnerContentLink';
import Details from 'components/Details';
import Callout from '@/components/Callout';
import PartnerContentLink from '@/components/PartnerContentLink';
import Details from '@/components/Details';

# Date and time formatting

Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/docs/usage/lists.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Callout from 'components/Callout';
import Details from 'components/Details';
import Callout from '@/components/Callout';
import Details from '@/components/Details';

# List formatting

Expand Down
6 changes: 3 additions & 3 deletions docs/src/pages/docs/usage/messages.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Callout from 'components/Callout';
import PartnerContentLink from 'components/PartnerContentLink';
import Details from 'components/Details';
import Callout from '@/components/Callout';
import PartnerContentLink from '@/components/PartnerContentLink';
import Details from '@/components/Details';

# Rendering i18n messages

Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/docs/usage/numbers.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Callout from 'components/Callout';
import PartnerContentLink from 'components/PartnerContentLink';
import Callout from '@/components/Callout';
import PartnerContentLink from '@/components/PartnerContentLink';

# Number formatting

Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/docs/workflows.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Card from 'components/Card';
import Cards from 'components/Cards';
import Card from '@/components/Card';
import Cards from '@/components/Cards';

# Workflows & integrations

Expand Down
6 changes: 3 additions & 3 deletions docs/src/pages/docs/workflows/localization-management.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PartnerContentLink from 'components/PartnerContentLink';
import Callout from 'components/Callout';
import Screenshot from 'components/Screenshot';
import PartnerContentLink from '@/components/PartnerContentLink';
import Callout from '@/components/Callout';
import Screenshot from '@/components/Screenshot';
import Image from 'next/image';

# Localization management with Crowdin
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/docs/workflows/storybook.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Callout from 'components/Callout';
import Callout from '@/components/Callout';
import Image from 'next/image';

# Storybook integration for `next-intl`
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/docs/workflows/typescript.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Callout from 'components/Callout';
import Callout from '@/components/Callout';

# TypeScript integration

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/examples.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Example from 'components/Example';
import Example from '@/components/Example';

# Examples

Expand Down
20 changes: 10 additions & 10 deletions docs/src/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
title: next-intl
---

import Callout from 'components/Callout';
import CodeSnippets from 'components/CodeSnippets';
import FeaturePanel from 'components/FeaturePanel';
import Hero from 'components/Hero';
import Link from 'components/Link';
import LinkButton from 'components/LinkButton';
import PartnerBanner from 'components/PartnerBanner';
import Section from 'components/Section';
import UserTestimonial from 'components/UserTestimonial';
import GetStartedBackground from 'components/GetStartedBackground';
import Callout from '@/components/Callout';
import CodeSnippets from '@/components/CodeSnippets';
import FeaturePanel from '@/components/FeaturePanel';
import Hero from '@/components/Hero';
import Link from '@/components/Link';
import LinkButton from '@/components/LinkButton';
import PartnerBanner from '@/components/PartnerBanner';
import Section from '@/components/Section';
import UserTestimonial from '@/components/UserTestimonial';
import GetStartedBackground from '@/components/GetStartedBackground';

<div className="bg-slate-50 dark:bg-gray-900">

Expand Down
10 changes: 5 additions & 5 deletions docs/src/theme.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import {
useConfig
} from 'nextra-theme-docs';
import {ComponentProps} from 'react';
import AlgoliaSearch from 'components/AlgoliaSearch';
import Footer from 'components/Footer';
import Logo from 'components/Logo';
import PartnerSidebar from 'components/PartnerSidebar';
import Pre from 'components/Pre';
import AlgoliaSearch from '@/components/AlgoliaSearch';
import Footer from '@/components/Footer';
import Logo from '@/components/Logo';
import PartnerSidebar from '@/components/PartnerSidebar';
import Pre from '@/components/Pre';
import config from './config';

export const TITLE_TEMPLATE_SUFFIX = ' – ' + config.description;
Expand Down
6 changes: 4 additions & 2 deletions docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "eslint-config-molindo/tsconfig.json",
"compilerOptions": {
"baseUrl": "src",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
Expand All @@ -19,7 +18,10 @@
"name": "next"
}
],
"strict": true
"strict": true,
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
Expand Down
Loading

0 comments on commit e2f6eea

Please sign in to comment.