remove eslint errors

This commit is contained in:
MathieuG-P
2022-08-06 20:24:34 +02:00
parent 76425e6c15
commit 54765c098b
3 changed files with 14 additions and 6 deletions
+4 -1
View File
@@ -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,
@@ -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<string>(async (resolve, reject) => {
return new Promise<string>((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<string>{
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, '' );
}
@@ -96,10 +96,10 @@ export class BsDownloaderService{
return {success: false};
}
this.authService.setSteamSession(res.data.username, res.data.stay);
promise = this.ipcService.send<DownloadEvent>('bs-download.start', {args: {bsVersion: bsVersion, username: res.data.username, password: res.data.password, stay: res.data.stay}});
promise = this.ipcService.send<DownloadEvent>('bs-download.start', {args: {bsVersion, username: res.data.username, password: res.data.password, stay: res.data.stay}});
}
else{
promise = this.ipcService.send<DownloadEvent>('bs-download.start', {args: {bsVersion: bsVersion, username: this.authService.getSteamUsername()}});
promise = this.ipcService.send<DownloadEvent>('bs-download.start', {args: {bsVersion, username: this.authService.getSteamUsername()}});
}
this.currentBsVersionDownload$.next(bsVersion);