diff --git a/.eslintrc.js b/.eslintrc.js index 82f5402b..677c2e08 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,7 +25,10 @@ module.exports = { "jsx-a11y/no-static-element-interactions": "off", "react/require-default-props": "off", "consistent-return": "off", - "no-underscore-dangle": "off" + "no-underscore-dangle": "off", + "no-restricted-syntax": "off", + "@typescript-eslint/no-throw-literal": "off", + "@typescript-eslint/no-unused-expressions": "off" }, parserOptions: { ecmaVersion: 2020, diff --git a/src/main/services/bs-local-version.service.ts b/src/main/services/bs-local-version.service.ts index 697e3078..5b39fce9 100644 --- a/src/main/services/bs-local-version.service.ts +++ b/src/main/services/bs-local-version.service.ts @@ -41,12 +41,16 @@ export class BSLocalVersionService{ const versionFilePath = path.join(bsPath, 'Beat Saber_Data', 'globalgamemanagers'); if(!this.utilsService.pathExist(versionFilePath)){ return null; } const versionsAvailable = await this.remoteVersionService.getAvailableVersions(); - return new Promise(async (resolve, reject) => { + return new Promise((resolve, reject) => { const readLine = createInterface({ input: createReadStream(versionFilePath) }); let findVersion: string = null; readLine.on('line', (line) => { for(const version of versionsAvailable){ - if(line.includes(version.BSVersion)){ findVersion = version.BSVersion; readLine.close(); } + if(line.includes(version.BSVersion)){ + findVersion = version.BSVersion; + readLine.close(); + break; + } } }); readLine.on('close', () => { @@ -74,7 +78,7 @@ export class BSLocalVersionService{ } public async getVersionPath(version: BSVersion): Promise{ - if(version.steam){ return await this.steamService.getGameFolder(BS_APP_ID, "Beat Saber") } + if(version.steam){ return this.steamService.getGameFolder(BS_APP_ID, "Beat Saber") } return path.join( this.installLocationService.versionsDirectory, this.getVersionFolder(version) @@ -82,6 +86,7 @@ export class BSLocalVersionService{ } private removeSpecialChar(seq: string): string{ + // eslint-disable-next-line no-useless-escape return seq.replace( /[<>:"\/\\|?*]+/g, '' ); } diff --git a/src/renderer/services/bs-downloader.service.ts b/src/renderer/services/bs-downloader.service.ts index 67c0d7f0..926183b4 100644 --- a/src/renderer/services/bs-downloader.service.ts +++ b/src/renderer/services/bs-downloader.service.ts @@ -96,10 +96,10 @@ export class BsDownloaderService{ return {success: false}; } this.authService.setSteamSession(res.data.username, res.data.stay); - promise = this.ipcService.send('bs-download.start', {args: {bsVersion: bsVersion, username: res.data.username, password: res.data.password, stay: res.data.stay}}); + promise = this.ipcService.send('bs-download.start', {args: {bsVersion, username: res.data.username, password: res.data.password, stay: res.data.stay}}); } else{ - promise = this.ipcService.send('bs-download.start', {args: {bsVersion: bsVersion, username: this.authService.getSteamUsername()}}); + promise = this.ipcService.send('bs-download.start', {args: {bsVersion, username: this.authService.getSteamUsername()}}); } this.currentBsVersionDownload$.next(bsVersion);