Skip to content

Commit

Permalink
Bump and fix Prettier
Browse files Browse the repository at this point in the history
Bump Prettier and fix prettier
  • Loading branch information
JMLindseth committed Oct 9, 2023
1 parent 319bb36 commit 0606199
Show file tree
Hide file tree
Showing 18 changed files with 51 additions and 57 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/firebase-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://github.com/firebase/firebase-tools

name: Deploy to Firebase Hosting on merge
'on':
"on":
push:
branches:
- main
Expand All @@ -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
8 changes: 4 additions & 4 deletions .github/workflows/firebase-hosting-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
"destination": "/index.html"
}
],
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"]
}
}
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
15 changes: 9 additions & 6 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion src/@types/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/// <reference types="vite/client" />
/// <reference types="vite/client" />
2 changes: 1 addition & 1 deletion src/components/Codebox/Codebox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const CodeArea = styled(CodeMirror)<CodeAreaProps>`

const Codebox = () => {
const [activeCode, setActiveCode]: [string, (arg: string) => void] = useState(
'Val myString = "Hello World!"'
'Val myString = "Hello World!"',
);

const changeSize = (chosenElement: Option) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Miscellaneous/File.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
6 changes: 2 additions & 4 deletions src/components/Miscellaneous/Miscellaneous.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
18 changes: 9 additions & 9 deletions src/components/Snake/SnakeGame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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,
Expand All @@ -163,7 +163,7 @@ const displayGameOverScreen = (context: CanvasRenderingContext2D) => {
"white",
"center",
context.canvas.width / 2,
context.canvas.height / 2 + 70
context.canvas.height / 2 + 70,
);
};

Expand All @@ -177,7 +177,7 @@ const displayScore = (context: CanvasRenderingContext2D) => {
"green",
"right",
context.canvas.width - 10,
20
20,
);
};

Expand All @@ -200,7 +200,7 @@ const checkEdges = () => {
};

const regenerateAppleIfOutsidePLayableArea = (
context: CanvasRenderingContext2D
context: CanvasRenderingContext2D,
) => {
if (
gameVariables.appleX > gameVariables.tileCount ||
Expand All @@ -215,7 +215,7 @@ const regenerateAppleIfOutsidePLayableArea = (
gameVariables.appleX * gameVariables.tileSize,
gameVariables.appleY * gameVariables.tileSize,
gameVariables.tileSize - 2,
gameVariables.tileSize - 2
gameVariables.tileSize - 2,
);
}
};
Expand All @@ -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 &&
Expand Down Expand Up @@ -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,
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/frontpage/Buzzword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/components/frontpage/Intro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down
6 changes: 2 additions & 4 deletions src/components/frontpage/Quote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ ReactDOM.render(
<React.StrictMode>
<AppRouter />
</React.StrictMode>,
document.getElementById("root")
document.getElementById("root"),
);
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"types": ["vite/client", "vite-plugin-svgr/client"]
},
"include": ["src"]
}
}
22 changes: 11 additions & 11 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -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: [],
}
},
},
})
});

0 comments on commit 0606199

Please sign in to comment.