Added semicolons linting rule
This commit is contained in:
parent
271338cc60
commit
c98407ee0b
17 changed files with 33 additions and 32 deletions
|
|
@ -41,6 +41,7 @@
|
|||
],
|
||||
"rules": {
|
||||
"indent": ["error", "tab", { "SwitchCase": 1 }],
|
||||
"semi": "error",
|
||||
|
||||
"jsdoc/no-undefined-types": "warn",
|
||||
"jsdoc/require-param": "warn",
|
||||
|
|
|
|||
|
|
@ -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 = (<div className={styles["File-button-preview"]}>
|
||||
<img src={file.source} alt={file.id}/>
|
||||
</div>)
|
||||
</div>);
|
||||
break;
|
||||
case "txt":
|
||||
case "md":
|
||||
preview = <FontAwesomeIcon icon={faFileLines}/>
|
||||
preview = <FontAwesomeIcon icon={faFileLines}/>;
|
||||
break;
|
||||
default:
|
||||
preview = <FontAwesomeIcon icon={faFile}/>
|
||||
preview = <FontAwesomeIcon icon={faFile}/>;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ export function FileExplorer({ startPath }) {
|
|||
setCurrentDirectory(directory);
|
||||
setPath(directory.path);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const onPathChange = (event) => {
|
||||
return setPath(event.target.value);
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ export function Terminal() {
|
|||
});
|
||||
|
||||
return visibleHistory.slice(startIndex).map(({ text }, index) => {
|
||||
return <OutputLine text={text} key={index}/>
|
||||
return <OutputLine text={text} key={index}/>;
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -173,5 +173,5 @@ export function Terminal() {
|
|||
onChange={onChange}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export function DropdownButton({ label, options, shortcuts }) {
|
|||
return (
|
||||
<OutsideClickListener onOutsideClick={() => { setOpen(false); }}>
|
||||
<div className={styles.Container}>
|
||||
<button title={label} className={styles.Button} onClick={() => { setOpen(!open) }}>
|
||||
<button title={label} className={styles.Button} onClick={() => { setOpen(!open); }}>
|
||||
{label}
|
||||
</button>
|
||||
{open && options
|
||||
|
|
@ -37,5 +37,5 @@ export function DropdownButton({ label, options, shortcuts }) {
|
|||
}
|
||||
</div>
|
||||
</OutsideClickListener>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
@ -22,5 +22,5 @@ export default class Application {
|
|||
}
|
||||
|
||||
return <this.windowContent {...props}/>;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -125,5 +125,5 @@ export class Command {
|
|||
new Command("hostname", (args, { hostname }) => {
|
||||
return hostname;
|
||||
}),
|
||||
]
|
||||
];
|
||||
}
|
||||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ export class EventEmitter {
|
|||
/**
|
||||
* @type {Object<string, Array<Function>>}
|
||||
*/
|
||||
#events = {}
|
||||
#events = {};
|
||||
|
||||
/**
|
||||
* Add event listener for an event
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 = () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue