diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 997bfe5..db75c62 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -2,6 +2,10 @@ env: browser: true node: true +globals: + React: true + JSX: true + plugins: - '@typescript-eslint' @@ -15,12 +19,12 @@ parser: '@typescript-eslint/parser' rules: 'no-console': 'warn' + 'no-nested-ternary': 'warn' + 'no-use-before-define': 'warn' '@typescript-eslint/array-type': - 'warn' - 'default': 'array-simple' - '@typescript-eslint/consistent-indexed-object-style': 'warn' '@typescript-eslint/no-explicit-any': 'warn' - -globals: - JSX: true - React: true + '@typescript-eslint/consistent-type-imports': 'warn' + '@typescript-eslint/consistent-type-definitions': 'warn' + '@typescript-eslint/consistent-indexed-object-style': 'warn' diff --git a/src/app/layout.tsx b/src/app/layout.tsx index ff276a9..cf1cea5 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -8,18 +8,8 @@ import Providers from '@/app/providers'; import { cn } from '@/utils/cn'; import type { Metadata } from 'next'; -import type { TLayoutProps } from '@/types/layout.type'; -const DEFAULT_TITLE = 'Next.js App Dir Template'; -const DEFAULT_DESCRIPTION = 'Next.js app directory template, built with Next.js (TypeScript) and Tailwind CSS.'; - -export const metadata: Metadata = { - title: { - template: `%s - ${DEFAULT_TITLE}`, - default: DEFAULT_TITLE, - }, - description: DEFAULT_DESCRIPTION, -}; +import type { TLayoutProps } from '@/types/layout'; export default async function Layout({ children }: TLayoutProps) { return ( @@ -30,3 +20,14 @@ export default async function Layout({ children }: TLayoutProps) { ); } + +const DEFAULT_TITLE = 'Next.js App Dir Template'; +const DEFAULT_DESCRIPTION = 'Next.js app directory template, built with Next.js (TypeScript) and Tailwind CSS.'; + +export const metadata: Metadata = { + title: { + template: `%s - ${DEFAULT_TITLE}`, + default: DEFAULT_TITLE, + }, + description: DEFAULT_DESCRIPTION, +}; diff --git a/src/app/providers.tsx b/src/app/providers.tsx index 830f100..955f39e 100644 --- a/src/app/providers.tsx +++ b/src/app/providers.tsx @@ -8,7 +8,7 @@ import { ThemeProvider } from 'next-themes'; import { ThemeWatcher } from '@/app/_components/theme-watcher'; import { TRPCReactProvider } from '@/trpc/client/react'; -type TProvidersProps = React.PropsWithChildren; +import type { TProvidersProps } from '@/types/providers'; export default function Providers({ children }: TProvidersProps) { return ( diff --git a/src/server/db/adapter.ts b/src/server/db/adapter.ts index 4fc072d..e1e7519 100644 --- a/src/server/db/adapter.ts +++ b/src/server/db/adapter.ts @@ -22,11 +22,11 @@ import { text, primaryKey, integer, - PgTableFn, - PgDatabase, serial, varchar, index, + type PgTableFn, + type PgDatabase, } from 'drizzle-orm/pg-core'; import type { Adapter, AdapterAccount } from 'next-auth/adapters'; diff --git a/src/types/layout.ts b/src/types/layout.ts new file mode 100644 index 0000000..2331815 --- /dev/null +++ b/src/types/layout.ts @@ -0,0 +1,10 @@ +import type { PropsWithChildren } from 'react'; + +// import type { TParams, TSearchParams } from '@/types/params'; + +// export type TLayoutProps

= PropsWithChildren<{ +// params: P; +// searchParams: SP; +// }>; + +export type TLayoutProps = PropsWithChildren; diff --git a/src/types/layout.type.ts b/src/types/layout.type.ts deleted file mode 100644 index cee1f39..0000000 --- a/src/types/layout.type.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { PropsWithChildren } from 'react'; - -export type TLayoutProps = PropsWithChildren; diff --git a/src/types/page.ts b/src/types/page.ts new file mode 100644 index 0000000..b382724 --- /dev/null +++ b/src/types/page.ts @@ -0,0 +1,6 @@ +import type { TParams, TSearchParams } from '@/types/params'; + +export interface TPageProps

{ + params: P; + searchParams: SP; +} diff --git a/src/types/page.type.ts b/src/types/page.type.ts deleted file mode 100644 index 6be79ee..0000000 --- a/src/types/page.type.ts +++ /dev/null @@ -1,6 +0,0 @@ -type TDefaultParams = Record; - -export type TPageProps

= { - params: P; - searchParams: SP; -}; diff --git a/src/types/params.ts b/src/types/params.ts new file mode 100644 index 0000000..7e0de73 --- /dev/null +++ b/src/types/params.ts @@ -0,0 +1,3 @@ +export type TParams = Record; + +export type TSearchParams = Record; diff --git a/src/types/providers.ts b/src/types/providers.ts new file mode 100644 index 0000000..96b2d54 --- /dev/null +++ b/src/types/providers.ts @@ -0,0 +1,3 @@ +import type { PropsWithChildren } from 'react'; + +export type TProvidersProps = PropsWithChildren;