Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/es lint #26

Merged
merged 25 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3b36663
chore: add linting spesific for ts
JohanHjelsethStorstad Oct 31, 2023
2e963df
chore: install dev dependecies for linting ts
JohanHjelsethStorstad Oct 31, 2023
80e2cd0
chore: fix linting
JohanHjelsethStorstad Oct 31, 2023
46d7a0e
chore: add indent rule
JohanHjelsethStorstad Oct 31, 2023
21ed4d0
fix: indent errors
JohanHjelsethStorstad Oct 31, 2023
44e4269
chore: auto fix last indent errors
JohanHjelsethStorstad Oct 31, 2023
51dfe06
chore: add more eslint opions
JohanHjelsethStorstad Oct 31, 2023
de91a42
fix: newLine errors at end of files
JohanHjelsethStorstad Oct 31, 2023
6b61838
chore: add more elint-rules
JohanHjelsethStorstad Oct 31, 2023
be20f6a
fix: wrong es-lint rule name
JohanHjelsethStorstad Oct 31, 2023
2480ba7
fix: lint error: use template string and not +
JohanHjelsethStorstad Oct 31, 2023
31a8f11
chore: add more eslint-rules
JohanHjelsethStorstad Oct 31, 2023
cdd4095
fix: lint: use object shothand: obj = {x}not obj = {x: x}
JohanHjelsethStorstad Oct 31, 2023
e9acf4e
chore: add lint-rules
JohanHjelsethStorstad Oct 31, 2023
8e249d5
fix: linting errors: have to explicitly import React for use of React…
JohanHjelsethStorstad Oct 31, 2023
d424f81
chore: add single quote rule
JohanHjelsethStorstad Oct 31, 2023
5fb1d3b
chore: add jsx quote (double) as well
JohanHjelsethStorstad Oct 31, 2023
bc44403
fix: all quote linting errors
JohanHjelsethStorstad Oct 31, 2023
89d9acb
chore: add a lot of lint-rules
JohanHjelsethStorstad Oct 31, 2023
9989812
fix: linting errors: mostly to do with semicolons and obj spacing
JohanHjelsethStorstad Oct 31, 2023
dabdb71
chore: add final lint rules
JohanHjelsethStorstad Oct 31, 2023
3254ea2
fix: augumentation
JohanHjelsethStorstad Oct 31, 2023
d4ce715
chore: remove uneccisary var rules. We use no-var anyways
JohanHjelsethStorstad Oct 31, 2023
b6d5c87
chore: remove uneccisary var rules. We use no-var anyways
JohanHjelsethStorstad Oct 31, 2023
cded654
fix: fix the last linting errors
JohanHjelsethStorstad Oct 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
495 changes: 494 additions & 1 deletion .eslintrc.json

Large diffs are not rendered by default.

151 changes: 126 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"@types/react": "^18.2.33",
"@types/react-dom": "^18.2.14",
"@types/uuid": "^9.0.6",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"prisma": "^5.4.2",
"typescript": "^5.2.2"
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/(auth)/CsrfToken.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"
'use client'

import { getCsrfToken } from "next-auth/react"
import { getCsrfToken } from 'next-auth/react'

async function CsrfToken() {
// getCsrfToken må kjøres på klientsiden*
Expand All @@ -15,4 +15,4 @@ async function CsrfToken() {
)
}

export default CsrfToken
export default CsrfToken
30 changes: 15 additions & 15 deletions src/app/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import FormInput from '@/components/FormInput/FormInput'
import styles from './page.module.scss'
import magiskHatt from "@/images/magisk_hatt.png"
import magiskHatt from '@/images/magisk_hatt.png'
import Image from 'next/image'
import PrimaryButton from '@/components/PrimaryButton/PrimaryButton'
import CsrfToken from '../CsrfToken'

export default async function LogIn() {
return (
<div className={styles.wrapper}>
<div className={styles.card}>
<form className={styles.form} method="post" action="/api/auth/callback/credentials">
<CsrfToken />
<FormInput name="username" label="E-post"/>
<FormInput name="password" label="Passord" type="password"/>
return (
<div className={styles.wrapper}>
<div className={styles.card}>
<form className={styles.form} method="post" action="/api/auth/callback/credentials">
<CsrfToken />
<FormInput name="username" label="E-post"/>
<FormInput name="password" label="Passord" type="password"/>

<PrimaryButton text="Logg inn"></PrimaryButton>
</form>
<div className={styles.image}>
<Image alt='en kappemann sin hatt' width={200} src={magiskHatt} />
<PrimaryButton text="Logg inn"></PrimaryButton>
</form>
<div className={styles.image}>
<Image alt="en kappemann sin hatt" width={200} src={magiskHatt} />
</div>
</div>
</div>
</div>
)
}
)
}
30 changes: 13 additions & 17 deletions src/app/(auth)/logout/page.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
import { getCsrfToken } from "next-auth/react"

import styles from './page.module.scss'
import magiskHatt from "@/images/magisk_hatt.png"
import magiskHatt from '@/images/magisk_hatt.png'
import Image from 'next/image'
import PrimaryButton from '@/components/PrimaryButton/PrimaryButton'
import CsrfToken from '../CsrfToken'

export default async function LogOut() {
const csrfToken = await getCsrfToken()

return (
<div className={styles.wrapper}>
<div className={styles.card}>
<form className={styles.form} method="post" action="/api/auth/signout">
<CsrfToken />
<PrimaryButton text="Logg ut"></PrimaryButton>
</form>
<div className={styles.image}>
<Image alt='en kappemann sin hatt' width={200} src={magiskHatt} />
return (
<div className={styles.wrapper}>
<div className={styles.card}>
<form className={styles.form} method="post" action="/api/auth/signout">
<CsrfToken />
<PrimaryButton text="Logg ut"></PrimaryButton>
</form>
<div className={styles.image}>
<Image alt="en kappemann sin hatt" width={200} src={magiskHatt} />
</div>
</div>
</div>
</div>
)
}
)
}
Loading