diff --git a/superset-frontend/.eslintrc.js b/superset-frontend/.eslintrc.js index e101820f5..de634b87e 100644 --- a/superset-frontend/.eslintrc.js +++ b/superset-frontend/.eslintrc.js @@ -93,7 +93,6 @@ module.exports = { 'no-mixed-operators': 0, 'no-multi-assign': 0, 'no-multi-spaces': 0, - 'no-plusplus': 0, 'no-prototype-builtins': 0, 'no-restricted-properties': 0, 'no-restricted-syntax': 0, @@ -210,7 +209,6 @@ module.exports = { 'no-mixed-operators': 0, 'no-multi-assign': 0, 'no-multi-spaces': 0, - 'no-plusplus': 0, 'no-prototype-builtins': 0, 'no-restricted-properties': 0, 'no-restricted-syntax': 0, diff --git a/superset-frontend/src/SqlLab/components/QuerySearch.jsx b/superset-frontend/src/SqlLab/components/QuerySearch.jsx index d794222bf..c2ca26f35 100644 --- a/superset-frontend/src/SqlLab/components/QuerySearch.jsx +++ b/superset-frontend/src/SqlLab/components/QuerySearch.jsx @@ -154,7 +154,7 @@ class QuerySearch extends React.PureComponent { userMutator(data) { const options = []; - for (let i = 0; i < data.pks.length; i++) { + for (let i = 0; i < data.pks.length; i += 1) { options.push({ value: data.pks[i], label: this.userLabel(data.result[i]), diff --git a/superset-frontend/src/SqlLab/components/TabbedSqlEditors.jsx b/superset-frontend/src/SqlLab/components/TabbedSqlEditors.jsx index 8f2a2fd93..9ab25012c 100644 --- a/superset-frontend/src/SqlLab/components/TabbedSqlEditors.jsx +++ b/superset-frontend/src/SqlLab/components/TabbedSqlEditors.jsx @@ -202,7 +202,7 @@ class TabbedSqlEditors extends React.PureComponent { } } popNewTab() { - queryCount++; + queryCount += 1; // Clean the url in browser history window.history.replaceState({}, document.title, this.state.sqlLabUrl); } @@ -221,7 +221,7 @@ class TabbedSqlEditors extends React.PureComponent { return this.props.queryEditors.find(qe => qe.id === qeid) || null; } newQueryEditor() { - queryCount++; + queryCount += 1; const activeQueryEditor = this.activeQueryEditor(); const firstDbId = Math.min( ...Object.values(this.props.databases).map(database => database.id), diff --git a/superset-frontend/src/modules/utils.js b/superset-frontend/src/modules/utils.js index 1c5117cc2..a4e510003 100644 --- a/superset-frontend/src/modules/utils.js +++ b/superset-frontend/src/modules/utils.js @@ -47,7 +47,7 @@ export function formatSelectOptionsForRange(start, end) { // formatSelectOptionsForRange(1, 5) // returns [[1,1], [2,2], [3,3], [4,4], [5,5]] const options = []; - for (let i = start; i <= end; i++) { + for (let i = start; i <= end; i += 1) { options.push([i, i.toString()]); } return options; diff --git a/superset-frontend/src/reduxUtils.ts b/superset-frontend/src/reduxUtils.ts index e80021a4d..b30fda70c 100644 --- a/superset-frontend/src/reduxUtils.ts +++ b/superset-frontend/src/reduxUtils.ts @@ -161,7 +161,7 @@ export function areArraysShallowEqual(arr1: unknown[], arr2: unknown[]) { return false; } const { length } = arr1; - for (let i = 0; i < length; i++) { + for (let i = 0; i < length; i += 1) { if (arr1[i] !== arr2[i]) { return false; } diff --git a/superset-frontend/src/utils/common.js b/superset-frontend/src/utils/common.js index 2c1248875..25cbb2e64 100644 --- a/superset-frontend/src/utils/common.js +++ b/superset-frontend/src/utils/common.js @@ -119,7 +119,7 @@ export function optionFromValue(opt) { export function prepareCopyToClipboardTabularData(data) { let result = ''; - for (let i = 0; i < data.length; ++i) { + for (let i = 0; i < data.length; i += 1) { result += `${Object.values(data[i]).join('\t')}\n`; } return result; diff --git a/superset-frontend/src/visualizations/TimeTable/TimeTable.jsx b/superset-frontend/src/visualizations/TimeTable/TimeTable.jsx index 1c8205b38..b51a7e1a5 100644 --- a/superset-frontend/src/visualizations/TimeTable/TimeTable.jsx +++ b/superset-frontend/src/visualizations/TimeTable/TimeTable.jsx @@ -121,7 +121,7 @@ class TimeTable extends React.PureComponent { if (column.timeRatio) { // Period ratio sparkline sparkData = []; - for (let i = column.timeRatio; i < entries.length; i++) { + for (let i = column.timeRatio; i < entries.length; i += 1) { const prevData = entries[i - column.timeRatio][valueField]; if (prevData && prevData !== 0) { sparkData.push(entries[i][valueField] / prevData);