This is an automated email from the ASF dual-hosted git repository.
maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new 76275ec Enable rule no-plusplus (#10876)
76275ec is described below
commit 76275ec410d5021346a2fd366fed9739f8e7a625
Author: Kamil Gabryjelski <[email protected]>
AuthorDate: Mon Sep 14 20:59:32 2020 +0200
Enable rule no-plusplus (#10876)
---
superset-frontend/.eslintrc.js | 2 --
superset-frontend/src/SqlLab/components/QuerySearch.jsx | 2 +-
superset-frontend/src/SqlLab/components/TabbedSqlEditors.jsx | 4 ++--
superset-frontend/src/modules/utils.js | 2 +-
superset-frontend/src/reduxUtils.ts | 2 +-
superset-frontend/src/utils/common.js | 2 +-
superset-frontend/src/visualizations/TimeTable/TimeTable.jsx | 2 +-
7 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/superset-frontend/.eslintrc.js b/superset-frontend/.eslintrc.js
index e101820..de634b8 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 d794222..c2ca26f 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 8f2a2fd..9ab2501 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 1c5117c..a4e5100 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 e80021a..b30fda7 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 2c12488..25cbb2e 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 1c8205b..b51a7e1 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);