From 6940bed30171626f7e3c2563240b1b1a77c1b156 Mon Sep 17 00:00:00 2001 From: Adityarup Laha <30696515+adityaruplaha@users.noreply.github.com> Date: Sat, 27 Mar 2021 16:08:04 +0530 Subject: [PATCH] Remove Prettier. (#269) I found that prettier was (still) not set up properly, and was conflicting with some ESLint rules. Also, all the rules we defined in Prettier were available and autofixable in ESLint anyways, so I decided that it was more hassle than it was worth, and removed it. --- .eslintrc | 18 ++++--- .prettierignore | 4 -- .prettierrc.json | 6 --- electron/legendary_utils/library.ts | 10 ++-- electron/main.ts | 40 +++++++-------- electron/utils.ts | 44 ++++++++-------- package.json | 8 +-- src/App.test.tsx | 11 ++-- .../Navbar/components/UserSelector/index.tsx | 2 +- src/components/Navbar/index.tsx | 2 +- src/components/UI/Header/index.tsx | 2 +- src/components/UI/LanguageSelector/index.tsx | 6 +-- src/components/utils.ts | 10 ++-- src/helpers/index.ts | 10 ++-- src/index.tsx | 8 +-- src/screens/Game/GamePage/index.tsx | 30 +++++------ src/screens/Game/GameSubMenu/index.tsx | 20 ++++---- .../Library/components/GameCard/index.tsx | 22 ++++---- src/screens/Library/index.tsx | 4 +- src/screens/Login/index.tsx | 10 ++-- .../components/GeneralSettings/index.tsx | 30 +++++------ .../components/OtherSettings/index.tsx | 2 +- .../Settings/components/SyncSaves/index.tsx | 28 +++++------ .../Settings/components/Tools/index.tsx | 6 +-- .../components/WineSettings/index.tsx | 10 ++-- src/screens/Settings/index.tsx | 28 +++++------ src/state/ContextProvider.tsx | 2 +- src/state/GlobalState.tsx | 50 +++++++++---------- yarn.lock | 40 +-------------- 29 files changed, 209 insertions(+), 254 deletions(-) delete mode 100644 .prettierignore delete mode 100644 .prettierrc.json diff --git a/.eslintrc b/.eslintrc index 45107bd3c1..146e170ecd 100644 --- a/.eslintrc +++ b/.eslintrc @@ -7,8 +7,7 @@ "extends": [ "eslint:recommended", "plugin:react/recommended", - "plugin:@typescript-eslint/recommended", - "prettier" + "plugin:@typescript-eslint/recommended" ], "root": true, "parser": "@typescript-eslint/parser", @@ -33,15 +32,18 @@ } }, "rules": { - "complexity": "off", - "no-trailing-spaces": "error", - "sort-keys-fix/sort-keys-fix": "error", - "typescript-sort-keys/interface": "error", - "sort-vars": "error", "@typescript-eslint/explicit-module-boundary-types": "off", "@typescript-eslint/no-explicit-any": "error", "@typescript-eslint/no-unused-vars": "error", + "complexity": "off", + "comma-dangle": ["error", "never"], + "indent": ["error", 2], + "no-trailing-spaces": "error", + "quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }], + "sort-exports/sort-exports": ["error", { "sortDir": "asc" }], "sort-imports-es6-autofix/sort-imports-es6": ["error", {}], - "sort-exports/sort-exports": ["error", { "sortDir": "asc" }] + "sort-keys-fix/sort-keys-fix": "error", + "sort-vars": "error", + "typescript-sort-keys/interface": "error" } } diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index bd292b719c..0000000000 --- a/.prettierignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -dist -build -public/index.html \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index fa51da29e7..0000000000 --- a/.prettierrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "trailingComma": "es5", - "tabWidth": 2, - "semi": false, - "singleQuote": true -} diff --git a/electron/legendary_utils/library.ts b/electron/legendary_utils/library.ts index d82a97d64a..6a5aa5e1d8 100644 --- a/electron/legendary_utils/library.ts +++ b/electron/legendary_utils/library.ts @@ -10,7 +10,7 @@ import { heroicConfigPath, isLoggedIn, legendaryConfigPath, - writeDefaultconfig, + writeDefaultconfig } from '../utils' const statAsync = promisify(stat) @@ -36,7 +36,7 @@ export async function getLegendaryConfig(file: string): Promise { .then(() => JSON.parse(readFileSync(installed, 'utf-8'))) .catch(() => []), library: `${legendaryConfigPath}/metadata/`, - user: getUserInfo(), + user: getUserInfo() } if (file === 'user') { @@ -62,7 +62,7 @@ export async function getLegendaryConfig(file: string): Promise { title, developer, dlcItemList, - customAttributes: { CloudSaveFolder, FolderName }, + customAttributes: { CloudSaveFolder, FolderName } } = metadata const { namespace } = asset_info @@ -109,7 +109,7 @@ export async function getLegendaryConfig(file: string): Promise { version = null, install_size = null, install_path = null, - is_dlc = dlc(), + is_dlc = dlc() } = info as InstalledInfo const convertedSize = @@ -134,7 +134,7 @@ export async function getLegendaryConfig(file: string): Promise { namespace, saveFolder, title, - version, + version } }) .sort((a: { title: string }, b: { title: string }) => { diff --git a/electron/main.ts b/electron/main.ts index 186df06e45..536b8cf248 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -6,7 +6,7 @@ import { Tray, app, ipcMain, - powerSaveBlocker, + powerSaveBlocker } from 'electron' import { cpus, userInfo as user } from 'os' import { exec, spawn } from 'child_process' @@ -16,7 +16,7 @@ import { readFileSync, unlinkSync, writeFile, - writeFileSync, + writeFileSync } from 'graceful-fs' import { promisify } from 'util' import Backend from 'i18next-fs-backend' @@ -55,7 +55,7 @@ import { supportURL, updateGame, userInfo, - writeGameconfig, + writeGameconfig } from './utils' const execAsync = promisify(exec) @@ -71,9 +71,9 @@ function createWindow(): BrowserWindow { webPreferences: { contextIsolation: false, enableRemoteModule: true, - nodeIntegration: true, + nodeIntegration: true }, - width: isDev ? 1800 : 1280, + width: isDev ? 1800 : 1280 }) setTimeout(() => { @@ -133,39 +133,39 @@ const contextMenu = () => click: function () { mainWindow.show() }, - label: i18next.t('tray.show'), + label: i18next.t('tray.show') }, { click: function () { showAboutWindow() }, - label: i18next.t('tray.about', 'About'), + label: i18next.t('tray.about', 'About') }, { click: function () { openUrlOrFile(heroicGithubURL) }, - label: 'Github', + label: 'Github' }, { click: function () { openUrlOrFile(supportURL) }, - label: i18next.t('tray.support', 'Support Us'), + label: i18next.t('tray.support', 'Support Us') }, { accelerator: 'ctrl + R', click: function () { mainWindow.reload() }, - label: i18next.t('tray.reload', 'Reload'), + label: i18next.t('tray.reload', 'Reload') }, { click: function () { handleExit() }, - label: i18next.t('tray.quit', 'Quit'), - }, + label: i18next.t('tray.quit', 'Quit') + } ]) if (!gotTheLock) { @@ -184,7 +184,7 @@ if (!gotTheLock) { backend: { addPath: path.join(__dirname, '/locales/{{lng}}/{{ns}}'), allowMultiLoading: false, - loadPath: path.join(__dirname, '/locales/{{lng}}/{{ns}}.json'), + loadPath: path.join(__dirname, '/locales/{{lng}}/{{ns}}.json') }, debug: false, fallbackLng: 'en', @@ -199,8 +199,8 @@ if (!gotTheLock) { 'pt', 'ru', 'tr', - 'hu', - ], + 'hu' + ] }) createWindow() @@ -222,7 +222,7 @@ if (!gotTheLock) { ipcMain.on('Notify', (event, args) => { const notify = new Notification({ body: args[1], - title: args[0], + title: args[0] }) notify.on('click', () => mainWindow.show()) @@ -280,12 +280,12 @@ ipcMain.on('quit', async () => handleExit()) const getProductSlug = async (namespace: string, game: string) => { const graphql = JSON.stringify({ query: `{Catalog{catalogOffers( namespace:"${namespace}"){elements {productSlug}}}}`, - variables: {}, + variables: {} }) const result = await axios('https://www.epicgames.com/graphql', { data: graphql, headers: { 'Content-Type': 'application/json' }, - method: 'POST', + method: 'POST' }) const res = result.data.data.Catalog.catalogOffers const slug = res.elements.find((e: { productSlug: string }) => e.productSlug) @@ -316,7 +316,7 @@ ipcMain.handle('getGameInfo', async (event, game, namespace: string | null) => { try { const response = await axios({ method: 'GET', - url: epicUrl, + url: epicUrl }) delete response.data.pages[0].data.requirements.systems[0].details[0] const about = response.data.pages.find( @@ -324,7 +324,7 @@ ipcMain.handle('getGameInfo', async (event, game, namespace: string | null) => { ) return { about: about.data.about, - reqs: about.data.requirements.systems[0].details, + reqs: about.data.requirements.systems[0].details } } catch (error) { return {} diff --git a/electron/utils.ts b/electron/utils.ts index 832e77737a..d580213689 100644 --- a/electron/utils.ts +++ b/electron/utils.ts @@ -8,7 +8,7 @@ import { readFileSync, readdirSync, writeFile, - writeFileSync, + writeFileSync } from 'graceful-fs' import { fixPathForAsarUnpack } from 'electron-util' import { homedir, userInfo as user } from 'os' @@ -52,7 +52,7 @@ async function getAlternativeWine(): Promise { const steamPaths: string[] = [ `${home}/.local/share/Steam`, `${home}/.var/app/com.valvesoftware.Steam/.local/share/Steam`, - '/usr/share/steam', + '/usr/share/steam' ] if (!existsSync(`${heroicToolsPath}/wine`)) { @@ -97,7 +97,7 @@ async function getAlternativeWine(): Promise { if (version.toLowerCase().startsWith('proton')) { proton.add({ bin: `'${path}${version}/proton'`, - name: `Proton - ${version}`, + name: `Proton - ${version}` }) } }) @@ -108,7 +108,7 @@ async function getAlternativeWine(): Promise { readdirSync(lutrisCompatPath).forEach((version) => { altWine.add({ bin: `'${lutrisCompatPath}${version}/bin/wine64'`, - name: `Wine - ${version}`, + name: `Wine - ${version}` }) }) } @@ -116,7 +116,7 @@ async function getAlternativeWine(): Promise { readdirSync(`${heroicToolsPath}/wine/`).forEach((version) => { altWine.add({ bin: `'${lutrisCompatPath}${version}/bin/wine64'`, - name: `Wine - ${version}`, + name: `Wine - ${version}` }) }) @@ -128,12 +128,12 @@ async function getAlternativeWine(): Promise { if (path.endsWith('proton')) { return customPaths.add({ bin: `'${path}'`, - name: `Proton Custom - ${path}`, + name: `Proton Custom - ${path}` }) } return customPaths.add({ bin: `'${path}'`, - name: `Wine Custom - ${path}`, + name: `Wine Custom - ${path}` }) }) } @@ -200,7 +200,7 @@ const launchGame = async (appName: string) => { launcherArgs = '', showMangohud, audioFix, - autoInstallDxvk, + autoInstallDxvk } = await getSettings(appName) const fixedWinePrefix = winePrefix.replace('~', home) @@ -223,10 +223,10 @@ const launchGame = async (appName: string) => { other: otherOptions ? otherOptions : '', proton: isProton ? `STEAM_COMPAT_DATA_PATH='${winePrefix - .replaceAll("'", '') - .replace('~', home)}'` + .replaceAll("'", '') + .replace('~', home)}'` : '', - showMangohud: showMangohud ? `MANGOHUD=1` : '', + showMangohud: showMangohud ? `MANGOHUD=1` : '' } envVars = Object.values(options).join(' ') @@ -299,7 +299,7 @@ async function getLatestDxvk() { return } const { - data: { assets }, + data: { assets } } = await axios.default.get( 'https://api.github.com/repos/lutris/dxvk/releases/latest' ) @@ -395,11 +395,11 @@ const writeDefaultconfig = async () => { useGameMode: false, userInfo: { epicId: account_id, - name: userName, + name: userName }, winePrefix: `${home}/.wine`, - wineVersion: defaultWine, - } as AppSettings, + wineVersion: defaultWine + } as AppSettings } writeFileSync(heroicConfigPath, JSON.stringify(config, null, 2)) @@ -420,7 +420,7 @@ const writeGameconfig = async (game: string) => { otherOptions, useGameMode, showFps, - userInfo, + userInfo } = await getSettings('default') const config = { @@ -430,8 +430,8 @@ const writeGameconfig = async (game: string) => { useGameMode, userInfo, winePrefix, - wineVersion, - }, + wineVersion + } } writeFileSync( @@ -449,7 +449,7 @@ async function checkForUpdates() { } try { const { - data: { tag_name }, + data: { tag_name } } = await axios.default.get( 'https://api.github.com/repos/flavioislima/HeroicGamesLauncher/releases/latest' ) @@ -468,7 +468,7 @@ const showAboutWindow = () => { applicationVersion: `${app.getVersion()} Magelan`, copyright: 'GPL V3', iconPath: icon, - website: 'https://github.com/flavioislima/HeroicGamesLauncher', + website: 'https://github.com/flavioislima/HeroicGamesLauncher' }) return app.showAboutPanel() } @@ -494,7 +494,7 @@ const handleExit = async () => { 'box.quit.message', 'There are pending operations, are you sure?' ), - title: i18next.t('box.quit.title', 'Exit'), + title: i18next.t('box.quit.title', 'Exit') }) if (response === 0) { @@ -571,5 +571,5 @@ export { updateGame, userInfo, writeDefaultconfig, - writeGameconfig, + writeGameconfig } diff --git a/package.json b/package.json index ed2ae1c5c7..dcecb1c995 100644 --- a/package.json +++ b/package.json @@ -85,13 +85,11 @@ "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", - "prettier": "prettier --check .", - "format-files": "prettier --write .", "ci-build": "GH_TOKEN='${{ secrets.WORKFLOW_TOKEN }}' npm run build-electron && npm run build && electron-builder -c.extraMetadata.main=build/main.js --linux deb AppImage rpm pacman", "dist": "yarn build-electron && yarn build && electron-builder -c.extraMetadata.main=build/main.js --linux", "dist-mac": "yarn build-electron && yarn build && electron-builder -c.extraMetadata.main=build/main.js --mac", - "lint": "eslint -c .eslintrc --ext .tsx,ts ./src && eslint -c .eslintrc --ext .ts ./electron && pretty-quick --check", - "lint-fix": "eslint --fix -c .eslintrc --ext .tsx,ts ./src && eslint --fix -c .eslintrc --ext .ts ./electron && pretty-quick --staged", + "lint": "eslint -c .eslintrc --ext .tsx,ts ./src && eslint -c .eslintrc --ext .ts ./electron", + "lint-fix": "eslint --fix -c .eslintrc --ext .tsx,ts ./src && eslint --fix -c .eslintrc --ext .ts ./electron", "build-electron": "tsc --project electron/tsconfig.json", "watch-electron": "tsc --watch --project electron/tsconfig.json", "i18n": "i18next" @@ -125,8 +123,6 @@ "foreman": "^3.0.1", "husky": "^4.3.8", "i18next-parser": "^3.6.0", - "prettier": "2.2.1", - "pretty-quick": "^3.1.0", "typescript": "^4.1.3" }, "husky": { diff --git a/src/App.test.tsx b/src/App.test.tsx index 0cdf7873ca..9ed5b323f3 100644 --- a/src/App.test.tsx +++ b/src/App.test.tsx @@ -1,6 +1,11 @@ -import { render, screen } from '@testing-library/react' -import App from './App' -import React from 'react' +import React from 'react'; + +import { + render, + screen +} from '@testing-library/react'; + +import App from './App'; test('renders learn react link', () => { render() diff --git a/src/components/Navbar/components/UserSelector/index.tsx b/src/components/Navbar/components/UserSelector/index.tsx index 3bd84c42f2..2cb6ead7fd 100644 --- a/src/components/Navbar/components/UserSelector/index.tsx +++ b/src/components/Navbar/components/UserSelector/index.tsx @@ -5,7 +5,7 @@ import { handleQuit, legendary, openAboutWindow, - openDiscordLink, + openDiscordLink } from 'src/helpers' import { useTranslation } from 'react-i18next' diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx index 313c0b0b47..ce2bbdf6a1 100644 --- a/src/components/Navbar/index.tsx +++ b/src/components/Navbar/index.tsx @@ -36,7 +36,7 @@ export default function NavBar() { activeStyle={{ color: '#FFA800', fontWeight: 500 }} isActive={(match, location) => location.pathname.includes('settings')} to={{ - pathname: '/settings/default/general', + pathname: '/settings/default/general' }} > {t('Settings')} diff --git a/src/components/UI/Header/index.tsx b/src/components/UI/Header/index.tsx index 0d808e0529..e265c8daf0 100644 --- a/src/components/UI/Header/index.tsx +++ b/src/components/UI/Header/index.tsx @@ -25,7 +25,7 @@ export default function Header({ handleFilter, handleLayout, goTo, - title, + title }: Props) { const { t } = useTranslation() const { filter, libraryStatus, layout } = useContext(ContextProvider) diff --git a/src/components/UI/LanguageSelector/index.tsx b/src/components/UI/LanguageSelector/index.tsx index 7b31989cc6..7fd4db5e4d 100644 --- a/src/components/UI/LanguageSelector/index.tsx +++ b/src/components/UI/LanguageSelector/index.tsx @@ -17,7 +17,7 @@ export default function LanguageSelector({ handleLanguageChange, currentLanguage = 'en', className = 'settingSelect', - flagPossition = FlagPosition.NONE, + flagPossition = FlagPosition.NONE }: Props) { const languageLabels: { [key: string]: string } = { de: 'Deutsch', @@ -29,7 +29,7 @@ export default function LanguageSelector({ pl: 'Polski', pt: 'Português', ru: 'Русский', - tr: 'Türkçe', + tr: 'Türkçe' } const languageFlags: { [key: string]: string } = { @@ -42,7 +42,7 @@ export default function LanguageSelector({ pl: '🇵🇱', pt: '🇵🇹', ru: '🇷🇺', - tr: '🇹🇷', + tr: '🇹🇷' } const renderOption = (lang: string) => { diff --git a/src/components/utils.ts b/src/components/utils.ts index f8bf02ed49..be7f282a8a 100644 --- a/src/components/utils.ts +++ b/src/components/utils.ts @@ -2,7 +2,7 @@ import { getGameInfo, handleStopInstallation, importGame, - install, + install } from 'src/helpers' import { GameStatus } from 'src/types' @@ -10,7 +10,7 @@ import { TFunction } from 'react-i18next' const { remote } = window.require('electron') const { - dialog: { showOpenDialog }, + dialog: { showOpenDialog } } = remote interface Install { @@ -26,7 +26,7 @@ export async function handleInstall({ isInstalling, installPath, handleGameStatus, - t, + t }: Install) { if (isInstalling) { const { folderName } = await getGameInfo(appName) @@ -47,7 +47,7 @@ export async function handleInstall({ const { filePaths } = await showOpenDialog({ buttonLabel: t('gamepage:box.choose'), properties: ['gamepage:openDirectory'], - title: t('gamepage:box.importpath'), + title: t('gamepage:box.importpath') }) if (filePaths[0]) { @@ -62,7 +62,7 @@ export async function handleInstall({ const { filePaths } = await showOpenDialog({ buttonLabel: t('gamepage:box.choose'), properties: ['openDirectory'], - title: t('gamepage:box.installpath'), + title: t('gamepage:box.installpath') }) if (filePaths[0]) { diff --git a/src/helpers/index.ts b/src/helpers/index.ts index b694ac094d..e5b8e74f7f 100644 --- a/src/helpers/index.ts +++ b/src/helpers/index.ts @@ -9,7 +9,7 @@ const { ipcRenderer, remote } = window.require('electron') as { } const { BrowserWindow, - dialog: { showMessageBox }, + dialog: { showMessageBox } } = remote const readFile = async (file: string) => @@ -82,7 +82,7 @@ const syncSaves = async ( const response: string = await ipcRenderer.invoke('syncSaves', [ arg, path, - appName, + appName ]) return response } @@ -243,10 +243,10 @@ async function handleStopInstallation( buttons: [ t('gamepage:box.stopInstall.keepInstalling'), t('box.yes'), - t('box.no'), + t('box.no') ], message: t('gamepage:box.stopInstall.message'), - title: t('gamepage:box.stopInstall.title'), + title: t('gamepage:box.stopInstall.title') }) if (response === 1) { return sendKill(appName) @@ -282,5 +282,5 @@ export { sidInfoPage, syncSaves, updateGame, - writeConfig, + writeConfig } diff --git a/src/index.tsx b/src/index.tsx index 9c8c65c1ac..e34f4e0658 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -13,7 +13,7 @@ import UpdateComponent from 'src/components/UI/UpdateComponent' const Backend = new HttpApi(null, { addPath: 'build/locales/{{lng}}/{{ns}}', allowMultiLoading: false, - loadPath: 'locales/{{lng}}/{{ns}}.json', + loadPath: 'locales/{{lng}}/{{ns}}.json' }) i18next @@ -27,13 +27,13 @@ i18next .init({ fallbackLng: 'en', interpolation: { - escapeValue: false, + escapeValue: false }, lng: 'en', react: { - useSuspense: true, + useSuspense: true }, - supportedLngs: ['de', 'en', 'es', 'fr', 'nl', 'pl', 'pt', 'ru', 'tr', 'hu'], + supportedLngs: ['de', 'en', 'es', 'fr', 'nl', 'pl', 'pt', 'ru', 'tr', 'hu'] }) ReactDOM.render( diff --git a/src/screens/Game/GamePage/index.tsx b/src/screens/Game/GamePage/index.tsx index 2a89a537d5..8b0e42650f 100644 --- a/src/screens/Game/GamePage/index.tsx +++ b/src/screens/Game/GamePage/index.tsx @@ -14,7 +14,7 @@ import { legendary, sendKill, syncSaves, - updateGame, + updateGame } from 'src/helpers' import React, { Fragment, useContext, useEffect, useState } from 'react' @@ -32,7 +32,7 @@ const { ipcRenderer, remote } = window.require('electron') as { remote: Remote } const { - dialog: { showOpenDialog, showMessageBox }, + dialog: { showOpenDialog, showMessageBox } } = remote // This component is becoming really complex and it needs to be refactored in smaller ones @@ -49,7 +49,7 @@ export default function GamePage(): JSX.Element | null { libraryStatus, handleGameStatus, data, - gameUpdates, + gameUpdates } = useContext(ContextProvider) const gameStatus: GameStatus = libraryStatus.filter( (game: GameStatus) => game.appName === appName @@ -61,7 +61,7 @@ export default function GamePage(): JSX.Element | null { const [progress, setProgress] = useState({ bytes: '0.00MiB', eta: '00:00:00', - percent: '0.00%', + percent: '0.00%' } as InstallProgress) const [installPath, setInstallPath] = useState('default') const [defaultPath, setDefaultPath] = useState('...') @@ -85,7 +85,7 @@ export default function GamePage(): JSX.Element | null { autoSyncSaves, winePrefix, wineVersion, - savesPath, + savesPath }: AppSettings = await ipcRenderer.invoke('requestSettings', appName) const isProton = wineVersion?.name?.includes('Proton') || false setAutoSyncSaves(autoSyncSaves) @@ -124,7 +124,7 @@ export default function GamePage(): JSX.Element | null { handleGameStatus({ appName, progress: getProgress(progress), - status, + status }) } }, 1500) @@ -144,7 +144,7 @@ export default function GamePage(): JSX.Element | null { version, extraInfo, developer, - cloudSaveEnabled, + cloudSaveEnabled }: Game = gameInfo if (savesPath.includes('{InstallDir}')) { @@ -198,14 +198,14 @@ export default function GamePage(): JSX.Element | null { ? extraInfo.about.shortDescription ? extraInfo.about.shortDescription : extraInfo.about.description - ? extraInfo.about.description - : '' + ? extraInfo.about.description + : '' : ''} {cloudSaveEnabled && (
{t('info.syncsaves')}:{' '} @@ -244,7 +244,7 @@ export default function GamePage(): JSX.Element | null { style={{ color: isInstalled || isInstalling ? '#0BD58C' : '#BD0A0A', - fontStyle: 'italic', + fontStyle: 'italic' }} > {getInstallLabel(isInstalled)} @@ -438,7 +438,7 @@ export default function GamePage(): JSX.Element | null { const { response } = await showMessageBox({ buttons: [t('box.yes'), t('box.no')], message: t('box.update.message'), - title: t('box.update.title'), + title: t('box.update.title') }) if (response === 0) { @@ -493,7 +493,7 @@ export default function GamePage(): JSX.Element | null { const { filePaths } = await showOpenDialog({ buttonLabel: t('box.choose'), properties: ['openDirectory'], - title: t('box.importpath'), + title: t('box.importpath') }) if (filePaths[0]) { @@ -508,7 +508,7 @@ export default function GamePage(): JSX.Element | null { const { filePaths } = await showOpenDialog({ buttonLabel: t('box.choose'), properties: ['openDirectory'], - title: t('box.installpath'), + title: t('box.installpath') }) if (filePaths[0]) { @@ -530,7 +530,7 @@ export default function GamePage(): JSX.Element | null { buttons: [t('box.yes'), t('box.no')], message: t('box.uninstall.message'), title: t('box.uninstall.title'), - type: 'warning', + type: 'warning' }) if (response === 0) { diff --git a/src/screens/Game/GameSubMenu/index.tsx b/src/screens/Game/GameSubMenu/index.tsx index d8426d1100..72332b9268 100644 --- a/src/screens/Game/GameSubMenu/index.tsx +++ b/src/screens/Game/GameSubMenu/index.tsx @@ -8,14 +8,14 @@ import { createNewWindow, formatStoreUrl, repair, - updateGame, + updateGame } from 'src/helpers' import { useTranslation } from 'react-i18next' import ContextProvider from 'src/state/ContextProvider' const { ipcRenderer, remote } = window.require('electron') const { - dialog: { showMessageBox, showOpenDialog }, + dialog: { showMessageBox, showOpenDialog } } = remote const renderer: IpcRenderer = ipcRenderer @@ -31,7 +31,7 @@ export default function GamesSubmenu({ appName, isInstalled, title, - clicked, + clicked }: Props) { const { handleGameStatus, refresh, gameUpdates } = useContext(ContextProvider) @@ -48,13 +48,13 @@ export default function GamesSubmenu({ const { response } = await showMessageBox({ buttons: [t('box.yes'), t('box.no')], message: t('box.move.message'), - title: t('box.move.title'), + title: t('box.move.title') }) if (response === 0) { const { filePaths } = await showOpenDialog({ buttonLabel: t('box.choose'), properties: ['openDirectory'], - title: t('box.move.path'), + title: t('box.move.path') }) if (filePaths[0]) { const path = filePaths[0] @@ -71,13 +71,13 @@ export default function GamesSubmenu({ const { response } = await showMessageBox({ buttons: [t('box.yes'), t('box.no')], message: t('box.change.message'), - title: t('box.change.title'), + title: t('box.change.title') }) if (response === 0) { const { filePaths } = await showOpenDialog({ buttonLabel: t('box.choose'), properties: ['openDirectory'], - title: t('box.change.path'), + title: t('box.change.path') }) if (filePaths[0]) { const path = filePaths[0] @@ -93,7 +93,7 @@ export default function GamesSubmenu({ const { response } = await showMessageBox({ buttons: [t('box.yes'), t('box.no')], message: t('box.update.message'), - title: t('box.update.title'), + title: t('box.update.title') }) if (response === 0) { @@ -108,7 +108,7 @@ export default function GamesSubmenu({ const { response } = await showMessageBox({ buttons: [t('box.yes'), t('box.no')], message: t('box.repair.message'), - title: t('box.repair.title'), + title: t('box.repair.title') }) if (response === 1) { @@ -128,7 +128,7 @@ export default function GamesSubmenu({ className="hidden link" to={{ pathname: `/settings/${appName}/wine`, - state: { fromGameCard: false }, + state: { fromGameCard: false } }} > {t('submenu.settings')} diff --git a/src/screens/Library/components/GameCard/index.tsx b/src/screens/Library/components/GameCard/index.tsx index c13ef72f12..e594668a33 100644 --- a/src/screens/Library/components/GameCard/index.tsx +++ b/src/screens/Library/components/GameCard/index.tsx @@ -19,7 +19,7 @@ import NewReleasesIcon from '@material-ui/icons/NewReleases' const { ipcRenderer, remote } = window.require('electron') const { - dialog: { showMessageBox }, + dialog: { showMessageBox } } = remote interface Card { appName: string @@ -47,12 +47,12 @@ const GameCard = ({ logo, coverList, size, - hasUpdate, + hasUpdate }: Card) => { const [progress, setProgress] = useState({ bytes: '0/0MB', eta: '', - percent: '0.00%', + percent: '0.00%' } as InstallProgress) const { t } = useTranslation('gamepage') @@ -126,7 +126,7 @@ const GameCard = ({ {haveStatus && {getStatus()}} @@ -144,7 +144,7 @@ const GameCard = ({ alt="logo" src={`${logo}?h=400&resize=1&w=300`} style={{ - filter: isInstalled ? 'none' : `grayscale(${effectPercent})`, + filter: isInstalled ? 'none' : `grayscale(${effectPercent})` }} className="gameLogo" /> @@ -159,7 +159,7 @@ const GameCard = ({ className="icons" style={{ flexDirection: 'row', - width: isInstalled ? '44%' : 'auto', + width: isInstalled ? '44%' : 'auto' }} > {renderIcon()} @@ -167,7 +167,7 @@ const GameCard = ({ @@ -187,7 +187,7 @@ const GameCard = ({ @@ -209,7 +209,7 @@ const GameCard = ({ handleGameStatus, installPath: 'another', isInstalling, - t, + t }) } if (status === 'playing' || status === 'updating') { @@ -230,7 +230,7 @@ const GameCard = ({ const { response } = await showMessageBox({ buttons: [t('box.yes'), t('box.no')], message: t('box.update.message'), - title: t('box.update.title'), + title: t('box.update.title') }) if (response === 0) { diff --git a/src/screens/Library/index.tsx b/src/screens/Library/index.tsx index 0e2860a14c..11cd105a9a 100644 --- a/src/screens/Library/index.tsx +++ b/src/screens/Library/index.tsx @@ -35,7 +35,7 @@ export const Library = ({ library }: Props) => { style={!library.length ? { backgroundColor: 'transparent' } : {}} className={cx({ gameList: layout === 'grid', - gameListLayout: layout !== 'grid', + gameListLayout: layout !== 'grid' })} > {!!library.length && @@ -49,7 +49,7 @@ export const Library = ({ library }: Props) => { isInstalled, version, install_size, - is_dlc, + is_dlc }: Game) => { if (is_dlc) { return null diff --git a/src/screens/Login/index.tsx b/src/screens/Login/index.tsx index f2a60eb23e..7e227e631a 100644 --- a/src/screens/Login/index.tsx +++ b/src/screens/Login/index.tsx @@ -5,7 +5,7 @@ import React, { useState } from 'react' import { legendary, loginPage, sidInfoPage } from 'src/helpers' import { useTranslation } from 'react-i18next' import LanguageSelector, { - FlagPosition, + FlagPosition } from 'src/components/UI/LanguageSelector' import Autorenew from '@material-ui/icons/Autorenew' @@ -23,7 +23,7 @@ export default function Login({ refresh }: Props) { const [input, setInput] = useState('') const [status, setStatus] = useState({ loading: false, - message: '', + message: '' }) const { loading, message } = status @@ -37,14 +37,14 @@ export default function Login({ refresh }: Props) { const handleLogin = async (sid: string) => { setStatus({ loading: true, - message: t('status.logging', 'Logging In...'), + message: t('status.logging', 'Logging In...') }) await legendary(`auth --sid ${sid}`).then(async (res) => { if (res !== 'error') { setStatus({ loading: true, - message: t('status.loading', 'Loading Game list, please wait'), + message: t('status.loading', 'Loading Game list, please wait') }) await legendary(`list-games`) @@ -129,7 +129,7 @@ export default function Login({ refresh }: Props) { justifyContent: 'flex-end', marginBottom: '22px', paddingRight: '22px', - width: '100%', + width: '100%' }} > { await showMessageBox({ message: t('message.unsync'), - title: 'EGS Sync', + title: 'EGS Sync' }) setEgsLinkedPath('') setEgsPath('') @@ -96,7 +96,7 @@ export default function GeneralSettings({ } await dialog.showMessageBox({ message: t('message.sync'), - title: 'EGS Sync', + title: 'EGS Sync' }) setIsSyncing(false) @@ -135,7 +135,7 @@ export default function GeneralSettings({ showOpenDialog({ buttonLabel: t('box.choose'), properties: ['openDirectory'], - title: t('box.default-install-path'), + title: t('box.default-install-path') }).then(({ filePaths }: Path) => setDefaultInstallPath(filePaths[0] ? `'${filePaths[0]}'` : '') ) @@ -162,14 +162,14 @@ export default function GeneralSettings({ isLinked ? '' : dialog - .showOpenDialog({ - buttonLabel: t('box.choose'), - properties: ['openDirectory'], - title: t('box.choose-egs-prefix'), - }) - .then(({ filePaths }: Path) => - setEgsPath(filePaths[0] ? `'${filePaths[0]}'` : '') - ) + .showOpenDialog({ + buttonLabel: t('box.choose'), + properties: ['openDirectory'], + title: t('box.choose-egs-prefix') + }) + .then(({ filePaths }: Path) => + setEgsPath(filePaths[0] ? `'${filePaths[0]}'` : '') + ) } /> ) : ( @@ -194,8 +194,8 @@ export default function GeneralSettings({ isLinked ? t('button.unsync') : isSyncing - ? t('button.syncing') - : t('button.sync') + ? t('button.syncing') + : t('button.sync') }`} diff --git a/src/screens/Settings/components/OtherSettings/index.tsx b/src/screens/Settings/components/OtherSettings/index.tsx index d39787b71f..c3e4ed94aa 100644 --- a/src/screens/Settings/components/OtherSettings/index.tsx +++ b/src/screens/Settings/components/OtherSettings/index.tsx @@ -38,7 +38,7 @@ export default function OtherSettings({ toggleAudioFix, showMangohud, toggleMangoHud, - isDefault, + isDefault }: Props) { const handleOtherOptions = (event: ChangeEvent) => setOtherOptions(event.currentTarget.value) diff --git a/src/screens/Settings/components/SyncSaves/index.tsx b/src/screens/Settings/components/SyncSaves/index.tsx index f933d9bd90..467c8ef296 100644 --- a/src/screens/Settings/components/SyncSaves/index.tsx +++ b/src/screens/Settings/components/SyncSaves/index.tsx @@ -10,7 +10,7 @@ import Backspace from '@material-ui/icons/Backspace' import CreateNewFolder from '@material-ui/icons/CreateNewFolder' const { - remote: { dialog }, + remote: { dialog } } = window.require('electron') interface Props { @@ -32,7 +32,7 @@ export default function SyncSaves({ setAutoSyncSaves, defaultFolder, isProton, - winePrefix, + winePrefix }: Props) { const [isSyncing, setIsSyncing] = useState(false) const [syncType, setSyncType] = useState('Download' as SyncType) @@ -57,7 +57,7 @@ export default function SyncSaves({ t('setting.manualsync.download'), t('setting.manualsync.upload'), t('setting.manualsync.forcedownload'), - t('setting.manualsync.forceupload'), + t('setting.manualsync.forceupload') ] async function handleSync() { setIsSyncing(true) @@ -65,7 +65,7 @@ export default function SyncSaves({ Download: '--skip-upload', 'Force download': '--force-download', 'Force upload': '--force-upload', - Upload: '--skip-download', + Upload: '--skip-download' } await syncSaves(savesPath, appName, command[syncType]).then((res: string) => @@ -95,15 +95,15 @@ export default function SyncSaves({ isLinked ? '' : dialog - .showOpenDialog({ - buttonLabel: t('box.sync.button'), - defaultPath: defaultFolder, - properties: ['openDirectory'], - title: t('box.sync.title'), - }) - .then(({ filePaths }: Path) => - setSavesPath(filePaths[0] ? `${filePaths[0]}` : '') - ) + .showOpenDialog({ + buttonLabel: t('box.sync.button'), + defaultPath: defaultFolder, + properties: ['openDirectory'], + title: t('box.sync.title') + }) + .then(({ filePaths }: Path) => + setSavesPath(filePaths[0] ? `${filePaths[0]}` : '') + ) } /> ) : ( @@ -121,7 +121,7 @@ export default function SyncSaves({ style={{ display: 'flex', justifyContent: 'space-between', - width: '513px', + width: '513px' }} >