diff --git a/.eslintrc.yml b/.eslintrc.yml index 3fcb4f647c..2845afde4f 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -10,6 +10,9 @@ rules: comma-spacing: - 2 - {before: false, after: true} + keyword-spacing: + - 2 + - {before: true, after: true} no-trailing-spaces: 2 indent: - 2 diff --git a/Applications/Games/League of Legends/Online/script.js b/Applications/Games/League of Legends/Online/script.js index 854c1c08d2..69a7fb361a 100644 --- a/Applications/Games/League of Legends/Online/script.js +++ b/Applications/Games/League of Legends/Online/script.js @@ -26,7 +26,7 @@ new CustomInstallerScript() var selectedRegion = wizard.menu(tr("Select your region:"), regions); var regionID, url, sha1; var baseUrl = "https://riotgamespatcher-a.akamaihd.net/ShellInstaller/"; - switch(selectedRegion.text){ + switch (selectedRegion.text){ case "EU West": regionID = "EUW"; url = baseUrl+"EUW/LeagueofLegends_EUW_Installer_2016_11_10.exe"; diff --git a/Applications/Games/Tom Clancy's Rainbow Six 3 : Raven Shield/Local (1.0->1.6)/script.js b/Applications/Games/Tom Clancy's Rainbow Six 3 : Raven Shield/Local (1.0->1.6)/script.js index b795834e48..2ed0240f84 100644 --- a/Applications/Games/Tom Clancy's Rainbow Six 3 : Raven Shield/Local (1.0->1.6)/script.js +++ b/Applications/Games/Tom Clancy's Rainbow Six 3 : Raven Shield/Local (1.0->1.6)/script.js @@ -12,7 +12,7 @@ new LocalInstallerScript() var exeName, url, sha1; var originDirectory = wine.prefixDirectory + "drive_c/users/Public/Documents/"; - switch(selectedRegion.text){ + switch (selectedRegion.text){ case "France": exeName = "RVSPatch_1.0_To_1.60_FRA.exe"; url = "http://ftp.ubi.com/us/games/ravenshield/RVSPatch_1.0_To_1.60_FRA.exe"; diff --git a/Engines/Wine/Engine/Object/script.js b/Engines/Wine/Engine/Object/script.js index 700bce8156..ed09e712c7 100644 --- a/Engines/Wine/Engine/Object/script.js +++ b/Engines/Wine/Engine/Object/script.js @@ -201,11 +201,11 @@ Wine.prototype.run = function (executable, args, captureOutput) { var extensionFile = executable.split(".").pop(); - if(extensionFile == "msi") { + if (extensionFile == "msi") { return this.run("msiexec", ["/i", executable].concat(args), captureOutput); } - if(extensionFile == "bat") { + if (extensionFile == "bat") { return this.run("start", ["/Unix", executable].concat(args), captureOutput); } @@ -849,7 +849,7 @@ Wine.prototype.windowsVersion = function (version, servicePack) { "[HKEY_CURRENT_USER\\Software\\Wine]\n" + "\"Version\"=\"" + version + "\"\n"; - if(servicePack) { + if (servicePack) { var servicePackNumber = servicePack.replace("sp", ""); that._regeditFileContent += "[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion]"; that._regeditFileContent += "\"CSDVersion\"=\"Service Pack "+ servicePackNumber +"\""; diff --git a/Engines/Wine/QuickScript/Quick Script/script.js b/Engines/Wine/QuickScript/Quick Script/script.js index 5c9540adcd..9780571a19 100644 --- a/Engines/Wine/QuickScript/Quick Script/script.js +++ b/Engines/Wine/QuickScript/Quick Script/script.js @@ -125,7 +125,7 @@ QuickScript.prototype._createShortcut = function(prefix) { .search(this._executable) .arguments(this._executableArgs); - if(this.miniature().isPresent()) { + if (this.miniature().isPresent()) { shortcut.miniature(this.miniature().get()) } shortcut.create(); diff --git a/Engines/Wine/Shortcuts/Reader/script.js b/Engines/Wine/Shortcuts/Reader/script.js index 4f2c993bbe..79878c65b7 100644 --- a/Engines/Wine/Shortcuts/Reader/script.js +++ b/Engines/Wine/Shortcuts/Reader/script.js @@ -19,7 +19,7 @@ var _WineShortcutReader = function(shortcut) { this.run = function(userArguments) { var shortcutContent = JSON.parse(this.shortcut.script); - if(!userArguments) { + if (!userArguments) { userArguments = []; } @@ -50,7 +50,7 @@ var _WineShortcutReader = function(shortcut) { shortcutCategory.getShortcuts().forEach(function(shortcut) { var _otherShortcutContent = JSON.parse(shortcut.script); - if(_otherShortcutContent.winePrefix == _winePrefix && shortcut.name != that.shortcut.name) { + if (_otherShortcutContent.winePrefix == _winePrefix && shortcut.name != that.shortcut.name) { _found = true; } }); @@ -58,7 +58,7 @@ var _WineShortcutReader = function(shortcut) { this._shortcutManager.deleteShortcut(this.shortcut); - if(!_found) { + if (!_found) { this._uiQuestionFactory.create(tr("The container {0} is no longer used.\nDo you want to delete it?", _winePrefix), function() { remove(that._winePrefixesDirectory + _winePrefix); @@ -83,7 +83,7 @@ ShortcutReader.prototype.of = function (shortcut) { this.shortcut = shortcut; var shortcutContentParsed = JSON.parse(this.shortcut.script); - if(shortcutContentParsed.type == "WINE") { + if (shortcutContentParsed.type == "WINE") { this._runner = new _WineShortcutReader(this.shortcut); } } diff --git a/Engines/Wine/Shortcuts/Wine/script.js b/Engines/Wine/Shortcuts/Wine/script.js index ff83b67d38..a1c799efc9 100644 --- a/Engines/Wine/Shortcuts/Wine/script.js +++ b/Engines/Wine/Shortcuts/Wine/script.js @@ -93,10 +93,10 @@ WineShortcut.prototype.prefix = function (prefix) { * @returns {WineShortcut} WineShortcut object */ WineShortcut.prototype.miniature = function (miniature) { - if(isArray(miniature)) { + if (isArray(miniature)) { // application of miniature given var application = this._appsManager.getApplication(miniature); - if(application != null && application.getMainMiniature().isPresent()) { + if (application != null && application.getMainMiniature().isPresent()) { this._miniature = application.getMainMiniature().get(); } } else { @@ -138,7 +138,7 @@ WineShortcut.prototype.create = function () { executable: executables[0].getAbsolutePath() })); - if(this._miniature) { + if (this._miniature) { builder.withMiniature(this._miniature); } diff --git a/Engines/Wine/Verbs/dotnet45/script.js b/Engines/Wine/Verbs/dotnet45/script.js index 2e2cd4b8f6..001186c386 100644 --- a/Engines/Wine/Verbs/dotnet45/script.js +++ b/Engines/Wine/Verbs/dotnet45/script.js @@ -46,7 +46,7 @@ Wine.prototype.dotnet45 = function() { this.windowsVersion(OSVersion); - if(OSVersion != "win2003") { + if (OSVersion != "win2003") { print(tr("{0} applications can have issues when windows version is not set to \"win2003\"", ".NET 4.5")); } diff --git a/Engines/Wine/Verbs/dotnet452/script.js b/Engines/Wine/Verbs/dotnet452/script.js index 692f5b5999..74d76e4e44 100644 --- a/Engines/Wine/Verbs/dotnet452/script.js +++ b/Engines/Wine/Verbs/dotnet452/script.js @@ -45,7 +45,7 @@ Wine.prototype.dotnet452 = function() { this.windowsVersion(OSVersion); - if(OSVersion != "win2003") { + if (OSVersion != "win2003") { print(tr("{0} applications can have issues when windows version is not set to \"win2003\"", ".NET 4.5.2")); } diff --git a/Utils/Functions/Apps/Resources/script.js b/Utils/Functions/Apps/Resources/script.js index 9160411fed..9e635ecb52 100644 --- a/Utils/Functions/Apps/Resources/script.js +++ b/Utils/Functions/Apps/Resources/script.js @@ -26,7 +26,7 @@ AppResource.prototype.get = function (resourceName) { var foundResource = null; if (application != null && application.resources != null) { application.resources.forEach(function(resource) { - if(resource.name == resourceName) { + if (resource.name == resourceName) { foundResource = resource.content; } }); diff --git a/Utils/Functions/Filesystem/Extract/script.js b/Utils/Functions/Filesystem/Extract/script.js index 8241d9ea2e..67f62525c3 100644 --- a/Utils/Functions/Filesystem/Extract/script.js +++ b/Utils/Functions/Filesystem/Extract/script.js @@ -57,12 +57,12 @@ CabExtract.prototype.extract = function (args) { this._progressMessage = tr("Please wait while {0} is extracted ...", this._archive); } - if(this._wizard) { + if (this._wizard) { var progressBar = this._wizard.progressBar(this._progressMessage); } var processArguments; - if(args) { + if (args) { processArguments = ["cabextract"].concat(args).concat([this._archive]); } else { processArguments = ["cabextract", this._archive]; diff --git a/Utils/Functions/Filesystem/Files/script.js b/Utils/Functions/Filesystem/Files/script.js index 9f216cfc71..ddc4bdac87 100644 --- a/Utils/Functions/Filesystem/Files/script.js +++ b/Utils/Functions/Filesystem/Files/script.js @@ -150,12 +150,12 @@ Checksum.prototype.of = function (file) { * @returns {string} calculated checksum */ Checksum.prototype.get = function () { - if(this._wizard) { + if (this._wizard) { var progressBar = this._wizard.progressBar(tr("Checking file consistency ...")); } return this._checksumCalculator.calculate(this._file, this._method, function (progressEntity) { - if(progressBar) { + if (progressBar) { progressBar.accept(progressEntity); } }); diff --git a/Utils/Functions/Net/Download/script.js b/Utils/Functions/Net/Download/script.js index a14df44be2..774bbb4b76 100644 --- a/Utils/Functions/Net/Download/script.js +++ b/Utils/Functions/Net/Download/script.js @@ -97,7 +97,7 @@ Downloader.prototype.get = function () { this._message = tr("Please wait while {0} is downloaded ...", this._fetchFileNameFromUrl(this._url)); } - if(this._wizard) { + if (this._wizard) { var progressBar = this._wizard.progressBar(this._message); } diff --git a/Utils/Functions/Net/Resource/script.js b/Utils/Functions/Net/Resource/script.js index 6d8b987f5e..d95d5a01a1 100644 --- a/Utils/Functions/Net/Resource/script.js +++ b/Utils/Functions/Net/Resource/script.js @@ -92,7 +92,7 @@ Resource.prototype.get = function () { .method(this._algorithm) .get(); - if(fileChecksum == this._checksum) { + if (fileChecksum == this._checksum) { return resourcePath; } }