diff --git a/.github/workflows/firebase-hosting-merge.yml b/.github/workflows/firebase-hosting-merge.yml
index 2043638..d3df190 100644
--- a/.github/workflows/firebase-hosting-merge.yml
+++ b/.github/workflows/firebase-hosting-merge.yml
@@ -2,7 +2,7 @@
# https://github.com/firebase/firebase-tools
name: Deploy to Firebase Hosting on merge
-'on':
+"on":
push:
branches:
- main
@@ -14,7 +14,7 @@ jobs:
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
- repoToken: '${{ secrets.GITHUB_TOKEN }}'
- firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_JMLINDSETH_577D3 }}'
+ repoToken: "${{ secrets.GITHUB_TOKEN }}"
+ firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_JMLINDSETH_577D3 }}"
channelId: live
projectId: jmlindseth-577d3
diff --git a/.github/workflows/firebase-hosting-pull-request.yml b/.github/workflows/firebase-hosting-pull-request.yml
index 638c6e3..b4cb672 100644
--- a/.github/workflows/firebase-hosting-pull-request.yml
+++ b/.github/workflows/firebase-hosting-pull-request.yml
@@ -2,16 +2,16 @@
# https://github.com/firebase/firebase-tools
name: Deploy to Firebase Hosting on PR
-'on': pull_request
+"on": pull_request
jobs:
build_and_preview:
- if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
+ if: "${{ github.event.pull_request.head.repo.full_name == github.repository }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
- repoToken: '${{ secrets.GITHUB_TOKEN }}'
- firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_JMLINDSETH_577D3 }}'
+ repoToken: "${{ secrets.GITHUB_TOKEN }}"
+ firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_JMLINDSETH_577D3 }}"
projectId: jmlindseth-577d3
diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml
index b15057e..dff7bcc 100644
--- a/.github/workflows/prettier.yml
+++ b/.github/workflows/prettier.yml
@@ -2,7 +2,7 @@
# https://github.com/firebase/firebase-tools
name: Run Prettier
-'on': push
+"on": push
jobs:
build_and_deploy:
runs-on: ubuntu-latest
diff --git a/firebase.json b/firebase.json
index 6a27028..04d84cf 100644
--- a/firebase.json
+++ b/firebase.json
@@ -7,10 +7,6 @@
"destination": "/index.html"
}
],
- "ignore": [
- "firebase.json",
- "**/.*",
- "**/node_modules/**"
- ]
+ "ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
}
}
diff --git a/index.html b/index.html
index 4187c8f..5968894 100644
--- a/index.html
+++ b/index.html
@@ -1,4 +1,4 @@
-
+
diff --git a/package-lock.json b/package-lock.json
index 67bdd9b..bde17ac 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -41,7 +41,7 @@
"eslint-config-prettier": "8.1.0",
"eslint-plugin-react": "7.23.2",
"jsdom": "22.1.0",
- "prettier": "2.2.1",
+ "prettier": "3.0.3",
"vitest": "0.34.6"
}
},
@@ -5940,15 +5940,18 @@
}
},
"node_modules/prettier": {
- "version": "2.2.1",
- "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz",
- "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==",
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz",
+ "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==",
"dev": true,
"bin": {
- "prettier": "bin-prettier.js"
+ "prettier": "bin/prettier.cjs"
},
"engines": {
- "node": ">=10.13.0"
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/pretty-format": {
diff --git a/package.json b/package.json
index 27524c9..bad8972 100644
--- a/package.json
+++ b/package.json
@@ -61,7 +61,7 @@
"eslint-config-prettier": "8.1.0",
"eslint-plugin-react": "7.23.2",
"jsdom": "22.1.0",
- "prettier": "2.2.1",
+ "prettier": "3.0.3",
"vitest": "0.34.6"
}
}
diff --git a/src/@types/vite-env.d.ts b/src/@types/vite-env.d.ts
index 151aa68..11f02fe 100644
--- a/src/@types/vite-env.d.ts
+++ b/src/@types/vite-env.d.ts
@@ -1 +1 @@
-///
\ No newline at end of file
+///
diff --git a/src/components/Codebox/Codebox.tsx b/src/components/Codebox/Codebox.tsx
index 5280f6c..ddc5c9e 100644
--- a/src/components/Codebox/Codebox.tsx
+++ b/src/components/Codebox/Codebox.tsx
@@ -35,7 +35,7 @@ const CodeArea = styled(CodeMirror)`
const Codebox = () => {
const [activeCode, setActiveCode]: [string, (arg: string) => void] = useState(
- 'Val myString = "Hello World!"'
+ 'Val myString = "Hello World!"',
);
const changeSize = (chosenElement: Option) => {
diff --git a/src/components/Miscellaneous/File.tsx b/src/components/Miscellaneous/File.tsx
index 891e36d..d762ab7 100644
--- a/src/components/Miscellaneous/File.tsx
+++ b/src/components/Miscellaneous/File.tsx
@@ -25,7 +25,7 @@ const Button = styled.button`
const getFileAsString = (
path: string,
- setFileString: (newFileString: string) => void
+ setFileString: (newFileString: string) => void,
) => {
fetch(path)
.then((response) => response.text())
diff --git a/src/components/Miscellaneous/Miscellaneous.tsx b/src/components/Miscellaneous/Miscellaneous.tsx
index 5058a97..3e53694 100644
--- a/src/components/Miscellaneous/Miscellaneous.tsx
+++ b/src/components/Miscellaneous/Miscellaneous.tsx
@@ -3,10 +3,8 @@ import Overview from "./Overview";
import File from "./File";
const Miscellaneous = () => {
- const [filePath, setFilePath]: [
- string,
- (newFilePath: string) => void
- ] = useState("");
+ const [filePath, setFilePath]: [string, (newFilePath: string) => void] =
+ useState("");
const changeFile = (newFile: string) => {
setFilePath(newFile);
diff --git a/src/components/Snake/SnakeGame.tsx b/src/components/Snake/SnakeGame.tsx
index 27dcab9..a1f211b 100644
--- a/src/components/Snake/SnakeGame.tsx
+++ b/src/components/Snake/SnakeGame.tsx
@@ -61,7 +61,7 @@ const SnakeGame = () => {
useEffect(() => {
const element: HTMLCanvasElement = document.getElementById(
- "gc"
+ "gc",
) as HTMLCanvasElement;
const context = element.getContext("2d") as CanvasRenderingContext2D;
document.addEventListener("keydown", keyPush);
@@ -124,7 +124,7 @@ const drawText = (
fillStyle?: string,
textAllign?: CanvasTextAlign,
x?: number,
- y?: number
+ y?: number,
) => {
context.font = font ? font : "30px Arial";
context.fillStyle = fillStyle ? fillStyle : "red";
@@ -154,7 +154,7 @@ const displayGameOverScreen = (context: CanvasRenderingContext2D) => {
"green",
"center",
context.canvas.width / 2,
- context.canvas.height / 2 + 40
+ context.canvas.height / 2 + 40,
);
drawText(
context,
@@ -163,7 +163,7 @@ const displayGameOverScreen = (context: CanvasRenderingContext2D) => {
"white",
"center",
context.canvas.width / 2,
- context.canvas.height / 2 + 70
+ context.canvas.height / 2 + 70,
);
};
@@ -177,7 +177,7 @@ const displayScore = (context: CanvasRenderingContext2D) => {
"green",
"right",
context.canvas.width - 10,
- 20
+ 20,
);
};
@@ -200,7 +200,7 @@ const checkEdges = () => {
};
const regenerateAppleIfOutsidePLayableArea = (
- context: CanvasRenderingContext2D
+ context: CanvasRenderingContext2D,
) => {
if (
gameVariables.appleX > gameVariables.tileCount ||
@@ -215,7 +215,7 @@ const regenerateAppleIfOutsidePLayableArea = (
gameVariables.appleX * gameVariables.tileSize,
gameVariables.appleY * gameVariables.tileSize,
gameVariables.tileSize - 2,
- gameVariables.tileSize - 2
+ gameVariables.tileSize - 2,
);
}
};
@@ -227,7 +227,7 @@ const moveSnake = (context: CanvasRenderingContext2D) => {
gameVariables.trail[i].x * gameVariables.tileSize,
gameVariables.trail[i].y * gameVariables.tileSize,
gameVariables.tileSize - 2,
- gameVariables.tileSize - 2
+ gameVariables.tileSize - 2,
);
if (
gameVariables.trail[i].x === gameVariables.playerX &&
@@ -264,7 +264,7 @@ const eatAndGenerateApple = (context: CanvasRenderingContext2D) => {
gameVariables.appleX * gameVariables.tileSize,
gameVariables.appleY * gameVariables.tileSize,
gameVariables.tileSize - 2,
- gameVariables.tileSize - 2
+ gameVariables.tileSize - 2,
);
};
diff --git a/src/components/frontpage/Buzzword.tsx b/src/components/frontpage/Buzzword.tsx
index 5adb5f8..94e4516 100644
--- a/src/components/frontpage/Buzzword.tsx
+++ b/src/components/frontpage/Buzzword.tsx
@@ -43,7 +43,7 @@ const getNewWord = (activeWord: string) => {
const Buzzword = () => {
const [activeWord, setActiveWord] = useState(
- randomElementFromArray(texts.buzzwords)
+ randomElementFromArray(texts.buzzwords),
);
// Infinite loop of re-rendering because we set state while listening to state changes, probably not a great idea
diff --git a/src/components/frontpage/Intro.tsx b/src/components/frontpage/Intro.tsx
index 378ccc2..d785699 100644
--- a/src/components/frontpage/Intro.tsx
+++ b/src/components/frontpage/Intro.tsx
@@ -7,8 +7,7 @@ const Opening = styled.p`
const texts = {
opening: "Velkommen! Jeg heter John Martin, og jeg skriver kode.",
- body:
- "Her kan jeg finne på å legge til ting jeg lager og/eller finner som kan være interessant å dele.",
+ body: "Her kan jeg finne på å legge til ting jeg lager og/eller finner som kan være interessant å dele.",
};
const Intro = () => {
diff --git a/src/components/frontpage/Quote.tsx b/src/components/frontpage/Quote.tsx
index 987d477..2c79e5a 100644
--- a/src/components/frontpage/Quote.tsx
+++ b/src/components/frontpage/Quote.tsx
@@ -32,10 +32,8 @@ const QuoteBox = styled.div`
`;
const Quote = () => {
- const [quotes, setQuotes]: [
- QuoteType[],
- (quotes: QuoteType[]) => void
- ] = useState(defaultQuotes);
+ const [quotes, setQuotes]: [QuoteType[], (quotes: QuoteType[]) => void] =
+ useState(defaultQuotes);
const quoteUrl = "https://type.fit/api/quotes";
useEffect(() => {
diff --git a/src/index.tsx b/src/index.tsx
index 4de8d8b..20212c4 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -7,5 +7,5 @@ ReactDOM.render(
,
- document.getElementById("root")
+ document.getElementById("root"),
);
diff --git a/tsconfig.json b/tsconfig.json
index 2e90b63..2fb61db 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -18,4 +18,4 @@
"types": ["vite/client", "vite-plugin-svgr/client"]
},
"include": ["src"]
-}
\ No newline at end of file
+}
diff --git a/vite.config.ts b/vite.config.ts
index a3c32d0..85b8394 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,21 +1,21 @@
-import { defineConfig } from 'vitest/config'
-import react from '@vitejs/plugin-react-swc'
+import { defineConfig } from "vitest/config";
+import react from "@vitejs/plugin-react-swc";
// https://vitejs.dev/config/
export default defineConfig({
- base: '/',
+ base: "/",
plugins: [react()],
- assetsInclude: ['src/**/*.md'],
+ assetsInclude: ["src/**/*.md"],
test: {
globals: true,
- environment: 'jsdom',
- setupFiles: './src/setupTests.ts',
+ environment: "jsdom",
+ setupFiles: "./src/setupTests.ts",
css: true,
- reporters: ['verbose'],
+ reporters: ["verbose"],
coverage: {
- reporter: ['text', 'json', 'html'],
- include: ['src/**/*'],
+ reporter: ["text", "json", "html"],
+ include: ["src/**/*"],
exclude: [],
- }
+ },
},
-})
\ No newline at end of file
+});