diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index ceed37a..3dac663 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -23,4 +23,4 @@ jobs: run: npm install - name: Run ESLint - run: npx eslint . --max-warnings 0 + run: npx eslint . diff --git a/build.js b/build.js index 668e6d4..5438efc 100644 --- a/build.js +++ b/build.js @@ -99,14 +99,15 @@ if (!build_type) { return JSON.parse(fs.readFileSync(coresJsonPath, 'utf8')); }; - if (build_type === "emulatorjs") { - console.log(`Current EmulatorJS Version: ${version}`); - removeLogo(); - console.log("Ready to build EmulatorJS!"); - } else if (build_type === "get-cores") { - const cores = await getCores(); - console.log(JSON.stringify(cores.map(coreName => coreName.name))); - } else if (build_type === "cores") { + const main = async () => { + if (build_type === "emulatorjs") { + console.log(`Current EmulatorJS Version: ${version}`); + removeLogo(); + console.log("Ready to build EmulatorJS!"); + } else if (build_type === "get-cores") { + const cores = await getCores(); + console.log(JSON.stringify(cores.map(coreName => coreName.name))); + } else if (build_type === "cores") { console.log(`Current EmulatorJS Version: ${version}`); console.log("Building cores..."); const allCores = await getCores(); @@ -177,7 +178,10 @@ if (!build_type) { packageJson.dependencies[`@emulatorjs/core-${core}`] = "latest"; fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 4), 'utf8'); } - console.log("EmulatorJS cores built successfully!"); - console.log("Ready to build EmulatorJS!"); - } + console.log("EmulatorJS cores built successfully!"); + console.log("Ready to build EmulatorJS!"); + } + }; + + main(); } diff --git a/data/src/gamepad.js b/data/src/gamepad.js index 22095ab..149830f 100644 --- a/data/src/gamepad.js +++ b/data/src/gamepad.js @@ -1,7 +1,4 @@ class GamepadHandler { - gamepads; - timeout; - listeners; constructor() { this.buttonLabels = { 0: 'BUTTON_1', diff --git a/minify/minify.js b/minify/minify.js index af1f375..25bbcd5 100644 --- a/minify/minify.js +++ b/minify/minify.js @@ -14,10 +14,10 @@ async function doMinify() { input: path.join(rootPath, "data/src/*.js"), output: path.join(rootPath, "data/emulator.min.js"), }) - .catch(function (err) { + .catch((err) => { console.error(err); }) - .then(function() { + .then(() => { console.log("Minified JS"); }); await minify({ @@ -25,14 +25,16 @@ async function doMinify() { input: path.join(rootPath, "data/emulator.css"), output: path.join(rootPath, "data/emulator.min.css"), }) - .catch(function (err) { + .catch((err) => { console.error(err); }) - .then(function() { + .then(() => { console.log("Minified CSS"); }); } console.log("Minifying"); -await doMinify(); -console.log("Minifying Done!"); +(async () => { + await doMinify(); + console.log("Minifying Done!"); +})(); diff --git a/update.js b/update.js index 44e3a35..1379f61 100644 --- a/update.js +++ b/update.js @@ -116,20 +116,22 @@ const updateContributors = async () => { console.log("Updated Contributors.md with new contributors."); } -console.log(`Current EmulatorJS Version: ${version}`); -if (!update_version) { - console.warn("Warning: Version number not provided."); -} else { - console.log(`Updating EmulatorJS Version number to: ${update_version}`); -} +(async () => { + console.log(`Current EmulatorJS Version: ${version}`); + if (!update_version) { + console.warn("Warning: Version number not provided."); + } else { + console.log(`Updating EmulatorJS Version number to: ${update_version}`); + } -console.log("Updating EmulatorJS dependencies..."); -if (depsArg) { - await updateDependencies(); -} -if (update_version || dev === "false" || dev === "true") { - console.log("Updating EmulatorJS version..."); - await updateVersion(update_version || version); -} -await updateContributors(); -console.log("Updating EmulatorJS completed."); + console.log("Updating EmulatorJS dependencies..."); + if (depsArg) { + await updateDependencies(); + } + if (update_version || dev === "false" || dev === "true") { + console.log("Updating EmulatorJS version..."); + await updateVersion(update_version || version); + } + await updateContributors(); + console.log("Updating EmulatorJS completed."); +})();