Enable rule no-plusplus (#10876)

This commit is contained in:
Kamil Gabryjelski 2020-09-14 20:59:32 +02:00 committed by GitHub
parent 08ec509dc9
commit 76275ec410
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 7 additions and 9 deletions

View File

@ -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,

View File

@ -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]),

View File

@ -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),

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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);