Skip to content

Commit 562bcf2

Browse files
feat(ts): preliminary TypeScript support (#1223)
* chore: replace standard with ts-standard * feat(ts): add some initial types * feat(ts): import and use types * chore: allow global fetch through package.json * chore: upgrade lint scripts to use ts-standard * chore: run linter on dev app * chore(ts): satisfy dev Next.js server for TS * fix: add eslint as dev dependency * fix(lint): ignore next-env.d.ts from linting * feat(ts): improve cookies options types * fix: run linter with fix
1 parent 690f81e commit 562bcf2

32 files changed

+905
-271
lines changed

components/access-denied.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@ export default function AccessDenied () {
55
<>
66
<h1>Access Denied</h1>
77
<p>
8-
<a href="/api/auth/signin"
9-
onClick={(e) => {
10-
e.preventDefault()
11-
signIn()
12-
}}>You must be signed in to view this page</a>
8+
<a
9+
href='/api/auth/signin'
10+
onClick={(e) => {
11+
e.preventDefault()
12+
signIn()
13+
}}
14+
>You must be signed in to view this page
15+
</a>
1316
</p>
1417
</>
1518
)

components/header.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Link from 'next/link'
22
import { signIn, signOut, useSession } from 'next-auth/client'
3-
import * as client from 'next-auth/client'
43
import styles from './header.module.css'
54

65
// The approach used in this component shows how to built a sign in and sign out
@@ -26,7 +25,7 @@ export default function Header () {
2625
You are not signed in
2726
</span>
2827
<a
29-
href="/api/auth/signin"
28+
href='/api/auth/signin'
3029
className={styles.buttonPrimary}
3130
onClick={(e) => {
3231
e.preventDefault()
@@ -51,7 +50,7 @@ export default function Header () {
5150
<strong>{session.user.email || session.user.name}</strong>
5251
</span>
5352
<a
54-
href="/api/auth/signout"
53+
href='/api/auth/signout'
5554
className={styles.button}
5655
onClick={(e) => {
5756
e.preventDefault()

jsconfig.json

-12
This file was deleted.

next-env.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/types/global" />

0 commit comments

Comments
 (0)