Skip to content

Commit

Permalink
chore: fix example linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-jonas committed Nov 15, 2024
1 parent 59d1ee5 commit a3d216f
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 12 deletions.
10 changes: 9 additions & 1 deletion examples/nextjs-app-router/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
{
"extends": ["next/core-web-vitals", "next/typescript"]
"extends": ["next/core-web-vitals", "next/typescript"],
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"parserOptions": {
"project": ["./examples/nextjs-app-router/tsconfig.json"]
}
}
]
}
3 changes: 1 addition & 2 deletions examples/nextjs-app-router/app/auth/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// SPDX-License-Identifier: Apache-2.0

import { Login } from "@ory/elements-react/theme"
import { getLoginFlow, OryPageParams } from "@ory/nextjs/app"
import { enhanceConfig } from "@ory/nextjs"
import { getLoginFlow, OryPageParams } from "@ory/nextjs/app"

import config from "@/ory.config"
import CustomCardHeader from "@/components/custom-card-header"

export default async function LoginPage(props: OryPageParams) {
const flow = await getLoginFlow(props.searchParams)
Expand Down
4 changes: 2 additions & 2 deletions examples/nextjs-app-router/app/auth/recovery/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// SPDX-License-Identifier: Apache-2.0

import { Recovery } from "@ory/elements-react/theme"
import { getRecoveryFlow, OryPageParams } from "@ory/nextjs/app"
import { enhanceConfig } from "@ory/nextjs"
import { getRecoveryFlow, OryPageParams } from "@ory/nextjs/app"

import config from "@/ory.config"
import CustomCardHeader from "@/components/custom-card-header"
import config from "@/ory.config"

export default async function RecoveryPage(props: OryPageParams) {
const flow = await getRecoveryFlow(props.searchParams)
Expand Down
3 changes: 1 addition & 2 deletions examples/nextjs-app-router/app/auth/registration/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
// SPDX-License-Identifier: Apache-2.0

import { Registration } from "@ory/elements-react/theme"
import { getRegistrationFlow, OryPageParams } from "@ory/nextjs/app"
import { enhanceConfig } from "@ory/nextjs"
import { getRegistrationFlow, OryPageParams } from "@ory/nextjs/app"

import config from "@/ory.config"
import CustomCardHeader from "@/components/custom-card-header"

export default async function RegistrationPage(props: OryPageParams) {
const flow = await getRegistrationFlow(props.searchParams)
Expand Down
4 changes: 2 additions & 2 deletions examples/nextjs-app-router/app/auth/verification/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// SPDX-License-Identifier: Apache-2.0

import { Verification } from "@ory/elements-react/theme"
import { getVerificationFlow, OryPageParams } from "@ory/nextjs/app"
import { enhanceConfig } from "@ory/nextjs"
import { getVerificationFlow, OryPageParams } from "@ory/nextjs/app"

import config from "@/ory.config"
import CustomCardHeader from "@/components/custom-card-header"
import config from "@/ory.config"

export default async function VerificationPage(props: OryPageParams) {
const flow = await getVerificationFlow(props.searchParams)
Expand Down
3 changes: 2 additions & 1 deletion examples/nextjs-app-router/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
// SPDX-License-Identifier: Apache-2.0

"use client"
import Link from "next/link"
import { useSession } from "@ory/elements-react/client"
import Link from "next/link"

export default function RootLayout() {
const { session } = useSession()
if (session) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
return "Hello: " + session.identity?.traits.email
}
return (
Expand Down
10 changes: 9 additions & 1 deletion examples/nextjs-pages-router/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
{
"extends": ["next/core-web-vitals", "next/typescript"]
"extends": ["next/core-web-vitals", "next/typescript"],
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"parserOptions": {
"project": ["./examples/nextjs-pages-router/tsconfig.json"]
}
}
]
}
2 changes: 1 addition & 1 deletion examples/nextjs-pages-router/pages/api/hello.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest, NextApiResponse } from "next"

type Data = {
interface Data {
name: string
}

Expand Down
1 change: 1 addition & 0 deletions examples/nextjs-pages-router/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useSession } from "@ory/elements-react/client"
export default function Home() {
const { session } = useSession()
if (session) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
return "Hello: " + session.identity?.traits.email
}
return (
Expand Down
9 changes: 9 additions & 0 deletions packages/nextjs/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
"options": {
"cwd": "packages/nextjs"
}
},
"test": {
"executor": "@nx/jest:jest",
"dependsOn": ["build"],
"options": {
"jestConfig": "packages/nextjs/jest.config.ts",
"coverage": true,
"coverageReporters": ["text", "cobertura"]
}
}
}
}

0 comments on commit a3d216f

Please sign in to comment.