Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
chore(deps): bump
Browse files Browse the repository at this point in the history
Also switch @types/node to @types/bun
Fix new lint errors.
  • Loading branch information
lishaduck committed Jan 10, 2024
1 parent e8dd5a3 commit d163ede
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 14 deletions.
Binary file modified bun.lockb
Binary file not shown.
7 changes: 5 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ export default defineFlatConfig([
"no-console": "warn",
"no-negated-condition": "off",
"unicorn/no-negated-condition": "error",
"@typescript-eslint/ban-ts-comment": "error",
"import/no-unresolved": [2, { ignore: ["^virtual:pwa-register$"] }],
"@typescript-eslint/ban-ts-comment": [
"error",
{ "ts-expect-error": true, "ts-check": false },
],
"import/no-unresolved": [2, { ignore: ["^virtual:"] }],
},
},
]);
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@
"zod-validation-error": "^2.1.0"
},
"devDependencies": {
"@eslint-types/typescript-eslint": "^6.12.0",
"@eslint-types/unicorn": "^49.0.0",
"@types/eslint": "^8.56.0",
"@eslint-types/typescript-eslint": "^6.18.1",
"@eslint-types/unicorn": "^50.0.1",
"@types/eslint": "^8.56.1",
"@types/jquery": "^3.5.29",
"@types/node": "^20.10.5",
"@types/bun": "^1.0.1",
"@types/pathfinding": "^0.0.9",
"browserslist": "^4.22.2",
"browserslist-to-esbuild": "^1.2.0",
"browserslist-to-esbuild": "^2.1.1",
"eslint": "^8.56.0",
"eslint-config-sheriff": "^17.1.0",
"eslint-define-config": "^2.0.0",
"eslint-config-sheriff": "^18.1.0",
"eslint-define-config": "^2.1.0",
"lightningcss": "^1.22.1",
"prettier": "^3.1.1",
"turbo": "^1.11.2",
"turbo": "^1.11.3",
"typescript": "^5.3.3",
"vite": "^5.0.10",
"vite": "^5.0.11",
"vite-plugin-pwa": "^0.17.4",
"vite-plugin-webfont-dl": "^3.9.1"
},
Expand All @@ -69,7 +69,6 @@
},
"packageManager": "[email protected]",
"browserslist": [
"defaults and fully supports es6-module",
">= 0.25%"
"defaults and fully supports es6-module"
]
}
1 change: 1 addition & 0 deletions src/data/data-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const stairListSchema = z.record(
} catch {
return false;
}

return true;
}),
coordsSchema,
Expand Down
17 changes: 17 additions & 0 deletions src/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const updateSW = registerSW({
}, intervalMS);
},
});

await updateSW(true);

const storage: Storage = createStorage({
Expand Down Expand Up @@ -152,6 +153,7 @@ function createProfile(profNum: number): void {
prof = profNum;
const tempElementId = `tempProf${prof}`;
const tempElementIdNext = `tempProf${profNum + 1}`;

// Creates html elements in the courses class.
document.getElementById(tempElementId)!.innerHTML = `<div
class="prof txtbox w3-animate-right"
Expand Down Expand Up @@ -188,6 +190,7 @@ function createCourse(num: number, profNum: number): void {
numNext = num + 1;
const tempElementId = `temp${prof}${num}`;
const tempElementIdNext = `temp${prof}${numNext}`;

// Creates html elements in the courses class.
document.getElementById(tempElementId)!.innerHTML = `<div
id="input-con-div"
Expand Down Expand Up @@ -242,8 +245,10 @@ async function applySavedProfiles(): Promise<void> {
const nameInput = document.getElementById(
`cl${f}${i}txt`,
) as HTMLInputElement;

if (roomInput instanceof HTMLInputElement) {
const parsedRoom = roomSchema.safeParse(profiles[i]?.[f - 1]?.[0]);

if (parsedRoom.success) {
roomInput.value = parsedRoom.data;
} else {
Expand All @@ -260,10 +265,12 @@ async function applySavedProfiles(): Promise<void> {
const lastCourse = document.getElementById(
`passing${lastCourseIndex}${i}`,
);

lastCourse?.classList.replace("display-block", "display-none");
}
} else {
const error = fromZodError(parsedProfiles.error).toString();

document.getElementById(`zod-error`)!.innerHTML = error;
console.error(error);

Expand Down Expand Up @@ -308,6 +315,7 @@ function printGrid(level: Lvl): void {
}

const img = source;

ctx.drawImage(img, 0, 0, size, size);
for (let y = 0; y < currentGrid.length; y++) {
for (let x = 0; x < (currentGrid[y]?.length ?? 0); x++) {
Expand Down Expand Up @@ -445,6 +453,7 @@ function path(
const matrix = new PF.Grid(grid);
const finder = new PF.AStarFinder();
const directions = finder.findPath(x1, y1, x2, y2, matrix);

for (const direction of directions) {
grid[direction[1]!]![direction[0]!] = -4;
}
Expand Down Expand Up @@ -541,6 +550,7 @@ function btmPath(
tempdist1 = [];
for (let i = 0; i < 1; i++) {
const newLocal = btmStairs[i.toString()];

tempdist1.push(
Math.abs(x1 - (newLocal?.[0] ?? 0)) +
Math.abs(y1 - (btmStairs[i.toString()]?.[1] ?? 0)),
Expand Down Expand Up @@ -579,6 +589,7 @@ function btmPath(

function clearGrid(): void {
const img = source;

ctx.drawImage(img, 0, 0, size, size);
for (let y = 0; y < gridLvl0.length; y++) {
for (let x = 0; x < (gridLvl0[y]?.length ?? 0); x++) {
Expand Down Expand Up @@ -668,18 +679,22 @@ window.passingTime = passingTime;
*/
async function toggleDarkMode() {
const element = document.body;

element.classList.toggle("darkModebg");
element.classList.toggle("lightModebg");

const c = document.getElementById("c");

c?.classList.toggle("darkMode");
c?.classList.toggle("lightMode");

const c2 = document.getElementById("c2");

c2?.classList.toggle("darkMode");
c2?.classList.toggle("lightMode");

const bg = document.getElementById("bg");

bg?.classList.toggle("darkMode");
bg?.classList.toggle("lightMode");

Expand Down Expand Up @@ -765,6 +780,7 @@ window.addEventListener("keydown", onKeyDown);

function downloadImg(element: HTMLAnchorElement) {
const image = canvas.toDataURL("image/jpg");

element.href = image;
}
window.downloadImg = downloadImg;
Expand All @@ -782,6 +798,7 @@ $(($) => {

// Store hash
const hash = this.hash;

// Prevent default anchor click behavior
event.preventDefault();

Expand Down
2 changes: 1 addition & 1 deletion src/sw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { precacheAndRoute } from "workbox-precaching";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error: __WB_MANIFEST is a placeholder that workbox-precaching will inject at compile time.
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, @typescript-eslint/no-unsafe-argument
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
precacheAndRoute(self.__WB_MANIFEST || []);

0 comments on commit d163ede

Please sign in to comment.