Skip to content

Commit f64d9d3

Browse files
committed
Fix the lint error
1 parent 8edfa73 commit f64d9d3

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ jobs:
166166
167167
- name: Build (example/app)
168168
working-directory: example/app
169-
run: bun run --bun lint && bun run --bun build
169+
run: bun run lint && bun run --bun build
170170

171171
- name: deploy (example) upload next.js app
172172
working-directory: example/cdk

example/app/src/hooks/useAuth.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useState } from 'react';
1+
import { useEffect, useMemo, useState } from 'react';
22
import { Buffer } from 'buffer';
33

44
const endpoint = process.env.NEXT_PUBLIC_COGNITO_ENDPOINT;
@@ -25,7 +25,7 @@ const useAuth = () => {
2525
const [token, setToken] = useState<AccessToken>();
2626

2727
const location =
28-
typeof window !== 'undefined' ? new URL(window.location.href) : undefined;
28+
useMemo(() =>typeof window !== 'undefined' ? new URL(window.location.href) : undefined, []);
2929
const params = location?.searchParams;
3030
const code = params?.has('code') ? params.get('code') : undefined;
3131

@@ -67,7 +67,7 @@ const useAuth = () => {
6767
}
6868
};
6969
fetchToken();
70-
}, [code]);
70+
}, [location, code]);
7171

7272
return { code, token };
7373
};

example/app/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
]
2727
},
2828
"include": [
29-
"next-env.d.ts",
3029
"**/*.ts",
31-
"**/*.tsx"
30+
"**/*.tsx",
31+
"next-env.d.ts",
32+
".next/types/**/*.ts"
3233
],
3334
"exclude": [
3435
"node_modules",

0 commit comments

Comments
 (0)