Skip to content

Commit 4d87a17

Browse files
authored
ESLint: do not use var, prefer const (#1180)
1 parent 0718546 commit 4d87a17

File tree

27 files changed

+67
-63
lines changed

27 files changed

+67
-63
lines changed

.eslintrc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ rules:
3232
- 2
3333
- unix
3434
prefer-arrow-callback: 2
35+
no-var:
36+
- 2
37+
prefer-const:
38+
- 2
3539

3640
globals:
3741
include: false

Applications/Games/Age of Empires II HD/Steam/script.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ new SteamScript()
88
.appId(221380)
99
.postInstall((wine /*, wizard*/) => {
1010
// skip broken launcher by replacing it with "AoK HD.exe"
11-
var installPath = wine.prefixDirectory() + "drive_c/" + wine.programFiles() + "/Steam/steamapps/common/Age2HD/";
12-
var launcher = installPath + "Launcher.exe";
11+
const installPath = wine.prefixDirectory() + "drive_c/" + wine.programFiles() + "/Steam/steamapps/common/Age2HD/";
12+
const launcher = installPath + "Launcher.exe";
1313
cp(launcher, launcher + ".bak");
1414
remove(launcher);
15-
var aoe = installPath + "AoK HD.exe";
15+
const aoe = installPath + "AoK HD.exe";
1616
lns(aoe, launcher);
1717
});

Applications/Games/Anno 2070/Local/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ new LocalInstallerScript()
2828
new OverrideDLL(wine).withMode("native, builtin", ["winhttp", "msvcrt40", "msvcr100", "crypt32"]).go();
2929
})
3030
.postInstall((wine) => {
31-
var versionFile = wine.prefixDirectory() + "/drive_c/Ubisoft/Related Designs/ANNO 2070/update/version.txt";
31+
const versionFile = wine.prefixDirectory() + "/drive_c/Ubisoft/Related Designs/ANNO 2070/update/version.txt";
3232
touch(versionFile);
3333
writeToFile(
3434
versionFile,

Applications/Games/Enderal/Steam/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ new SteamScript()
99
.applicationHomepage("http://sureai.net/games/enderal/")
1010
.postInstall((wine, wizard) => {
1111
// the SteamScript has installed Skyrim, now install Enderal
12-
var launcher =
12+
const launcher =
1313
wine.prefixDirectory() + "drive_c/" + wine.programFiles() + "/Steam/steamapps/common/Skyrim/Enderal Launcher.exe";
1414
new Downloader()
1515
.wizard(wizard)

Applications/Games/League of Legends/Online/script.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ new CustomInstallerScript()
1919
.installationCommand((wizard) => {
2020
// Select the region and download the setup file
2121
////////////////////////////////////////////////
22-
var regions = [
22+
const regions = [
2323
"EU West",
2424
"Latin America North",
2525
"Latin America South",
@@ -31,9 +31,9 @@ new CustomInstallerScript()
3131
"North America",
3232
"Russia"
3333
];
34-
var selectedRegion = wizard.menu(tr("Select your region:"), regions);
35-
var url, sha1;
36-
var baseUrl = "https://riotgamespatcher-a.akamaihd.net/ShellInstaller/";
34+
const selectedRegion = wizard.menu(tr("Select your region:"), regions);
35+
let url, sha1;
36+
const baseUrl = "https://riotgamespatcher-a.akamaihd.net/ShellInstaller/";
3737
switch (selectedRegion.text) {
3838
case "EU West":
3939
url = baseUrl + "EUW/LeagueofLegends_EUW_Installer_2016_11_10.exe";
@@ -76,7 +76,7 @@ new CustomInstallerScript()
7676
sha1 = "2d462decf629cab880386407598f9c5ea6db2ef5";
7777
break;
7878
}
79-
var setupFile = new Resource()
79+
const setupFile = new Resource()
8080
.wizard(wizard)
8181
.url(url)
8282
.checksum(sha1)
@@ -103,8 +103,8 @@ new CustomInstallerScript()
103103

104104
// Create run script to start the right exe
105105
/////////////////////////////////////////
106-
var client = wine.prefixDirectory() + "drive_c/LoL/run.bat";
107-
var batContent = "start C:\\LoL\\LeagueClient.exe";
106+
const client = wine.prefixDirectory() + "drive_c/LoL/run.bat";
107+
const batContent = "start C:\\LoL\\LeagueClient.exe";
108108
writeToFile(client, batContent);
109109
})
110110
.executable("run.bat");

Applications/Games/Lego Rock Raiders/Local/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ new LocalInstallerScript()
2929
"This game needs a copy protection patch to work. It may be illegal in your country to patch copy protection. You must patch the game yourself."
3030
)
3131
);
32-
var zipLocation = wine.prefixDirectory() + "drive_c/RockRaidersCodec_490085.zip";
32+
const zipLocation = wine.prefixDirectory() + "drive_c/RockRaidersCodec_490085.zip";
3333
new Downloader()
3434
.wizard(wizard)
3535
.url("http://rrubucket.s3.amazonaws.com/RockRaidersCodec_490085.zip")

Applications/Games/Origin/Local (Legacy)/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ new LocalInstallerScript()
1919
);
2020
})
2121
.postInstall((wine, wizard) => {
22-
var originDir = wine.prefixDirectory() + "drive_c/" + wine.programFiles() + "/Origin/";
22+
const originDir = wine.prefixDirectory() + "drive_c/" + wine.programFiles() + "/Origin/";
2323

2424
new Downloader()
2525
.wizard(wizard)

Applications/Games/Origin/Online (Legacy)/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ new OnlineInstallerScript()
2020
);
2121
})
2222
.postInstall((wine, wizard) => {
23-
var originDir = wine.prefixDirectory() + "drive_c/" + wine.programFiles() + "/Origin/";
23+
const originDir = wine.prefixDirectory() + "drive_c/" + wine.programFiles() + "/Origin/";
2424

2525
new Downloader()
2626
.wizard(wizard)

Applications/Games/Rocksmith 2014/Steam/script.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ const SoundDriver = include("engines.wine.plugins.sound_driver");
55
const WindowsVersion = include("engines.wine.plugins.windows_version");
66

77
function fixIni(ini) {
8-
var screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
9-
var content =
8+
const screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
9+
const content =
1010
"[Audio]\n" +
1111
"EnableMicrophone=1\n" +
1212
"ExclusiveMode=0\n" +

Applications/Games/Rocksmith/Steam/script.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ const SoundDriver = include("engines.wine.plugins.sound_driver");
55
const WindowsVersion = include("engines.wine.plugins.windows_version");
66

77
function fixIni(ini) {
8-
var screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
9-
var content =
8+
const screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
9+
const content =
1010
"[Audio]\n" +
1111
"EnableMicrophone=0\n" +
1212
"LatencyBuffer=4\n" +

0 commit comments

Comments
 (0)