Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLint: Enable rule no-plusplus #10876

Merged
merged 1 commit into from
Sep 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions superset-frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ module.exports = {
'no-mixed-operators': 0,
'no-multi-assign': 0,
'no-multi-spaces': 0,
'no-plusplus': 0,
'no-prototype-builtins': 0,
'no-restricted-globals': 0, // disabled temporarily
'no-restricted-properties': 0,
Expand Down Expand Up @@ -215,7 +214,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,
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/SqlLab/components/QuerySearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]),
Expand Down
4 changes: 2 additions & 2 deletions superset-frontend/src/SqlLab/components/TabbedSqlEditors.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/modules/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/reduxUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion superset-frontend/src/utils/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down