diff --git a/picture-gallery-client/.eslintrc.json b/picture-gallery-client/.eslintrc.json index ef32c74..12080d6 100644 --- a/picture-gallery-client/.eslintrc.json +++ b/picture-gallery-client/.eslintrc.json @@ -40,6 +40,12 @@ ".tsx" ] } + ], + "no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_" + } ] }, "settings": { diff --git a/picture-gallery-client/package.json b/picture-gallery-client/package.json index 8b9b17c..7508ff0 100644 --- a/picture-gallery-client/package.json +++ b/picture-gallery-client/package.json @@ -29,8 +29,8 @@ "build-client": "react-scripts build", "test-client": "react-scripts test", "eject-client": "react-scripts eject", - "lint": "eslint src/*", - "lint:fix": "eslint --fix src/*", + "lint": "eslint src/**", + "lint:fix": "eslint --fix src/**", "format": "prettier --write \"**/*.+(ts|tsx)\"" }, "eslintConfig": { diff --git a/picture-gallery-client/src/ImageGallery/ImageGallery.tsx b/picture-gallery-client/src/ImageGallery/ImageGallery.tsx index e6a4bd6..d8d04e8 100644 --- a/picture-gallery-client/src/ImageGallery/ImageGallery.tsx +++ b/picture-gallery-client/src/ImageGallery/ImageGallery.tsx @@ -1,21 +1,17 @@ import PhotoAlbum, { Photo } from "react-photo-album"; +import React from "react"; function ImageGallery({ images }: { images: Photo[] }) { // For all kind of settings see: // https://react-photo-album.com/examples/playground // https://codesandbox.io/s/github/igordanchenko/react-photo-album/tree/main/examples/playground - return ( - <> - {images.length === 0 ? ( -

- No images available. You may want to add images in your root - directory. -

- ) : ( - - )} - + return images.length === 0 ? ( +

+ No images available. You may want to add images in your root directory. +

+ ) : ( + ); } diff --git a/picture-gallery-client/src/ImageGallery/ImageGalleryAppBar.tsx b/picture-gallery-client/src/ImageGallery/ImageGalleryAppBar.tsx index af36616..8937f83 100644 --- a/picture-gallery-client/src/ImageGallery/ImageGalleryAppBar.tsx +++ b/picture-gallery-client/src/ImageGallery/ImageGalleryAppBar.tsx @@ -2,6 +2,7 @@ import Toolbar from "@mui/material/Toolbar"; import IconButton from "@mui/material/IconButton"; import MenuIcon from "@mui/icons-material/Menu"; import Typography from "@mui/material/Typography"; +import React from "react"; import AppBar from "../MuiLayout/AppBar"; function ImageGalleryAppBar({ diff --git a/picture-gallery-client/src/ImageGallery/ImageGalleryDrawer.tsx b/picture-gallery-client/src/ImageGallery/ImageGalleryDrawer.tsx index 7f1e488..942b7a7 100644 --- a/picture-gallery-client/src/ImageGallery/ImageGalleryDrawer.tsx +++ b/picture-gallery-client/src/ImageGallery/ImageGalleryDrawer.tsx @@ -1,5 +1,4 @@ import Drawer from "@mui/material/Drawer"; -import DrawerHeader from "../MuiLayout/DrawerHeader"; import IconButton from "@mui/material/IconButton"; import ChevronLeftIcon from "@mui/icons-material/ChevronLeft"; import ChevronRightIcon from "@mui/icons-material/ChevronRight"; @@ -8,9 +7,10 @@ import FolderOpenIcon from "@mui/icons-material/FolderOpen"; import Divider from "@mui/material/Divider"; import { useTheme } from "@mui/material/styles"; import { TreeItem, TreeView } from "@mui/lab"; -import { Folders } from "./models"; import { useLocation, useNavigate } from "react-router-dom"; -import { useState } from "react"; +import React, { useState } from "react"; +import { Folders } from "./models"; +import DrawerHeader from "../MuiLayout/DrawerHeader"; function getDefaultExpanded(pathname: string): string[] { const pathParts = []; @@ -24,7 +24,7 @@ function getDefaultExpanded(pathname: string): string[] { function generateTreeViewChildren( folders: Folders[], - navigateAndToggleExpand: (path: string, navigationAllowed: boolean) => void + navigateAndToggleExpand: (_path: string, _navigationAllowed: boolean) => void ) { return ( <> @@ -88,7 +88,7 @@ function GenerateTreeView({ root }: { root: Folders }) { return ( } defaultExpandIcon={} expanded={expanded} @@ -102,6 +102,7 @@ function GenerateTreeView({ root }: { root: Folders }) { {root.children.length > 0 ? ( generateTreeViewChildren(root.children, navigateAndToggleExpand) ) : ( + // eslint-disable-next-line react/jsx-no-useless-fragment <> )} diff --git a/picture-gallery-server/package.json b/picture-gallery-server/package.json index 1c98f55..6adc1d2 100644 --- a/picture-gallery-server/package.json +++ b/picture-gallery-server/package.json @@ -9,8 +9,8 @@ "start-server": "node dist/app.js", "watch-server": "npx nodemon src/app.ts", "run-server": "npm run build-server && npm run start-server", - "lint": "eslint src/*", - "lint:fix": "eslint --fix src/*", + "lint": "eslint src/**", + "lint:fix": "eslint --fix src/**", "format": "prettier --write \"**/*.+(ts|tsx)\"" }, "keywords": [],