From d4c5ba0139f26c5221b97d8ba3cc45f5e36e45fb Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Fri, 27 Jun 2025 14:42:26 +0200 Subject: [PATCH] fix linting --- frontend/package-lock.json | 10 ++-- frontend/package.json | 3 +- frontend/src/ModalContent.tsx | 3 +- frontend/src/pages/Calendar.tsx | 98 --------------------------------- frontend/src/routes/sidebar.tsx | 4 +- frontend/tsconfig.json | 1 - frontend/vite.config.ts | 6 +- tsconfig.base.json | 3 +- 8 files changed, 18 insertions(+), 110 deletions(-) delete mode 100644 frontend/src/pages/Calendar.tsx diff --git a/frontend/package-lock.json b/frontend/package-lock.json index f43cfd99..f6897356 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -18,7 +18,7 @@ "react-dom": "^18.2.0", "react-rnd": "^10.4.1", "react-router-dom": "^6.23.0", - "utopia-ui": "^3.0.110" + "utopia-ui": "^3.0.111" }, "devDependencies": { "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1", @@ -11438,9 +11438,9 @@ } }, "node_modules/utopia-ui": { - "version": "3.0.110", - "resolved": "https://registry.npmjs.org/utopia-ui/-/utopia-ui-3.0.110.tgz", - "integrity": "sha512-uwcdXSsttQbCJc++ZnPPHoNfxpTiklJLGbFQISbJ27VbXS9yVIBD38En/cTzW1hZUOex2HkxFcKOfIOG8fkhRg==", + "version": "3.0.111", + "resolved": "https://registry.npmjs.org/utopia-ui/-/utopia-ui-3.0.111.tgz", + "integrity": "sha512-bUqgPCWyS3IcyegweXbRLt2SVYM9cWWLvLst9gcEaezfF4Egz4yXOq7mYmjBl+PpCt0d8EY6Tj8VhdfLxg63qg==", "license": "GPL-3.0-only", "dependencies": { "@heroicons/react": "^2.0.17", @@ -11471,7 +11471,7 @@ "react-leaflet-cluster": "^2.1.0", "react-markdown": "^9.0.1", "react-photo-album": "^3.0.2", - "react-router-dom": "^6.16.0", + "react-router-dom": "^6.23.0", "react-toastify": "^9.1.3", "remark-breaks": "^4.0.0", "tiptap-markdown": "^0.8.10", diff --git a/frontend/package.json b/frontend/package.json index ce838625..1f1ca1d3 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -19,7 +19,8 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-rnd": "^10.4.1", - "react-router-dom": "^6.23.0" + "react-router-dom": "^6.23.0", + "utopia-ui": "^3.0.111" }, "devDependencies": { "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1", diff --git a/frontend/src/ModalContent.tsx b/frontend/src/ModalContent.tsx index 547c9f54..61ba2a6e 100644 --- a/frontend/src/ModalContent.tsx +++ b/frontend/src/ModalContent.tsx @@ -7,8 +7,7 @@ import { useEffect, useState } from 'react' import { TextView } from 'utopia-ui' interface ChapterProps { - clickAction1?: () => void - clickAction2?: () => void + clickAction1: () => void map?: any } diff --git a/frontend/src/pages/Calendar.tsx b/frontend/src/pages/Calendar.tsx deleted file mode 100644 index 9d7a30b2..00000000 --- a/frontend/src/pages/Calendar.tsx +++ /dev/null @@ -1,98 +0,0 @@ -/* eslint-disable import/default */ -/* eslint-disable @typescript-eslint/restrict-template-expressions */ -import { ChevronLeftIcon, ChevronRightIcon } from '@heroicons/react/24/outline' -import { - add, - eachDayOfInterval, - endOfMonth, - endOfWeek, - format, - getDay, - isSameMonth, - isToday, - parse, - startOfToday, - startOfWeek, -} from 'date-fns' -import React, { useState } from 'react' -import { MapOverlayPage } from 'utopia-ui' - -export const Calendar = () => { - const today = startOfToday() - const days = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'] - const colStartClasses = [ - '', - 'col-start-2', - 'col-start-3', - 'col-start-4', - 'col-start-5', - 'col-start-6', - 'col-start-7', - ] - - const [currMonth, setCurrMonth] = useState(() => format(today, 'MMM-yyyy')) - const firstDayOfMonth = parse(currMonth, 'MMM-yyyy', new Date()) - - const daysInMonth = eachDayOfInterval({ - start: startOfWeek(firstDayOfMonth), - end: endOfWeek(endOfMonth(firstDayOfMonth)), - }) - - const getPrevMonth = (event: React.MouseEvent) => { - event.preventDefault() - const firstDayOfPrevMonth = add(firstDayOfMonth, { months: -1 }) - setCurrMonth(format(firstDayOfPrevMonth, 'MMM-yyyy')) - } - - const getNextMonth = (event: React.MouseEvent) => { - event.preventDefault() - const firstDayOfNextMonth = add(firstDayOfMonth, { months: 1 }) - setCurrMonth(format(firstDayOfNextMonth, 'MMM-yyyy')) - } - - return ( - -
-

{format(firstDayOfMonth, 'MMMM yyyy')}

-
- - -
-
-
-
- {days.map((day, idx) => { - return ( -
- {capitalizeFirstLetter(day)} -
- ) - })} -
-
- {daysInMonth.map((day, idx) => { - return ( -
-

- {format(day, 'd')} -

-
- ) - })} -
-
- ) -} - -const capitalizeFirstLetter = (string: string) => { - return string -} diff --git a/frontend/src/routes/sidebar.tsx b/frontend/src/routes/sidebar.tsx index 8bc4b09b..66203665 100644 --- a/frontend/src/routes/sidebar.tsx +++ b/frontend/src/routes/sidebar.tsx @@ -1,6 +1,8 @@ import { MapIcon } from '@heroicons/react/24/outline' import { SVG } from 'utopia-ui' +import type { Route } from '#components/AppShell/SideBar' + export const routes = [ { path: '/', @@ -43,7 +45,7 @@ export const getBottomRoutes = (currentUrl: string) => { const url = new URL(currentUrl) const isEmbedded = url.searchParams.get('embedded') === 'true' - const bottomRoutes = [ + const bottomRoutes: Route[] = [ // Other routes can be added here ] diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index fefa4124..5469587c 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -7,7 +7,6 @@ "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", - "noUnusedLocals": true, "noUnusedParameters": true, "noFallthroughCasesInSwitch": true, diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 1c47d087..1cd16ba7 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -23,6 +23,7 @@ export default defineConfig({ tailwindcss(), ], resolve: { + dedupe: ['react', 'react-dom', 'react-router-dom'], alias: { 'utopia-ui': path.resolve(__dirname, '../lib/src'), '#components': path.resolve(__dirname, '../lib/src/Components'), @@ -32,5 +33,8 @@ export default defineConfig({ '#src': path.resolve(__dirname, '../lib/src'), '#root': path.resolve(__dirname, '../lib'), } - } + }, + build: { + sourcemap: true, + }, }); diff --git a/tsconfig.base.json b/tsconfig.base.json index 3ab18921..a2acbf22 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -6,6 +6,7 @@ "moduleResolution": "Node", "jsx": "react-jsx", "esModuleInterop": true, - "skipLibCheck": true + "skipLibCheck": true, + "strictNullChecks": true, } } \ No newline at end of file