diff --git a/client/.eslintrc b/client/.eslintrc index 37c82e8f7..3e77c7463 100644 --- a/client/.eslintrc +++ b/client/.eslintrc @@ -38,10 +38,8 @@ "react/prop-types": 0, "jsx-a11y/click-events-have-key-events": 0, - "jsx-a11y/mouse-events-have-key-events": 0, - "no-multi-spaces": 0, - "no-restricted-globals": 0, + "object-curly-newline": 0, "padded-blocks": 0, "prefer-destructuring": 0, diff --git a/client/app/scripts/components/cloud-link.js b/client/app/scripts/components/cloud-link.js index 1a5b8e455..318e385c5 100644 --- a/client/app/scripts/components/cloud-link.js +++ b/client/app/scripts/components/cloud-link.js @@ -44,7 +44,7 @@ class LinkWrapper extends React.Component { if (router && href[0] === '/') { router.push(href); } else { - location.href = href; + window.location.href = href; } } diff --git a/client/app/scripts/components/debug-toolbar.js b/client/app/scripts/components/debug-toolbar.js index 146641177..536a710a1 100644 --- a/client/app/scripts/components/debug-toolbar.js +++ b/client/app/scripts/components/debug-toolbar.js @@ -117,7 +117,7 @@ function startPerf(delay) { export function showingDebugToolbar() { return (('debugToolbar' in localStorage && JSON.parse(localStorage.debugToolbar)) - || location.pathname.indexOf('debug') > -1); + || window.location.pathname.indexOf('debug') > -1); } diff --git a/client/app/scripts/components/matched-text.js b/client/app/scripts/components/matched-text.js index f26e7ee28..60d50e681 100644 --- a/client/app/scripts/components/matched-text.js +++ b/client/app/scripts/components/matched-text.js @@ -10,7 +10,7 @@ const TRUNCATE_ELLIPSIS = '…'; * `('text', {start: 2, length: 1}) => [{text: 'te'}, {text: 'x', match: true}, {text: 't'}]` */ function chunkText(text, { start, length }) { - if (text && !isNaN(start) && !isNaN(length)) { + if (text && !window.isNaN(start) && !window.isNaN(length)) { const chunks = []; // text chunk before match if (start > 0) { diff --git a/client/app/scripts/components/node-details/node-details-table.js b/client/app/scripts/components/node-details/node-details-table.js index 928718385..cf4f9aac7 100644 --- a/client/app/scripts/components/node-details/node-details-table.js +++ b/client/app/scripts/components/node-details/node-details-table.js @@ -294,7 +294,7 @@ class NodeDetailsTable extends React.Component { NodeDetailsTable.defaultProps = { - nodeIdKey: 'id', // key to identify a node in a row (used for topology links) + nodeIdKey: 'id', // key to identify a node in a row (used for topology links) limit: NODE_DETAILS_DATA_ROWS_DEFAULT_LIMIT, onSortChange: () => {}, sortedDesc: null, diff --git a/client/app/scripts/utils/search-utils.js b/client/app/scripts/utils/search-utils.js index 9beacf548..c6dad9219 100644 --- a/client/app/scripts/utils/search-utils.js +++ b/client/app/scripts/utils/search-utils.js @@ -235,7 +235,7 @@ export function parseQuery(query) { if (comparisonQuery && comparisonQuery.length === 2) { const value = parseValue(comparisonQuery[1]); const metric = comparisonQuery[0].trim(); - if (!isNaN(value) && metric) { + if (!window.isNaN(value) && metric) { comparison = { metric, value, diff --git a/client/app/scripts/utils/web-api-utils.js b/client/app/scripts/utils/web-api-utils.js index ce16c8861..6672bb847 100644 --- a/client/app/scripts/utils/web-api-utils.js +++ b/client/app/scripts/utils/web-api-utils.js @@ -27,7 +27,7 @@ const csrfToken = (() => { // Check for token at window level or parent level (for iframe); /* eslint-disable no-underscore-dangle */ const token = typeof window !== 'undefined' - ? window.__WEAVEWORKS_CSRF_TOKEN || parent.__WEAVEWORKS_CSRF_TOKEN + ? window.__WEAVEWORKS_CSRF_TOKEN || window.parent.__WEAVEWORKS_CSRF_TOKEN : null; /* eslint-enable no-underscore-dangle */ if (!token || token === '$__CSRF_TOKEN_PLACEHOLDER__') { @@ -110,7 +110,7 @@ function topologiesUrl(state) { } export function getWebsocketUrl(host = window.location.host, pathname = window.location.pathname) { - const wsProto = location.protocol === 'https:' ? 'wss' : 'ws'; + const wsProto = window.location.protocol === 'https:' ? 'wss' : 'ws'; return `${wsProto}://${host}${process.env.SCOPE_API_PREFIX || ''}${basePath(pathname)}`; }