diff --git a/packages/frontend/package.json b/packages/frontend/package.json index d420d63d..16b5ecf2 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -9,7 +9,7 @@ "debug": "vite --mode debug", "dev": "vite", "build": "tsc && vite build --emptyOutDir", - "lint": "npx eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", + "lint": "npx eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix", "start": "serve -s dist", "loadTranslationTypes": "i18next-resources-for-ts interface -i ./src/public/locales/en -o ./src/@types/resources.d.ts" }, @@ -44,10 +44,10 @@ "@types/react": "^18.2.56", "@types/react-dom": "^18.2.19", "@vitejs/plugin-react": "^4.2.1", + "vite": "^5.1.4", "i18next-resources-for-ts": "^1.5.0", "locize-cli": "^8.0.0", "serve": "^14.2.1", - "typescript": "^5.2.2", - "vite": "^5.1.4" + "typescript": "^5.2.2" } } diff --git a/packages/frontend/src/@types/i18n.d.ts b/packages/frontend/src/@types/i18n.d.ts index cf5d2d9a..3b93435f 100644 --- a/packages/frontend/src/@types/i18n.d.ts +++ b/packages/frontend/src/@types/i18n.d.ts @@ -1,4 +1,4 @@ -import Resources from "./resources"; +import type Resources from "./resources"; declare module "i18next" { interface CustomTypeOptions { diff --git a/packages/frontend/src/ReactApp.tsx b/packages/frontend/src/ReactApp.tsx index e79c9c8d..480f7c1b 100644 --- a/packages/frontend/src/ReactApp.tsx +++ b/packages/frontend/src/ReactApp.tsx @@ -1,14 +1,18 @@ -import React, { ReactNode } from "react"; +import type { ReactNode } from "react"; +import React from "react"; import ReactDOM from "react-dom/client"; import { type Signal, signal } from "@preact/signals-react"; -import { Outlet, RouteObject, RouterProvider, createBrowserRouter } from "react-router-dom"; +import type { RouteObject} from "react-router-dom"; +import { Outlet, RouterProvider, createBrowserRouter } from "react-router-dom"; import { CssBaseline } from "@mui/material"; -import { NavigationRoutes } from "@org/frontend/config/NavigationRoute.config"; -import { MuiThemeConfig, MuiThemeValue, createTheme } from "@org/frontend/config/MuiTheme.config"; +import type { NavigationRoutes } from "@org/frontend/config/NavigationRoute.config"; +import type { MuiThemeConfig, MuiThemeValue} from "@org/frontend/config/MuiTheme.config"; +import { createTheme } from "@org/frontend/config/MuiTheme.config"; import { Layout } from "@org/frontend/components/layout/Layout"; -import { Provider, Providers } from "@org/frontend/components/providers/Providers"; +import type { Provider} from "@org/frontend/components/providers/Providers"; +import { Providers } from "@org/frontend/components/providers/Providers"; import { StylesProvider } from "@org/frontend/components/providers/impl/StylesProvider"; import { ThemeProvider } from "@org/frontend/components/providers/impl/MuiThemeProvider"; import { QueryClientProvider } from "@org/frontend/components/providers/impl/QueryClientProvider"; diff --git a/packages/frontend/src/app/pages/Home/HomePage.tsx b/packages/frontend/src/app/pages/Home/HomePage.tsx index 62ae4e32..b5dd59e6 100644 --- a/packages/frontend/src/app/pages/Home/HomePage.tsx +++ b/packages/frontend/src/app/pages/Home/HomePage.tsx @@ -1,5 +1,6 @@ import { useCallback, useEffect, useState } from "react"; -import { PaginationOptions, TODO, User, type UserPageableResponseDto } from "@org/shared"; +import type { PaginationOptions, TODO, User} from "@org/shared"; +import { type UserPageableResponseDto } from "@org/shared"; import * as icons from "@mui/icons-material"; import * as mui from "@mui/material"; diff --git a/packages/frontend/src/app/pages/Home/UserCreateFormButton.tsx b/packages/frontend/src/app/pages/Home/UserCreateFormButton.tsx index d6306bdc..20638c09 100644 --- a/packages/frontend/src/app/pages/Home/UserCreateFormButton.tsx +++ b/packages/frontend/src/app/pages/Home/UserCreateFormButton.tsx @@ -1,6 +1,6 @@ import { Button, Dialog, DialogContent } from "@mui/material"; import { useState } from "react"; -import { TODO, User } from "@org/shared"; +import type { TODO, User } from "@org/shared"; import { UserForm } from "@org/frontend/app/pages/Home/UserForm"; import { Add } from "@mui/icons-material"; import { apiClient } from "@org/frontend/setup/apiClient.setup"; diff --git a/packages/frontend/src/app/pages/Home/UserForm.tsx b/packages/frontend/src/app/pages/Home/UserForm.tsx index 6f4c2ce0..5482390c 100644 --- a/packages/frontend/src/app/pages/Home/UserForm.tsx +++ b/packages/frontend/src/app/pages/Home/UserForm.tsx @@ -1,6 +1,7 @@ import React from "react"; import { TextField, Button, Box, Autocomplete, MenuItem, Chip } from "@mui/material"; -import { Role, User } from "@org/shared"; +import type { User } from "@org/shared"; +import { Role } from "@org/shared"; export type UserFormProps = { value: User; diff --git a/packages/frontend/src/app/pages/Login/LoginPage.tsx b/packages/frontend/src/app/pages/Login/LoginPage.tsx index df682eb5..56688cc8 100644 --- a/packages/frontend/src/app/pages/Login/LoginPage.tsx +++ b/packages/frontend/src/app/pages/Login/LoginPage.tsx @@ -4,7 +4,8 @@ import * as icons from "@mui/icons-material"; import { Logo } from "@org/frontend/components/semantics"; import { sigUser } from "@org/frontend/signals/sigUser"; import { ObjectId, Role, type TODO } from "@org/shared"; -import { ChangeEvent, MouseEvent, useState } from "react"; +import type { ChangeEvent, MouseEvent} from "react"; +import { useState } from "react"; import { useLocation, useNavigate } from "react-router-dom"; interface State { diff --git a/packages/frontend/src/app/pages/Preferences/PreferencesPage.tsx b/packages/frontend/src/app/pages/Preferences/PreferencesPage.tsx index ef64d74f..9240c094 100644 --- a/packages/frontend/src/app/pages/Preferences/PreferencesPage.tsx +++ b/packages/frontend/src/app/pages/Preferences/PreferencesPage.tsx @@ -1,12 +1,13 @@ -import { +import type { Breakpoint, + SelectChangeEvent} from "@mui/material"; +import { Card, CardContent, FormControl, InputLabel, MenuItem, - Select, - SelectChangeEvent, + Select } from "@mui/material"; import { sigPreferences } from "@org/frontend/signals/sigPreferences"; import { type TODO } from "@org/shared"; diff --git a/packages/frontend/src/app/pages/ProtectedRoute.tsx b/packages/frontend/src/app/pages/ProtectedRoute.tsx index f6ba8507..0f593300 100644 --- a/packages/frontend/src/app/pages/ProtectedRoute.tsx +++ b/packages/frontend/src/app/pages/ProtectedRoute.tsx @@ -1,4 +1,4 @@ -import { PropsWithChildren } from "react"; +import type { PropsWithChildren } from "react"; import { Navigate, useLocation } from "react-router-dom"; import { sigUser } from "@org/frontend/signals/sigUser"; diff --git a/packages/frontend/src/app/routes.tsx b/packages/frontend/src/app/routes.tsx index c99c3df5..45ca290f 100644 --- a/packages/frontend/src/app/routes.tsx +++ b/packages/frontend/src/app/routes.tsx @@ -1,6 +1,6 @@ import * as icons from "@mui/icons-material"; -import { NavigationRoutes } from "@org/frontend/config/NavigationRoute.config"; +import type { NavigationRoutes } from "@org/frontend/config/NavigationRoute.config"; import { HomePage } from "@org/frontend/app/pages/Home"; export const routes: NavigationRoutes = [ diff --git a/packages/frontend/src/app/theme.ts b/packages/frontend/src/app/theme.ts index d87791c2..c29e2093 100644 --- a/packages/frontend/src/app/theme.ts +++ b/packages/frontend/src/app/theme.ts @@ -1,5 +1,5 @@ import { colors as muiColors } from "@mui/material"; -import { MuiThemeConfig } from "@org/frontend/config/MuiTheme.config"; +import type { MuiThemeConfig } from "@org/frontend/config/MuiTheme.config"; export const themeColors = { primary: muiColors.blue["700"], diff --git a/packages/frontend/src/components/inputs/InputIconButtonSelect/InputIconButtonSelect.tsx b/packages/frontend/src/components/inputs/InputIconButtonSelect/InputIconButtonSelect.tsx index 799e9298..f91a0159 100644 --- a/packages/frontend/src/components/inputs/InputIconButtonSelect/InputIconButtonSelect.tsx +++ b/packages/frontend/src/components/inputs/InputIconButtonSelect/InputIconButtonSelect.tsx @@ -1,5 +1,5 @@ import { Box, IconButton, Menu, MenuItem, Tooltip } from "@mui/material"; -import { TODO } from "@org/shared"; +import type { TODO } from "@org/shared"; import { useMemo, useState } from "react"; export type InputIconButtonSelectProps = { diff --git a/packages/frontend/src/components/inputs/InputLocaleSelect/InputLocaleSelect.tsx b/packages/frontend/src/components/inputs/InputLocaleSelect/InputLocaleSelect.tsx index dbe33db4..ceef246f 100644 --- a/packages/frontend/src/components/inputs/InputLocaleSelect/InputLocaleSelect.tsx +++ b/packages/frontend/src/components/inputs/InputLocaleSelect/InputLocaleSelect.tsx @@ -3,7 +3,7 @@ import { Typography } from "@mui/material"; import { useTranslation } from "react-i18next"; import { InputIconButtonSelect } from "@org/frontend/components/inputs/InputIconButtonSelect/InputIconButtonSelect"; import { sigLocale } from "@org/frontend/signals/sigLocale"; -import { Locale } from "@org/frontend/config/i18n.config"; +import type { Locale } from "@org/frontend/config/i18n.config"; function getLocaleNativeName(locale: Locale) { const name: string = new Intl.DisplayNames([locale], { diff --git a/packages/frontend/src/components/inputs/InputRangeBasic/InputRangeBasic.tsx b/packages/frontend/src/components/inputs/InputRangeBasic/InputRangeBasic.tsx index 40a33f80..e1e672b0 100644 --- a/packages/frontend/src/components/inputs/InputRangeBasic/InputRangeBasic.tsx +++ b/packages/frontend/src/components/inputs/InputRangeBasic/InputRangeBasic.tsx @@ -1,5 +1,5 @@ import { Box, TextField } from "@mui/material"; -import { TODO } from "@org/shared"; +import type { TODO } from "@org/shared"; export type InputRangeProps = { value: number; diff --git a/packages/frontend/src/components/layout/Layout.tsx b/packages/frontend/src/components/layout/Layout.tsx index de065f35..31e38189 100644 --- a/packages/frontend/src/components/layout/Layout.tsx +++ b/packages/frontend/src/components/layout/Layout.tsx @@ -1,5 +1,5 @@ import { Box, Container, useMediaQuery } from "@mui/material"; -import { PropsWithChildren } from "react"; +import type { PropsWithChildren } from "react"; import { Sidebar } from "@org/frontend/components/navigation/Sidebar"; import { Footer, Header } from "@org/frontend/components/semantics"; import { HorizontalNavVariant, SidebarNavVariant } from "@org/frontend/components/layout/variants"; diff --git a/packages/frontend/src/components/layout/variants/HorizontalNavVariant.tsx b/packages/frontend/src/components/layout/variants/HorizontalNavVariant.tsx index 296f74dc..82ab4840 100644 --- a/packages/frontend/src/components/layout/variants/HorizontalNavVariant.tsx +++ b/packages/frontend/src/components/layout/variants/HorizontalNavVariant.tsx @@ -1,7 +1,8 @@ import { ChevronRight, ExpandMore } from "@mui/icons-material"; +import type { + Breakpoint} from "@mui/material"; import { Box, - Breakpoint, Container, List, ListItemButton, @@ -9,17 +10,19 @@ import { ListItemText, Stack, } from "@mui/material"; -import { TODO } from "@org/shared"; +import type { TODO } from "@org/shared"; import { Fragment } from "react"; import { useTranslation } from "react-i18next"; import { useNavigate } from "react-router-dom"; +import type { + OriginPosition} from "@org/frontend/components/navigation/ButtonHoverMenu"; import { - ButtonHoverMenu, - OriginPosition, + ButtonHoverMenu } from "@org/frontend/components/navigation/ButtonHoverMenu"; -import { +import type { NavigationRoute, - NavigationRouteSingle, + NavigationRouteSingle} from "@org/frontend/config/NavigationRoute.config"; +import { isAnyRouteActive, } from "@org/frontend/config/NavigationRoute.config"; import { reactServer } from "@org/frontend/setup/reactServer.setup"; diff --git a/packages/frontend/src/components/layout/variants/SidebarNavVariant.tsx b/packages/frontend/src/components/layout/variants/SidebarNavVariant.tsx index 64b144a8..1579f6f7 100644 --- a/packages/frontend/src/components/layout/variants/SidebarNavVariant.tsx +++ b/packages/frontend/src/components/layout/variants/SidebarNavVariant.tsx @@ -1,13 +1,14 @@ import { ExpandLess, ExpandMore } from "@mui/icons-material"; import { Collapse, Divider, List, ListItemButton, ListItemIcon, ListItemText } from "@mui/material"; -import { TODO } from "@org/shared"; +import type { TODO } from "@org/shared"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import { useLocation, useNavigate } from "react-router-dom"; import { Fragment } from "react/jsx-runtime"; -import { +import type { NavigationRoute, - NavigationRouteSingle, + NavigationRouteSingle} from "@org/frontend/config/NavigationRoute.config"; +import { isAnyRouteActive, } from "@org/frontend/config/NavigationRoute.config"; import { reactServer } from "@org/frontend/setup/reactServer.setup"; diff --git a/packages/frontend/src/components/navigation/ButtonHoverMenu/ButtonHoverMenu.tsx b/packages/frontend/src/components/navigation/ButtonHoverMenu/ButtonHoverMenu.tsx index 8d768adc..a8247849 100644 --- a/packages/frontend/src/components/navigation/ButtonHoverMenu/ButtonHoverMenu.tsx +++ b/packages/frontend/src/components/navigation/ButtonHoverMenu/ButtonHoverMenu.tsx @@ -1,7 +1,8 @@ import PopupState, { bindHover, bindPopover } from "material-ui-popup-state"; import HoverPopover from "material-ui-popup-state/HoverPopover"; -import { PopupState as PopupStateProps } from "material-ui-popup-state/hooks"; -import { ReactNode, useId } from "react"; +import type { PopupState as PopupStateProps } from "material-ui-popup-state/hooks"; +import type { ReactNode} from "react"; +import { useId } from "react"; export type OriginPositionX = "left" | "center" | "right"; diff --git a/packages/frontend/src/components/navigation/Sidebar/Sidebar.tsx b/packages/frontend/src/components/navigation/Sidebar/Sidebar.tsx index 00e4457c..237f65a5 100644 --- a/packages/frontend/src/components/navigation/Sidebar/Sidebar.tsx +++ b/packages/frontend/src/components/navigation/Sidebar/Sidebar.tsx @@ -1,5 +1,5 @@ import { SwipeableDrawer, useMediaQuery } from "@mui/material"; -import { ReactNode } from "react"; +import type { ReactNode } from "react"; export type SidebarProps = { width?: number; diff --git a/packages/frontend/src/components/providers/impl/MuiThemeProvider.tsx b/packages/frontend/src/components/providers/impl/MuiThemeProvider.tsx index 51ed0dc3..fed5dded 100644 --- a/packages/frontend/src/components/providers/impl/MuiThemeProvider.tsx +++ b/packages/frontend/src/components/providers/impl/MuiThemeProvider.tsx @@ -1,4 +1,4 @@ -import { PropsWithChildren } from "react"; +import type { PropsWithChildren } from "react"; import { Experimental_CssVarsProvider as MuiThemeProvider } from "@mui/material/styles"; import { reactServer } from "@org/frontend/setup/reactServer.setup"; diff --git a/packages/frontend/src/components/providers/impl/QueryClientProvider.tsx b/packages/frontend/src/components/providers/impl/QueryClientProvider.tsx index 2130c38b..7b90f965 100644 --- a/packages/frontend/src/components/providers/impl/QueryClientProvider.tsx +++ b/packages/frontend/src/components/providers/impl/QueryClientProvider.tsx @@ -2,7 +2,7 @@ import { QueryClient, QueryClientProvider as InternalQueryClientProvider, } from "@tanstack/react-query"; -import { PropsWithChildren } from "react"; +import type { PropsWithChildren } from "react"; const queryClient = new QueryClient(); diff --git a/packages/frontend/src/components/providers/impl/StylesProvider.tsx b/packages/frontend/src/components/providers/impl/StylesProvider.tsx index d37b5aa1..ebf38b01 100644 --- a/packages/frontend/src/components/providers/impl/StylesProvider.tsx +++ b/packages/frontend/src/components/providers/impl/StylesProvider.tsx @@ -1,5 +1,5 @@ import { StylesProvider as InternalStylesProvider } from "@mui/styles"; -import { PropsWithChildren } from "react"; +import type { PropsWithChildren } from "react"; export function StylesProvider({ children }: PropsWithChildren) { return {children}; diff --git a/packages/frontend/src/components/semantics/Datatable/components/DatatableContainer/DatatableContainer.tsx b/packages/frontend/src/components/semantics/Datatable/components/DatatableContainer/DatatableContainer.tsx index ee9ea9fb..0ba27f1c 100644 --- a/packages/frontend/src/components/semantics/Datatable/components/DatatableContainer/DatatableContainer.tsx +++ b/packages/frontend/src/components/semantics/Datatable/components/DatatableContainer/DatatableContainer.tsx @@ -1,6 +1,6 @@ //import { Paper } from "@mui/material"; import { Card } from "@mui/material"; -import { PropsWithChildren } from "react"; +import type { PropsWithChildren } from "react"; export function DatatableContainer({ children }: PropsWithChildren) { //return {children}; diff --git a/packages/frontend/src/components/semantics/Datatable/components/DtSortableCell/DtSortableCell.tsx b/packages/frontend/src/components/semantics/Datatable/components/DtSortableCell/DtSortableCell.tsx index 0a7657e5..2cda4169 100644 --- a/packages/frontend/src/components/semantics/Datatable/components/DtSortableCell/DtSortableCell.tsx +++ b/packages/frontend/src/components/semantics/Datatable/components/DtSortableCell/DtSortableCell.tsx @@ -1,6 +1,7 @@ import { TableCell, Box, TableSortLabel } from "@mui/material"; -import { MouseEvent, useCallback, useState } from "react"; -import { +import type { MouseEvent} from "react"; +import { useCallback, useState } from "react"; +import type { DtBaseColumnAlign, DtBaseColumnRenderHeader, } from "@org/frontend/components/semantics/Datatable/types"; diff --git a/packages/frontend/src/components/semantics/Datatable/impl/ClientDatatable/ClientDatatable.tsx b/packages/frontend/src/components/semantics/Datatable/impl/ClientDatatable/ClientDatatable.tsx index 795418ed..4115d303 100644 --- a/packages/frontend/src/components/semantics/Datatable/impl/ClientDatatable/ClientDatatable.tsx +++ b/packages/frontend/src/components/semantics/Datatable/impl/ClientDatatable/ClientDatatable.tsx @@ -7,14 +7,13 @@ import { TableBody, TablePagination, } from "@mui/material"; -import { TODO } from "@org/shared"; -import { Fragment, MouseEvent, useMemo, useState } from "react"; +import type { TODO } from "@org/shared"; +import type { MouseEvent } from "react"; +import { Fragment, useMemo, useState } from "react"; import { DtSortableCell } from "@org/frontend/components/semantics/Datatable/components/DtSortableCell/DtSortableCell"; -import { - DEFAULT_PAGINATION_OPTIONS, - DtBaseOrder, -} from "@org/frontend/components/semantics/Datatable/types"; -import { ClientDatatableProps } from "@org/frontend/components/semantics/Datatable/impl/ClientDatatable/types"; +import type { DtBaseOrder } from "@org/frontend/components/semantics/Datatable/types"; +import { DEFAULT_PAGINATION_OPTIONS } from "@org/frontend/components/semantics/Datatable/types"; +import type { ClientDatatableProps } from "@org/frontend/components/semantics/Datatable/impl/ClientDatatable/types"; export function ClientDatatable({ data, @@ -49,6 +48,7 @@ export function ClientDatatable({ }); } return localData.slice(page * rowsPerPage, (page + 1) * rowsPerPage); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [data, paginationOptions, disablePagination, sortData]); const onSortColumnClick = (id: string, event: MouseEvent) => { diff --git a/packages/frontend/src/components/semantics/Datatable/impl/ClientDatatable/types.ts b/packages/frontend/src/components/semantics/Datatable/impl/ClientDatatable/types.ts index 60b200bc..6143a89b 100644 --- a/packages/frontend/src/components/semantics/Datatable/impl/ClientDatatable/types.ts +++ b/packages/frontend/src/components/semantics/Datatable/impl/ClientDatatable/types.ts @@ -1,4 +1,4 @@ -import { DtBaseColumn } from "@org/frontend/components/semantics/Datatable/types"; +import type { DtBaseColumn } from "@org/frontend/components/semantics/Datatable/types"; export type DtClientColumnSort = (o1: T, o2: T) => number; diff --git a/packages/frontend/src/components/semantics/Datatable/impl/ServerDatatable/ServerDatatable.tsx b/packages/frontend/src/components/semantics/Datatable/impl/ServerDatatable/ServerDatatable.tsx index 041df36f..bea620b4 100644 --- a/packages/frontend/src/components/semantics/Datatable/impl/ServerDatatable/ServerDatatable.tsx +++ b/packages/frontend/src/components/semantics/Datatable/impl/ServerDatatable/ServerDatatable.tsx @@ -7,10 +7,11 @@ import { TableBody, TablePagination, } from "@mui/material"; -import { TODO } from "@org/shared"; -import { Fragment, MouseEvent, useCallback } from "react"; -import { ServerDatatableProps } from "@org/frontend/components/semantics/Datatable/impl/ServerDatatable/types"; -import { DtBaseSortItem } from "@org/frontend/components/semantics/Datatable/types"; +import type { TODO } from "@org/shared"; +import type { MouseEvent } from "react"; +import { Fragment, useCallback } from "react"; +import type { ServerDatatableProps } from "@org/frontend/components/semantics/Datatable/impl/ServerDatatable/types"; +import type { DtBaseSortItem } from "@org/frontend/components/semantics/Datatable/types"; import { DtSortableCell } from "@org/frontend/components/semantics/Datatable/components/DtSortableCell"; export function ServerDatatable({ @@ -51,6 +52,7 @@ export function ServerDatatable({ } onPaginationOptionsChange({ ...paginationOptions, order: [`${id} desc`] }); }, + // eslint-disable-next-line react-hooks/exhaustive-deps [paginationOptions, sortData], ); diff --git a/packages/frontend/src/components/semantics/Datatable/impl/ServerDatatable/types.ts b/packages/frontend/src/components/semantics/Datatable/impl/ServerDatatable/types.ts index 6615af0a..d3fb857c 100644 --- a/packages/frontend/src/components/semantics/Datatable/impl/ServerDatatable/types.ts +++ b/packages/frontend/src/components/semantics/Datatable/impl/ServerDatatable/types.ts @@ -1,5 +1,5 @@ -import { PaginationOptions } from "@org/shared"; -import { DtBaseColumn } from "@org/frontend/components/semantics/Datatable/types"; +import type { PaginationOptions } from "@org/shared"; +import type { DtBaseColumn } from "@org/frontend/components/semantics/Datatable/types"; export type DtServerColumn = DtBaseColumn & { sort?: string; diff --git a/packages/frontend/src/components/semantics/Datatable/types.ts b/packages/frontend/src/components/semantics/Datatable/types.ts index 110fa6c8..bc725830 100644 --- a/packages/frontend/src/components/semantics/Datatable/types.ts +++ b/packages/frontend/src/components/semantics/Datatable/types.ts @@ -1,5 +1,5 @@ -import { PaginationOptions } from "@org/shared"; -import { ReactNode } from "react"; +import type { PaginationOptions } from "@org/shared"; +import type { ReactNode } from "react"; export type DtBaseColumnAlign = "left" | "center" | "right"; export type DtBaseColumnRenderHeader = () => ReactNode; diff --git a/packages/frontend/src/components/semantics/Footer/Footer.tsx b/packages/frontend/src/components/semantics/Footer/Footer.tsx index 0c847e3c..e7e604ac 100644 --- a/packages/frontend/src/components/semantics/Footer/Footer.tsx +++ b/packages/frontend/src/components/semantics/Footer/Footer.tsx @@ -1,5 +1,6 @@ -import { Box, Breakpoint, Container, Link, Typography } from "@mui/material"; -import { MuiSxProps } from "@org/frontend/components/semantics/Header"; +import type { Breakpoint} from "@mui/material"; +import { Box, Container, Link, Typography } from "@mui/material"; +import type { MuiSxProps } from "@org/frontend/components/semantics/Header"; export type FooterProps = { backgroundColor?: string; diff --git a/packages/frontend/src/components/semantics/Header/Header.tsx b/packages/frontend/src/components/semantics/Header/Header.tsx index 43ac2da8..bbe7ef1c 100644 --- a/packages/frontend/src/components/semantics/Header/Header.tsx +++ b/packages/frontend/src/components/semantics/Header/Header.tsx @@ -1,13 +1,14 @@ import { Menu } from "@mui/icons-material"; +import type { + Breakpoint, + SxProps, + Theme} from "@mui/material"; import { Box, Breadcrumbs, - Breakpoint, Container, IconButton, Link, - SxProps, - Theme, useMediaQuery, } from "@mui/material"; import { @@ -16,7 +17,7 @@ import { InputThemeToggle, } from "@org/frontend/components/inputs"; import { useMatches } from "react-router-dom"; -import { TODO } from "@org/shared"; +import type { TODO } from "@org/shared"; import { sigSidebarOpen } from "@org/frontend/signals/sigSidebarOpen"; export type MuiSxProps = SxProps; diff --git a/packages/frontend/src/config/MuiTheme.config.ts b/packages/frontend/src/config/MuiTheme.config.ts index 19e41002..3da73ffe 100644 --- a/packages/frontend/src/config/MuiTheme.config.ts +++ b/packages/frontend/src/config/MuiTheme.config.ts @@ -1,4 +1,4 @@ -import { +import type { CssVarsTheme, PaletteMode, PaletteOptions, @@ -6,13 +6,14 @@ import { TypeBackground, PaletteColorOptions, } from "@mui/material"; +import type { + Theme} from "@mui/material/styles"; import { - Theme, experimental_extendTheme as extendTheme, createTheme as muiCreateTheme, } from "@mui/material/styles"; import { darken, lighten, alpha } from "@mui/material/styles"; -import { ColorPartial, TypeText } from "@mui/material/styles/createPalette"; +import type { ColorPartial, TypeText } from "@mui/material/styles/createPalette"; export type MuiThemeValue = Omit & CssVarsTheme; diff --git a/packages/frontend/src/config/NavigationRoute.config.ts b/packages/frontend/src/config/NavigationRoute.config.ts index 2eb74e26..dc410b46 100644 --- a/packages/frontend/src/config/NavigationRoute.config.ts +++ b/packages/frontend/src/config/NavigationRoute.config.ts @@ -1,6 +1,6 @@ -import { Role, User } from "@org/shared"; -import { ReactNode } from "react"; -import { RouteObject } from "react-router-dom"; +import type { Role, User } from "@org/shared"; +import type { ReactNode } from "react"; +import type { RouteObject } from "react-router-dom"; import { type I18nTranslateFn } from "@org/frontend/config/i18n.config"; export type NavigationRouteAnchorSecure = Role[] | ((user: User) => boolean | Role[]); diff --git a/packages/frontend/src/config/UiPreferences.config.ts b/packages/frontend/src/config/UiPreferences.config.ts index 1d7ac4b9..d7bb3eba 100644 --- a/packages/frontend/src/config/UiPreferences.config.ts +++ b/packages/frontend/src/config/UiPreferences.config.ts @@ -1,4 +1,4 @@ -import { Breakpoint } from "@mui/material"; +import type { Breakpoint } from "@mui/material"; export type UiPreferences = { containerWidth: Breakpoint | false; diff --git a/packages/frontend/src/config/i18n.config.ts b/packages/frontend/src/config/i18n.config.ts index f984eec4..fa904d61 100644 --- a/packages/frontend/src/config/i18n.config.ts +++ b/packages/frontend/src/config/i18n.config.ts @@ -1,4 +1,4 @@ -import { TFunction } from "i18next"; +import type { TFunction } from "i18next"; export type I18nTranslateFn = TFunction<"translation", undefined>; diff --git a/packages/frontend/src/signals/sigLayout.ts b/packages/frontend/src/signals/sigLayout.ts index 23a4ea17..05b612fd 100644 --- a/packages/frontend/src/signals/sigLayout.ts +++ b/packages/frontend/src/signals/sigLayout.ts @@ -1,5 +1,5 @@ import { effect, signal } from "@preact/signals-react"; -import { LayoutVariant } from "@org/frontend/components/layout"; +import { type LayoutVariant } from "@org/frontend/components/layout"; export const sigLayout = signal( (["HorizontalLayout", "SidebarLayout"].find(value => value === localStorage.getItem("layout")) ?? diff --git a/packages/frontend/src/signals/sigLocale.ts b/packages/frontend/src/signals/sigLocale.ts index a8090787..970728fa 100644 --- a/packages/frontend/src/signals/sigLocale.ts +++ b/packages/frontend/src/signals/sigLocale.ts @@ -1,12 +1,12 @@ import { effect, signal } from "@preact/signals-react"; import { i18n } from "@org/frontend/setup/i18n.setup"; -import { Locale } from "@org/frontend/config/i18n.config"; +import { type Locale } from "@org/frontend/config/i18n.config"; export const sigLocale = signal( (["en", "hr"].find(value => value === localStorage.getItem("locale")) ?? "en") as Locale, ); -effect(async () => { - await i18n.changeLanguage(sigLocale.value); - localStorage.setItem("locale", sigLocale.value); +effect(() => { + const value = sigLocale.value; + i18n.changeLanguage(value).then(() => localStorage.setItem("locale", value)); }); diff --git a/packages/frontend/src/signals/sigPreferences.ts b/packages/frontend/src/signals/sigPreferences.ts index 5c15b373..3be27ec3 100644 --- a/packages/frontend/src/signals/sigPreferences.ts +++ b/packages/frontend/src/signals/sigPreferences.ts @@ -1,5 +1,5 @@ import { effect, signal } from "@preact/signals-react"; -import { UiPreferences } from "@org/frontend/config/UiPreferences.config"; +import { type UiPreferences } from "@org/frontend/config/UiPreferences.config"; const DEFAULT_PREFERENCES: UiPreferences = { containerWidth: "xl", diff --git a/packages/frontend/src/signals/sigUser.ts b/packages/frontend/src/signals/sigUser.ts index 1e11e6fb..8ebcdc1a 100644 --- a/packages/frontend/src/signals/sigUser.ts +++ b/packages/frontend/src/signals/sigUser.ts @@ -1,4 +1,4 @@ -import { User } from "@org/shared"; +import { type User } from "@org/shared"; import { signal } from "@preact/signals-react"; export const sigUser = signal(null);