From c2c8393af0b2e3bb5682078d312f0987317ff164 Mon Sep 17 00:00:00 2001 From: Odei Alba Date: Fri, 30 Aug 2024 15:56:03 +0200 Subject: [PATCH] SV-59 Fix CI warnings --- mobile/js/init.js | 5 +++++ mobile/js/mobile_sortvoting.js | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mobile/js/init.js b/mobile/js/init.js index 75fe6f0..beba5d9 100644 --- a/mobile/js/init.js +++ b/mobile/js/init.js @@ -62,6 +62,7 @@ class AddonModSortVotingProvider { votes: votes }; + /* eslint-disable promise/no-nesting */ return site.write('mod_sortvoting_save_vote', params).then((response) => { if (!response || response.success === false) { // TODO: Add warnings array to save_vote returns. @@ -71,7 +72,10 @@ class AddonModSortVotingProvider { throw error; } + + return; }); + /* eslint-enable promise/no-nesting */ }); } @@ -83,4 +87,5 @@ const result = { sortVotingProvider: sortVotingProvider, }; +// eslint-disable-next-line no-unused-expressions result; \ No newline at end of file diff --git a/mobile/js/mobile_sortvoting.js b/mobile/js/mobile_sortvoting.js index 0ded6ff..1b961d8 100644 --- a/mobile/js/mobile_sortvoting.js +++ b/mobile/js/mobile_sortvoting.js @@ -21,6 +21,7 @@ */ this.submitResponses = () => { let promise; + // eslint-disable-next-line promise/no-native promise = Promise.resolve(); promise.then(() => { // Show loading modal. @@ -39,6 +40,7 @@ this.submitResponses = () => { }); }); + /* eslint-disable promise/no-nesting */ return this.sortVotingProvider.submitResponses(this.module.instance, votes).then(() => { // Responses have been sent to server or stored to be sent later. this.CoreDomUtilsProvider.showToast(this.TranslateService.instant('plugin.mod_sortvoting.votesuccess')); @@ -53,6 +55,7 @@ this.submitResponses = () => { }).finally(() => { modal.dismiss(); }); + /* eslint-enable promise/no-nesting */ }).catch(() => { // User cancelled, ignore. }); @@ -64,7 +67,7 @@ this.moveUp = (id) => { // Change value of the input elements. var prevId = 0; var canMove = true; - options.forEach(function (option, index) { + options.forEach(function(option, index) { if (option.getAttribute('data-optionid') == id) { if (parseInt(option.value) == option.getAttribute('min')) { canMove = false; @@ -93,7 +96,7 @@ this.moveDown = (id) => { // Change value of the input elements. var nextId = 0; var canMove = true; - options.forEach(function (option, index) { + options.forEach(function(option, index) { if (option.getAttribute('data-optionid') == id) { if (parseInt(option.value) == option.getAttribute('max')) { canMove = false;