From c98407ee0bfa388e4bce864930ef02d1ca37122e Mon Sep 17 00:00:00 2001 From: Prozilla Date: Sun, 6 Aug 2023 13:54:20 +0200 Subject: [PATCH] Added semicolons linting rule --- package.json | 1 + .../applications/file-explorer/FileExplorer.jsx | 10 +++++----- .../applications/media-viewer/MediaViewer.jsx | 4 ++-- src/components/applications/settings/Settings.jsx | 2 +- src/components/applications/terminal/Terminal.jsx | 4 ++-- .../applications/text-editor/TextEditor.jsx | 2 +- src/components/utils/DropdownButton.jsx | 4 ++-- src/features/applications/application.js | 2 +- src/features/applications/applications.js | 2 +- src/features/applications/terminal/commands.js | 2 +- src/features/settings/settings.js | 4 ++-- src/features/utils/events.js | 2 +- src/features/virtual-drive/virtual-base.js | 2 +- src/features/virtual-drive/virtual-folder.js | 4 ++-- src/features/virtual-drive/virtual-root.js | 12 ++++++------ src/features/windows/windows.js | 2 +- src/hooks/utils/scrollWithShadows.js | 6 +++--- 17 files changed, 33 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index 1675e21..1513d1b 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ ], "rules": { "indent": ["error", "tab", { "SwitchCase": 1 }], + "semi": "error", "jsdoc/no-undefined-types": "warn", "jsdoc/require-param": "warn", diff --git a/src/components/applications/file-explorer/FileExplorer.jsx b/src/components/applications/file-explorer/FileExplorer.jsx index 5ac0eab..46c0217 100644 --- a/src/components/applications/file-explorer/FileExplorer.jsx +++ b/src/components/applications/file-explorer/FileExplorer.jsx @@ -3,7 +3,7 @@ import { useVirtualRoot } from "../../../hooks/virtual-drive/VirtualRootContext. import styles from "./FileExplorer.module.css"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faArrowUp, faCaretLeft, faCaretRight, faCog, faDesktop, faFile, faFileLines, faFolder, faHouse, faImage, faSearch } from "@fortawesome/free-solid-svg-icons"; -// eslint-disable-next-line no-unused-vars + import { VirtualFile } from "../../../features/virtual-drive/virtual-file.js"; import { useWindowsManager } from "../../../hooks/windows/WindowsManagerContext.js"; @@ -18,14 +18,14 @@ function FilePreview({ file }) { case "png": preview = (
{file.id}/ -
) + ); break; case "txt": case "md": - preview = + preview = ; break; default: - preview = + preview = ; break; } @@ -51,7 +51,7 @@ export function FileExplorer({ startPath }) { setCurrentDirectory(directory); setPath(directory.path); } - } + }; const onPathChange = (event) => { return setPath(event.target.value); diff --git a/src/components/applications/media-viewer/MediaViewer.jsx b/src/components/applications/media-viewer/MediaViewer.jsx index 683fe8a..3874c2e 100644 --- a/src/components/applications/media-viewer/MediaViewer.jsx +++ b/src/components/applications/media-viewer/MediaViewer.jsx @@ -1,5 +1,5 @@ -// eslint-disable-next-line no-unused-vars -import { VirtualFile } from "../../../features/virtual-drive/virtual-file.js" + +import { VirtualFile } from "../../../features/virtual-drive/virtual-file.js"; import { useWindowsManager } from "../../../hooks/windows/WindowsManagerContext.js"; import styles from "./MediaViewer.module.css"; diff --git a/src/components/applications/settings/Settings.jsx b/src/components/applications/settings/Settings.jsx index 99cd616..bee9d92 100644 --- a/src/components/applications/settings/Settings.jsx +++ b/src/components/applications/settings/Settings.jsx @@ -5,7 +5,7 @@ import { faPalette } from "@fortawesome/free-solid-svg-icons"; import { useVirtualRoot } from "../../../hooks/virtual-drive/VirtualRootContext.js"; import { useSettings } from "../../../hooks/settings/SettingsContext.js"; import { SettingsManager } from "../../../features/settings/settings.js"; -// eslint-disable-next-line no-unused-vars + import { VirtualRoot } from "../../../features/virtual-drive/virtual-root.js"; /** diff --git a/src/components/applications/terminal/Terminal.jsx b/src/components/applications/terminal/Terminal.jsx index 744c976..6a04aaa 100644 --- a/src/components/applications/terminal/Terminal.jsx +++ b/src/components/applications/terminal/Terminal.jsx @@ -138,7 +138,7 @@ export function Terminal() { }); return visibleHistory.slice(startIndex).map(({ text }, index) => { - return + return ; }); }; @@ -173,5 +173,5 @@ export function Terminal() { onChange={onChange} /> - ) + ); } \ No newline at end of file diff --git a/src/components/applications/text-editor/TextEditor.jsx b/src/components/applications/text-editor/TextEditor.jsx index a520551..944ef69 100644 --- a/src/components/applications/text-editor/TextEditor.jsx +++ b/src/components/applications/text-editor/TextEditor.jsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from "react"; -// eslint-disable-next-line no-unused-vars + import { VirtualFile } from "../../../features/virtual-drive/virtual-file.js"; import styles from "./TextEditor.module.css"; import { HeaderMenu } from "../.common/HeaderMenu.jsx"; diff --git a/src/components/utils/DropdownButton.jsx b/src/components/utils/DropdownButton.jsx index 4476251..6495d04 100644 --- a/src/components/utils/DropdownButton.jsx +++ b/src/components/utils/DropdownButton.jsx @@ -15,7 +15,7 @@ export function DropdownButton({ label, options, shortcuts }) { return ( { setOpen(false); }}>
- {open && options @@ -37,5 +37,5 @@ export function DropdownButton({ label, options, shortcuts }) { }
- ) + ); } \ No newline at end of file diff --git a/src/features/applications/application.js b/src/features/applications/application.js index b201092..1216178 100644 --- a/src/features/applications/application.js +++ b/src/features/applications/application.js @@ -22,5 +22,5 @@ export default class Application { } return ; - } + }; } \ No newline at end of file diff --git a/src/features/applications/applications.js b/src/features/applications/applications.js index de26ba3..7afda23 100644 --- a/src/features/applications/applications.js +++ b/src/features/applications/applications.js @@ -19,7 +19,7 @@ export default class ApplicationsManager { new Application("Wordle", "wordle", WebView, { source: "https://prozilla.dev/wordle" }), new Application("Balls", "balls", WebView, { source: "https://prozilla.dev/ball-maze" }), new Application("Minesweeper", "minesweeper", WebView, { source: "https://prozilla.dev/minesweeper" }), - ] + ]; /** * @param {string} id diff --git a/src/features/applications/terminal/commands.js b/src/features/applications/terminal/commands.js index 2c9d51c..7d67b2a 100644 --- a/src/features/applications/terminal/commands.js +++ b/src/features/applications/terminal/commands.js @@ -125,5 +125,5 @@ export class Command { new Command("hostname", (args, { hostname }) => { return hostname; }), - ] + ]; } \ No newline at end of file diff --git a/src/features/settings/settings.js b/src/features/settings/settings.js index 66ad7cc..c708824 100644 --- a/src/features/settings/settings.js +++ b/src/features/settings/settings.js @@ -1,6 +1,6 @@ -// eslint-disable-next-line no-unused-vars + import { VirtualFile } from "../virtual-drive/virtual-file.js"; -// eslint-disable-next-line no-unused-vars + import { VirtualRoot } from "../virtual-drive/virtual-root.js"; export class Settings { diff --git a/src/features/utils/events.js b/src/features/utils/events.js index eb2867c..19be6e8 100644 --- a/src/features/utils/events.js +++ b/src/features/utils/events.js @@ -7,7 +7,7 @@ export class EventEmitter { /** * @type {Object>} */ - #events = {} + #events = {}; /** * Add event listener for an event diff --git a/src/features/virtual-drive/virtual-base.js b/src/features/virtual-drive/virtual-base.js index 017e9c8..0e02da5 100644 --- a/src/features/virtual-drive/virtual-base.js +++ b/src/features/virtual-drive/virtual-base.js @@ -1,5 +1,5 @@ import { EventEmitter } from "../utils/events.js"; -// eslint-disable-next-line no-unused-vars + import { VirtualRoot } from "./virtual-root.js"; export class VirtualBase extends EventEmitter { diff --git a/src/features/virtual-drive/virtual-folder.js b/src/features/virtual-drive/virtual-folder.js index bbd91b0..aef1af0 100644 --- a/src/features/virtual-drive/virtual-folder.js +++ b/src/features/virtual-drive/virtual-folder.js @@ -9,7 +9,7 @@ export class VirtualFolder extends VirtualBase { static TYPE = { GENERAL: 0, MEDIA: 1, - } + }; /** * @param {string} name @@ -237,7 +237,7 @@ export class VirtualFolder extends VirtualBase { } else { return currentDirectory?.findSubFolder(path); } - } + }; if (segments.length === 1) { const directory = getDirectory(segments[0], true); diff --git a/src/features/virtual-drive/virtual-root.js b/src/features/virtual-drive/virtual-root.js index e34fd66..88fbbbc 100644 --- a/src/features/virtual-drive/virtual-root.js +++ b/src/features/virtual-drive/virtual-root.js @@ -1,5 +1,5 @@ import { StorageManager } from "../storage/storage.js"; -// eslint-disable-next-line no-unused-vars + import { VirtualFile } from "./virtual-file.js"; import { VirtualFolder } from "./virtual-folder.js"; @@ -50,13 +50,13 @@ export class VirtualRoot extends VirtualFolder { }) .createFolder("Images", (folder) => { folder.createFile("Wallpaper1", "png", (file) => { - file.setSource("/media/wallpapers/Wallpaper1.png") + file.setSource("/media/wallpapers/Wallpaper1.png"); }).createFile("Wallpaper2", "png", (file) => { - file.setSource("/media/wallpapers/Wallpaper2.png") + file.setSource("/media/wallpapers/Wallpaper2.png"); }).createFile("Wallpaper3", "png", (file) => { - file.setSource("/media/wallpapers/Wallpaper3.png") + file.setSource("/media/wallpapers/Wallpaper3.png"); }).createFile("Wallpaper4", "png", (file) => { - file.setSource("/media/wallpapers/Wallpaper4.png") + file.setSource("/media/wallpapers/Wallpaper4.png"); }); }) .createFolder("Documents", (folder) => { @@ -113,7 +113,7 @@ export class VirtualRoot extends VirtualFolder { } else if (content != null) { file.setContent(content); } - }) + }); }; const addFolder = ({ nam: name, fds: folders, fls: files }, parent = this) => { diff --git a/src/features/windows/windows.js b/src/features/windows/windows.js index e85ed06..93a9d80 100644 --- a/src/features/windows/windows.js +++ b/src/features/windows/windows.js @@ -1,7 +1,7 @@ import ApplicationsManager from "../applications/applications.js"; import { randomRange } from "../math/random.js"; import Vector2 from "../math/vector2.js"; -// eslint-disable-next-line no-unused-vars + import { VirtualFile } from "../virtual-drive/virtual-file.js"; export default class WindowsManager { diff --git a/src/hooks/utils/scrollWithShadows.js b/src/hooks/utils/scrollWithShadows.js index dff4826..3316fee 100644 --- a/src/hooks/utils/scrollWithShadows.js +++ b/src/hooks/utils/scrollWithShadows.js @@ -2,8 +2,8 @@ * https://medium.com/dfind-consulting/react-scroll-hook-with-shadows-9ba2d47ae32 */ -// eslint-disable-next-line no-unused-vars -import React, { useCallback, useEffect, useRef } from "react"; + +import React, { useCallback, useEffect } from "react"; import { useState } from "react"; /** @@ -80,7 +80,7 @@ export function useScrollWithShadow(options) { return () => { window.removeEventListener("resize", onResize); - } + }; }, [ref, updateValues, initiated]); const getBoxShadow = () => {