From f5c57ab92b83202807d515d8f6b8c7b34794a752 Mon Sep 17 00:00:00 2001 From: Abdul Rauf Date: Sun, 29 Sep 2019 20:36:04 +0200 Subject: [PATCH 1/2] refactor(url-listeners): fix eslint issues historyPosition and historyList were used before their declaraion --- packages/sandbox-hooks/url-listeners.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/sandbox-hooks/url-listeners.js b/packages/sandbox-hooks/url-listeners.js index 8e354cf2188..7c761bf1317 100644 --- a/packages/sandbox-hooks/url-listeners.js +++ b/packages/sandbox-hooks/url-listeners.js @@ -1,5 +1,12 @@ import { dispatch, isStandalone, listen } from 'codesandbox-api'; +/* eslint-disable no-console */ + +const origHistoryProto = window.history.__proto__; // eslint-disable-line no-proto +const historyList = []; +let historyPosition = -1; +let disableNextHashChange = false; + function sendUrlChange(url) { dispatch({ type: 'urlchange', @@ -9,13 +16,6 @@ function sendUrlChange(url) { }); } -/* eslint-disable no-console */ - -const origHistoryProto = window.history.__proto__; // eslint-disable-line no-proto -const historyList = []; -let historyPosition = -1; -let disableNextHashChange = false; - function pushHistory(url, state) { // remove "future" locations historyList.splice(historyPosition + 1); From 784f9962ec0b8128b039e5e8e44052ece1ad959a Mon Sep 17 00:00:00 2001 From: Abdul Rauf Date: Tue, 1 Oct 2019 21:27:49 +0200 Subject: [PATCH 2/2] refactor(url-listeners): remove unnecessary eslint-disable no-console --- packages/sandbox-hooks/url-listeners.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/sandbox-hooks/url-listeners.js b/packages/sandbox-hooks/url-listeners.js index 7c761bf1317..4aab03b70c1 100644 --- a/packages/sandbox-hooks/url-listeners.js +++ b/packages/sandbox-hooks/url-listeners.js @@ -1,7 +1,5 @@ import { dispatch, isStandalone, listen } from 'codesandbox-api'; -/* eslint-disable no-console */ - const origHistoryProto = window.history.__proto__; // eslint-disable-line no-proto const historyList = []; let historyPosition = -1;