diff --git a/.eslintrc.js b/.eslintrc.js index 0e35c8c6b8..f3671e0faf 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -46,6 +46,7 @@ module.exports = { ], 'no-duplicate-imports': ['error'], 'no-empty-function': ['error'], + 'no-extend-native': ['error'], 'no-floating-decimal': ['error'], 'no-multi-spaces': ['error'], 'no-multiple-empty-lines': ['error', { 'max': 1 }], diff --git a/src/controllers/dashboard/scheduledtasks/scheduledtask.js b/src/controllers/dashboard/scheduledtasks/scheduledtask.js index 909bbfffe3..9be954d6ee 100644 --- a/src/controllers/dashboard/scheduledtasks/scheduledtask.js +++ b/src/controllers/dashboard/scheduledtasks/scheduledtask.js @@ -24,12 +24,6 @@ function fillTimeOfDay(select) { }).join(''); } -Array.prototype.remove = function (from, to) { - const rest = this.slice((to || from) + 1 || this.length); - this.length = from < 0 ? this.length + from : from; - return this.push.apply(this, rest); -}; - const ScheduledTaskPage = { refreshScheduledTask: function (view) { loading.show(); @@ -143,7 +137,7 @@ const ScheduledTaskPage = { loading.show(); const id = getParameterByName('id'); ApiClient.getScheduledTask(id).then(function (task) { - task.Triggers.remove(index); + task.Triggers.splice(index, 1); ApiClient.updateScheduledTaskTriggers(task.Id, task.Triggers).then(function () { ScheduledTaskPage.refreshScheduledTask(view); });