diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 36baad66d..99bc08582 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,7 +38,7 @@ repos: - id: rst-backticks - id: rst-directive-colons - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.7.1 + rev: v3.0.0-alpha.0 hooks: - id: prettier types_or: [javascript, css] diff --git a/debug_toolbar/static/debug_toolbar/js/history.js b/debug_toolbar/static/debug_toolbar/js/history.js index b30fcabae..5611fde1d 100644 --- a/debug_toolbar/static/debug_toolbar/js/history.js +++ b/debug_toolbar/static/debug_toolbar/js/history.js @@ -25,7 +25,7 @@ function refreshHistory() { const formTarget = djDebug.querySelector(".refreshHistory"); const container = document.getElementById("djdtHistoryRequests"); const oldIds = new Set( - pluckData(container.querySelectorAll("tr[data-store-id]"), "storeId") + pluckData(container.querySelectorAll("tr[data-store-id]"), "storeId"), ); ajaxForm(formTarget) @@ -44,8 +44,8 @@ function refreshHistory() { const allIds = new Set( pluckData( container.querySelectorAll("tr[data-store-id]"), - "storeId" - ) + "storeId", + ), ); const newIds = difference(allIds, oldIds); const lastRequestId = newIds.values().next().value; @@ -58,7 +58,7 @@ function refreshHistory() { .then(function (refreshInfo) { refreshInfo.newIds.forEach(function (newId) { const row = container.querySelector( - `tr[data-store-id="${newId}"]` + `tr[data-store-id="${newId}"]`, ); row.classList.add("flash-new"); }); @@ -74,7 +74,7 @@ function refreshHistory() { function switchHistory(newStoreId) { const formTarget = djDebug.querySelector( - ".switchHistory[data-store-id='" + newStoreId + "']" + ".switchHistory[data-store-id='" + newStoreId + "']", ); const tbody = formTarget.closest("tbody"); @@ -88,7 +88,7 @@ function switchHistory(newStoreId) { if (Object.keys(data).length === 0) { const container = document.getElementById("djdtHistoryRequests"); container.querySelector( - 'button[data-store-id="' + newStoreId + '"]' + 'button[data-store-id="' + newStoreId + '"]', ).innerHTML = "Switch [EXPIRED]"; } replaceToolbarState(newStoreId, data); diff --git a/debug_toolbar/static/debug_toolbar/js/timer.js b/debug_toolbar/static/debug_toolbar/js/timer.js index 70d3fe5a2..9f26bf83c 100644 --- a/debug_toolbar/static/debug_toolbar/js/timer.js +++ b/debug_toolbar/static/debug_toolbar/js/timer.js @@ -33,7 +33,7 @@ function insertBrowserTiming() { ")"; row.querySelector("rect").setAttribute( "width", - getCSSWidth(stat, endStat) + getCSSWidth(stat, endStat), ); } else { // Render a point in time diff --git a/debug_toolbar/static/debug_toolbar/js/toolbar.js b/debug_toolbar/static/debug_toolbar/js/toolbar.js index 1c06be7fa..3d45ffd74 100644 --- a/debug_toolbar/static/debug_toolbar/js/toolbar.js +++ b/debug_toolbar/static/debug_toolbar/js/toolbar.js @@ -31,13 +31,13 @@ const djdt = { this.parentElement.classList.add("djdt-active"); const inner = current.querySelector( - ".djDebugPanelContent .djdt-scroll" + ".djDebugPanelContent .djdt-scroll", ), store_id = djDebug.dataset.storeId; if (store_id && inner.children.length === 0) { const url = new URL( djDebug.dataset.renderPanelUrl, - window.location + window.location, ); url.searchParams.append("store_id", store_id); url.searchParams.append("panel_id", panelId); @@ -49,18 +49,18 @@ const djdt = { djDebug.dispatchEvent( new CustomEvent("djdt.panel.render", { detail: { panelId: panelId }, - }) + }), ); }); } else { djDebug.dispatchEvent( new CustomEvent("djdt.panel.render", { detail: { panelId: panelId }, - }) + }), ); } } - } + }, ); $$.on(djDebug, "click", ".djDebugClose", function () { djdt.hide_one_level(); @@ -76,9 +76,9 @@ const djdt = { { path: "/", expires: 10, - } + }, ); - } + }, ); // Used by the SQL and template panels @@ -219,7 +219,7 @@ const djdt = { // set handle position const handleTop = Math.min( localStorage.getItem("djdt.top") || 0, - window.innerHeight - handle.offsetWidth + window.innerHeight - handle.offsetWidth, ); handle.style.top = handleTop + "px"; }, diff --git a/debug_toolbar/static/debug_toolbar/js/utils.js b/debug_toolbar/static/debug_toolbar/js/utils.js index 72c767fb6..065c1d42e 100644 --- a/debug_toolbar/static/debug_toolbar/js/utils.js +++ b/debug_toolbar/static/debug_toolbar/js/utils.js @@ -77,7 +77,7 @@ function ajax(url, init) { return response.json(); } return Promise.reject( - new Error(response.status + ": " + response.statusText) + new Error(response.status + ": " + response.statusText), ); }) .catch(function (error) {