diff --git a/.eslintrc b/.eslintrc index 75566c20269d9a1022db75dbde7fb13f087a3cf7..fac3cdea6ec1b0b17da7bd46c9c879199bbc3678 100644 --- a/.eslintrc +++ b/.eslintrc @@ -13,7 +13,9 @@ "plugin:react/jsx-runtime", "plugin:react-hooks/recommended", "plugin:@typescript-eslint/recommended", - "plugin:prettier/recommended" + "plugin:prettier/recommended", + "plugin:import/typescript", + "plugin:import/recommended" ], "settings": { "react": { @@ -38,8 +40,31 @@ }, "rules": { "react/prop-types": "off", - "react-refresh/only-export-components": "warn", + "import/order": [ + "error", + { + "groups": [ + "external", + "index", + "sibling", + "parent", + "internal", + "builtin", + "object", + "type" + ] + } + ], "no-duplicate-imports": "error", + "import/export": "error", + "import/default": "error", + "import/named": "error", + "import/namespace": "error", + "import/no-named-as-default": 2, + "import/no-named-as-default-member": 2, + "import/no-unresolved": ["error", { "caseSensitive": false, "commonjs": true, "amd": true }], + "import/no-duplicates": "error", + "react-refresh/only-export-components": "warn", "consistent-this": [ "error", "self" @@ -53,12 +78,6 @@ "null": "ignore" } ], - "import/no-unresolved": [ - 2, - { - "caseSensitive": false - } - ], "no-console": [ "error", { diff --git a/package-lock.json b/package-lock.json index 4562d47dc76bf836298825d40d74d6430bf355dc..8fe5d3bba4b6e8a4b9a12260ee4c5d824d91719d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,7 +32,7 @@ "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "^3.6.3", - "eslint-plugin-import": "^2.30.0", + "eslint-plugin-import": "^2.31.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-react": "^7.37.1", "eslint-plugin-react-hooks": "^5.0.0", @@ -4396,9 +4396,9 @@ } }, "node_modules/eslint-plugin-import": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.30.0.tgz", - "integrity": "sha512-/mHNE9jINJfiD2EKkg1BKyPyUk4zdnT54YgbOgfjSakWT5oyX/qQLVNTkehyfpcMxZXMy1zyonZ2v7hZTX43Yw==", + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", + "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", "dev": true, "dependencies": { "@rtsao/scc": "^1.1.0", @@ -4409,7 +4409,7 @@ "debug": "^3.2.7", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.9", - "eslint-module-utils": "^2.9.0", + "eslint-module-utils": "^2.12.0", "hasown": "^2.0.2", "is-core-module": "^2.15.1", "is-glob": "^4.0.3", @@ -4418,13 +4418,14 @@ "object.groupby": "^1.0.3", "object.values": "^1.2.0", "semver": "^6.3.1", + "string.prototype.trimend": "^1.0.8", "tsconfig-paths": "^3.15.0" }, "engines": { "node": ">=4" }, "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" } }, "node_modules/eslint-plugin-import/node_modules/debug": { diff --git a/package.json b/package.json index 893476bcdb7d12cd151b30a7a9e6103b3484cd43..a0349f85823eb22e451bb4e3751f9acad2b9db71 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-import-resolver-typescript": "^3.6.3", - "eslint-plugin-import": "^2.30.0", + "eslint-plugin-import": "^2.31.0", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-react": "^7.37.1", "eslint-plugin-react-hooks": "^5.0.0", diff --git a/src/App.tsx b/src/App.tsx index 04581b6a2425b8d2f714c8a491efe7f61c7c975d..0245b8c34a47a5eaba554cc1b49cdbe3ec9a8a8f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -5,7 +5,7 @@ import { BrowserRouter as Router, Routes } from "react-router-dom"; -import NavigationMenu from "./components/navigation/NavigationMenu"; +import { NavigationMenu } from "./components/navigation/NavigationMenu"; import { CreateNameView } from "./view/CreateName"; import { SystemStructureView } from "./view/SystemStructure"; import { DeviceStructureView } from "./view/DeviceStructure"; @@ -14,10 +14,10 @@ import { LoginView } from "./view/Login"; import { NotFound } from "./view/NotFound"; import { ReduxProvider } from "./providers/ReduxProvider"; import { MuiThemeProvider } from "./providers/MuiThemeProvider"; -import NamesListView from "./view/EssNames"; +import { NamesListView } from "./view/EssNames"; import { applicationTitle } from "./components/common/Helper"; -export default function App() { +export const App = () => { useEffect(() => { document.title = applicationTitle(); }, []); @@ -76,4 +76,4 @@ export default function App() { </MuiThemeProvider> </ReduxProvider> ); -} +}; diff --git a/src/components/CreateName/CreateName.tsx b/src/components/CreateName/CreateName.tsx index 7f27843a0fc6562fa200a46d4d62e084c3eb7367..8880d12cbed4e0d8bf919c746bfba35015c02a49 100644 --- a/src/components/CreateName/CreateName.tsx +++ b/src/components/CreateName/CreateName.tsx @@ -1,4 +1,5 @@ import { SyntheticEvent, useEffect, useState } from "react"; +import { useNavigate } from "react-router-dom"; import { Alert, Button, @@ -8,10 +9,9 @@ import { styled } from "@mui/material"; import { SystemTable } from "./SystemTable"; -import { NameElement, StructureElement, namingApi } from "../../api/namingApi"; import { DeviceTable } from "./DeviceTable"; import { IndexTable } from "./IndexTable"; -import { useNavigate } from "react-router-dom"; +import { NameElement, StructureElement, namingApi } from "../../api/namingApi"; const StyledSystemTable = styled(SystemTable)({ flex: 2, @@ -65,7 +65,7 @@ export const CreateName = () => { const errorData = error.data as ErrorMessageData; setCreateNameErrorMessage(errorData?.message ?? "Unable to create name"); } - }, [isLoading]); + }, [isLoading, error]); const [getIndexes, { isLoading: indexesLoading }] = namingApi.endpoints.readNames.useLazyQuery({ @@ -112,7 +112,7 @@ export const CreateName = () => { } }); } - }, [selectedSystem, selectedDevice]); + }, [selectedSystem, selectedDevice, getIndexes]); // clear the available indexes if the search differs from selected useEffect(() => { diff --git a/src/components/CreateName/DeviceTable.tsx b/src/components/CreateName/DeviceTable.tsx index 8d5e178dd86347f49d749ff81dcb9c04ae50b61c..5a2c734169550c9b97f856d36859a97c428b7353 100644 --- a/src/components/CreateName/DeviceTable.tsx +++ b/src/components/CreateName/DeviceTable.tsx @@ -1,8 +1,8 @@ import { useState } from "react"; import { Table, SearchBar, EllipsisText } from "@ess-ics/ce-ui-common"; -import { StructureElement, namingApi } from "../../api/namingApi"; import { GridColDef, GridRowParams } from "@mui/x-data-grid"; import { styled } from "@mui/material"; +import { StructureElement, namingApi } from "../../api/namingApi"; interface DeviceTableProps { deviceSearch: string | undefined; diff --git a/src/components/CreateName/IndexTable.tsx b/src/components/CreateName/IndexTable.tsx index c513d829c82fd16a5b559c97c698ee8a56f26775..ad3081f5baf659fae61f5b64e2f597258e2563b0 100644 --- a/src/components/CreateName/IndexTable.tsx +++ b/src/components/CreateName/IndexTable.tsx @@ -1,7 +1,7 @@ -import { NameElement } from "../../api/namingApi"; import { GridColDef } from "@mui/x-data-grid"; import { Table } from "@ess-ics/ce-ui-common"; import { Stack, styled } from "@mui/material"; +import { NameElement } from "../../api/namingApi"; interface IndexTableProps { indexes: NameElement[]; diff --git a/src/components/CreateName/SystemTable.tsx b/src/components/CreateName/SystemTable.tsx index 91db8849966f707f663eec86636c48ebb1da8397..980c621d98e424448af9cf934e10739048d810cb 100644 --- a/src/components/CreateName/SystemTable.tsx +++ b/src/components/CreateName/SystemTable.tsx @@ -1,8 +1,8 @@ import { useState } from "react"; import { Table, SearchBar, EllipsisText } from "@ess-ics/ce-ui-common"; -import { StructureElement, namingApi } from "../../api/namingApi"; import { GridColDef, GridRowParams } from "@mui/x-data-grid"; import { styled } from "@mui/material"; +import { StructureElement, namingApi } from "../../api/namingApi"; interface SystemTableProps { systemSearch: string | undefined; diff --git a/src/components/CreateName/index.tsx b/src/components/CreateName/index.tsx index 22ebcbbaf1314cf6a55bd920afd14cb6c3b55798..5beefec3eeb270c2b332cec09c577fb5bf349820 100644 --- a/src/components/CreateName/index.tsx +++ b/src/components/CreateName/index.tsx @@ -1,4 +1,3 @@ import { CreateName } from "./CreateName"; -export default CreateName; export { CreateName }; diff --git a/src/components/NameTable/index.ts b/src/components/NameTable/index.ts index 0941c442a2534cf6b27080ff294bb0b5ac9b3e9c..010078731f036d73bdc6d0978e82cb2421489602 100644 --- a/src/components/NameTable/index.ts +++ b/src/components/NameTable/index.ts @@ -1,4 +1,3 @@ import { NameTable } from "./NameTable"; export { NameTable }; -export default NameTable; diff --git a/src/components/common/Helper.ts b/src/components/common/Helper.ts index 1cf3f3dc04e47f154d63e846923a6d3898be449c..bd7eb86abf8b7e73217a98cc714ca56c23f63b60 100644 --- a/src/components/common/Helper.ts +++ b/src/components/common/Helper.ts @@ -1,5 +1,5 @@ import { Constants } from "../../config/Constants"; -import env from "../../config/env"; +import { env } from "../../config/env"; function applicationSubTitle() { return env.ENVIRONMENT_TITLE ? ` - ${env.ENVIRONMENT_TITLE}` : ""; diff --git a/src/components/common/container/index.ts b/src/components/common/container/index.ts index 37732473d8e11ab9862a4d88c047856fa44656cd..a280de7527afb5e19755d7827bcbd927a3dfac52 100644 --- a/src/components/common/container/index.ts +++ b/src/components/common/container/index.ts @@ -1,4 +1,3 @@ import { RootPaper } from "./RootPaper"; export { RootPaper }; -export default RootPaper; diff --git a/src/components/navigation/NavigationMenu/LoginControls.tsx b/src/components/navigation/NavigationMenu/LoginControls.tsx index 1816fcdb032393ed98b472020206f7ecaca83c46..9e172414ca6118b50bc38113f12dfd00af01d0c8 100644 --- a/src/components/navigation/NavigationMenu/LoginControls.tsx +++ b/src/components/navigation/NavigationMenu/LoginControls.tsx @@ -1,7 +1,7 @@ import { useCallback, useEffect, useState } from "react"; -import { ProfileMenu } from "./ProfileMenu"; import { Button } from "@mui/material"; import { LoginDialog } from "@ess-ics/ce-ui-common"; +import { ProfileMenu } from "./ProfileMenu"; import { useAuthentication } from "./useAuthentication"; export function LoginControls() { diff --git a/src/components/navigation/NavigationMenu/NavigationMenu.tsx b/src/components/navigation/NavigationMenu/NavigationMenu.tsx index 35c7aabe4b4d9d21a372673e044577722a524221..36683000bed1aaf663248ec2a9c47ed0f44537aa 100644 --- a/src/components/navigation/NavigationMenu/NavigationMenu.tsx +++ b/src/components/navigation/NavigationMenu/NavigationMenu.tsx @@ -1,5 +1,4 @@ import { ReactNode, useState } from "react"; -import { Constants } from "../../../config/Constants"; import { Box, Tooltip, @@ -21,6 +20,7 @@ import { } from "@ess-ics/ce-ui-common"; import { Link, NavigateFunction, useNavigate } from "react-router-dom"; import { LoginControls } from "./LoginControls"; +import { Constants } from "../../../config/Constants"; interface ListItem { url: string; @@ -117,7 +117,7 @@ interface NavigationMenuProps { children: ReactNode; } -export default function NavigationMenu({ children }: NavigationMenuProps) { +export const NavigationMenu = ({ children }: NavigationMenuProps) => { const [drawerOpen, setDrawerOpen] = useState(false); const navigate = useNavigate(); @@ -148,4 +148,4 @@ export default function NavigationMenu({ children }: NavigationMenuProps) { {children} </GlobalAppBar> ); -} +}; diff --git a/src/components/navigation/NavigationMenu/ProfileMenu.tsx b/src/components/navigation/NavigationMenu/ProfileMenu.tsx index 71c7d0cf644065216cf43158a11a4079b8d34c19..4ea95c2aa8faeb314a718a15eb4a2649f8f82875 100644 --- a/src/components/navigation/NavigationMenu/ProfileMenu.tsx +++ b/src/components/navigation/NavigationMenu/ProfileMenu.tsx @@ -1,9 +1,9 @@ import { useNavigate } from "react-router-dom"; -import { User } from "../../../types/common"; import { IconMenuButton } from "@ess-ics/ce-ui-common"; import { Avatar, Chip } from "@mui/material"; import LockOpenIcon from "@mui/icons-material/LockOpen"; import PersonIcon from "@mui/icons-material/Person"; +import { User } from "../../../types/common"; interface ProfileMenuProps { user: User; diff --git a/src/components/navigation/NavigationMenu/index.ts b/src/components/navigation/NavigationMenu/index.ts index e7d2ee6772578f7a99831510743a2ea0af349839..c8a03a5c0fa504fe4fbfa66c123bb9cce6feeb3b 100644 --- a/src/components/navigation/NavigationMenu/index.ts +++ b/src/components/navigation/NavigationMenu/index.ts @@ -1,4 +1,3 @@ -import NavigationMenu from "./NavigationMenu"; +import { NavigationMenu } from "./NavigationMenu"; export { NavigationMenu }; -export default NavigationMenu; diff --git a/src/config/env.ts b/src/config/env.ts index e3651bd62295c0d8eb546c0f8f1d7f85df15ac47..ddd143efa3d13a5cd6fe2b655d8bc5a418e3a23f 100644 --- a/src/config/env.ts +++ b/src/config/env.ts @@ -1,8 +1,6 @@ -const env = { +export const env = { ENVIRONMENT_TITLE: window.ENVIRONMENT_TITLE === "undefined" ? undefined : window.ENVIRONMENT_TITLE }; - -export default env; diff --git a/src/index.tsx b/src/index.tsx index 22003542434a00b71d9a7fa34f4e444f47bb50d2..e7e6b30f19bd8884ac06da1ddc3100866316736e 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,16 +1,15 @@ import { StrictMode } from "react"; -import ReactDOM from "react-dom/client"; -import App from "./App"; +import { createRoot } from "react-dom/client"; import { LicenseInfo } from "@mui/x-license-pro"; +import { App } from "./App"; // Set license key if (import.meta.env.VITE_APP_MUI_PRO_LICENSE_KEY) { LicenseInfo.setLicenseKey(import.meta.env.VITE_APP_MUI_PRO_LICENSE_KEY); } -const root = ReactDOM.createRoot( - document.getElementById("root") as HTMLElement -); +const root = createRoot(document.getElementById("root") as HTMLElement); + root.render( <StrictMode> <App /> diff --git a/src/providers/MuiThemeProvider.tsx b/src/providers/MuiThemeProvider.tsx index 730c20d4d4c4f949d3eb849f839965c876ae4a33..84378d1dead48be41b5bd8aa3ffb85926d4109b0 100644 --- a/src/providers/MuiThemeProvider.tsx +++ b/src/providers/MuiThemeProvider.tsx @@ -1,6 +1,6 @@ import { ReactNode } from "react"; -import { theme } from "../style/Theme"; import { CssBaseline, ThemeProvider } from "@mui/material"; +import { theme } from "../style/Theme"; interface Props { children: ReactNode; diff --git a/src/view/CreateName/CreateNameView.tsx b/src/view/CreateName/CreateNameView.tsx index bff18fc365936998fa6f7763929d99122518b06a..7cec8d5281ec6d75e7b930ddbc363a821f7d3e6a 100644 --- a/src/view/CreateName/CreateNameView.tsx +++ b/src/view/CreateName/CreateNameView.tsx @@ -1,7 +1,7 @@ import { useEffect } from "react"; import { useGlobalAppBarContext, RootPaper } from "@ess-ics/ce-ui-common"; import { GlobalAppBarContext } from "../../types/common"; -import CreateName from "../../components/CreateName"; +import { CreateName } from "../../components/CreateName"; interface CreateNameViewProps { title: string; @@ -12,7 +12,7 @@ export function CreateNameView({ title }: CreateNameViewProps): JSX.Element { useEffect(() => { setTitle(title); - }, [setTitle]); + }, [setTitle, title]); return ( <RootPaper> diff --git a/src/view/CreateName/index.ts b/src/view/CreateName/index.ts index 3d4b0edb5a8197737cf433dfb9ee484adcfe5ebc..d706447a59335f3b6c5998aadc2657a670bf43ff 100644 --- a/src/view/CreateName/index.ts +++ b/src/view/CreateName/index.ts @@ -1,4 +1,3 @@ import { CreateNameView } from "./CreateNameView"; export { CreateNameView }; -export default CreateNameView; diff --git a/src/view/DeviceStructure/DeviceStructureView.tsx b/src/view/DeviceStructure/DeviceStructureView.tsx index 53ddabaa9bf28fe1d6f3a3bf4837b3dd768c98cc..187b4368903ecce6abd357404e5edd8cdc657495 100644 --- a/src/view/DeviceStructure/DeviceStructureView.tsx +++ b/src/view/DeviceStructure/DeviceStructureView.tsx @@ -1,7 +1,7 @@ import { useEffect } from "react"; import { useGlobalAppBarContext, RootPaper } from "@ess-ics/ce-ui-common"; -import { GlobalAppBarContext } from "../../types/common"; import { Typography } from "@mui/material"; +import { GlobalAppBarContext } from "../../types/common"; interface DeviceStructureViewProps { title: string; @@ -14,7 +14,7 @@ export function DeviceStructureView({ useEffect(() => { setTitle(title); - }, [setTitle]); + }, [setTitle, title]); return ( <RootPaper> diff --git a/src/view/DeviceStructure/index.ts b/src/view/DeviceStructure/index.ts index 022af388bd402e27d609975e1cee51969145dfda..4de9bb9b55265cc162e61c293212adc2bb067d83 100644 --- a/src/view/DeviceStructure/index.ts +++ b/src/view/DeviceStructure/index.ts @@ -1,4 +1,3 @@ import { DeviceStructureView } from "./DeviceStructureView"; export { DeviceStructureView }; -export default DeviceStructureView; diff --git a/src/view/EssNames/NamesListView.tsx b/src/view/EssNames/NamesListView.tsx index 225e4b193bd2b4a5ffd800086ff9eb8f7dad2960..a3d2ed86355f733a448d9f6db568dbe47cfa0893 100644 --- a/src/view/EssNames/NamesListView.tsx +++ b/src/view/EssNames/NamesListView.tsx @@ -1,4 +1,5 @@ import { useCallback, useEffect, useMemo } from "react"; +import { useSearchParams } from "react-router-dom"; import { useGlobalAppBarContext, RootPaper, @@ -6,8 +7,7 @@ import { usePagination } from "@ess-ics/ce-ui-common"; import { GlobalAppBarContext, OnPageParams } from "../../types/common"; -import NameTable from "../../components/NameTable"; -import { useSearchParams } from "react-router-dom"; +import { NameTable } from "../../components/NameTable"; import { namingApi } from "../../api/namingApi"; import { ROWS_PER_PAGE } from "../../constants"; @@ -20,7 +20,7 @@ export function NamesListView({ title }: NamesListViewProps): JSX.Element { useEffect(() => { setTitle(title); - }, [setTitle]); + }, [setTitle, title]); const [searchParams, setSearchParams] = useSearchParams({ query: "" }); diff --git a/src/view/EssNames/index.ts b/src/view/EssNames/index.ts index 5a1c95a924eef0e4435ad7d410f8b4f97a686fea..b47d3c6f4fc4858088093824000a9f7bf22466d5 100644 --- a/src/view/EssNames/index.ts +++ b/src/view/EssNames/index.ts @@ -1,4 +1,3 @@ import { NamesListView } from "./NamesListView"; export { NamesListView }; -export default NamesListView; diff --git a/src/view/Help/HelpView.tsx b/src/view/Help/HelpView.tsx index 5e376f18640ee20586951caf20c63b59d0ed6efa..75e93301d83078283fdfa79248a1ea61e8f0b4f0 100644 --- a/src/view/Help/HelpView.tsx +++ b/src/view/Help/HelpView.tsx @@ -12,7 +12,7 @@ export function HelpView({ title }: HelpViewProps) { useEffect(() => { setTitle(title); - }, [setTitle]); + }, [setTitle, title]); return ( <RootPaper> diff --git a/src/view/Help/index.ts b/src/view/Help/index.ts index 878d466352e5bd064b600eb6029550040f0d45e0..506a4b8fd49499ba23e7d3a74b49c43d58d9477e 100644 --- a/src/view/Help/index.ts +++ b/src/view/Help/index.ts @@ -1,4 +1,3 @@ import { HelpView } from "./HelpView"; export { HelpView }; -export default HelpView; diff --git a/src/view/Login/LoginView.tsx b/src/view/Login/LoginView.tsx index c1ad8b14a92e527f097647edb444d7f3c2cd2736..b33dbaddf3c1df5e45d2315a752c3df895e55a77 100644 --- a/src/view/Login/LoginView.tsx +++ b/src/view/Login/LoginView.tsx @@ -1,7 +1,7 @@ import { useEffect } from "react"; import { useGlobalAppBarContext, RootPaper } from "@ess-ics/ce-ui-common"; -import { GlobalAppBarContext } from "../../types/common"; import { Typography } from "@mui/material"; +import { GlobalAppBarContext } from "../../types/common"; interface LoginViewProps { title: string; @@ -12,7 +12,7 @@ export function LoginView({ title }: LoginViewProps) { useEffect(() => { setTitle(title); - }, [setTitle]); + }, [setTitle, title]); return ( <RootPaper> diff --git a/src/view/Login/index.ts b/src/view/Login/index.ts index bc34e52072586def151df10a4d81d945b67298f7..469d6bb111cdac3132128e0f1119e6244ae9e06f 100644 --- a/src/view/Login/index.ts +++ b/src/view/Login/index.ts @@ -1,4 +1,3 @@ import { LoginView } from "./LoginView"; export { LoginView }; -export default LoginView; diff --git a/src/view/NotFound/NotFound.tsx b/src/view/NotFound/NotFound.tsx index e9ec45a11281bbc7b22846c8a9ed5278f6be817f..f839f8af9f3870de0ee184983e5936afd98f5968 100644 --- a/src/view/NotFound/NotFound.tsx +++ b/src/view/NotFound/NotFound.tsx @@ -1,6 +1,6 @@ import { Typography, Box, Button } from "@mui/material"; -import { RootPaper } from "../../components/common/container/RootPaper"; import { useNavigate } from "react-router-dom"; +import { RootPaper } from "../../components/common/container/RootPaper"; interface Props { message?: string; diff --git a/src/view/NotFound/index.ts b/src/view/NotFound/index.ts index 845ccb5591f6b52d7b40563c2da1f3c4b9780df6..4907a13f3f136127eb566c63204d3d695e416685 100644 --- a/src/view/NotFound/index.ts +++ b/src/view/NotFound/index.ts @@ -1,4 +1,3 @@ import { NotFound } from "./NotFound"; export { NotFound }; -export default NotFound; diff --git a/src/view/SystemStructure/SystemStructureView.tsx b/src/view/SystemStructure/SystemStructureView.tsx index cd5acedc96ad3ce3699aa85ba3460fee25390d36..93b813a013959404eead3270846749a874d58bdf 100644 --- a/src/view/SystemStructure/SystemStructureView.tsx +++ b/src/view/SystemStructure/SystemStructureView.tsx @@ -1,7 +1,7 @@ import { useEffect } from "react"; import { useGlobalAppBarContext, RootPaper } from "@ess-ics/ce-ui-common"; -import { GlobalAppBarContext } from "../../types/common"; import { Typography } from "@mui/material"; +import { GlobalAppBarContext } from "../../types/common"; interface SystemStructureViewProps { title: string; @@ -12,7 +12,7 @@ export function SystemStructureView({ title }: SystemStructureViewProps) { useEffect(() => { setTitle(title); - }, [setTitle]); + }, [setTitle, title]); return ( <RootPaper> diff --git a/src/view/SystemStructure/index.ts b/src/view/SystemStructure/index.ts index 011a16ec20ae60a31a90f3bc80d92e6ffa324551..501aa3f6c9a4084f0029c6653f5e6d0f0264707d 100644 --- a/src/view/SystemStructure/index.ts +++ b/src/view/SystemStructure/index.ts @@ -1,4 +1,3 @@ import { SystemStructureView } from "./SystemStructureView"; export { SystemStructureView }; -export default SystemStructureView;