Commit 9e4d0491 authored by Mike Greiling's avatar Mike Greiling

resolve all no-plusplus eslint violations

parent e7fdb1aa
/* eslint-disable func-names, space-before-function-paren, wrap-iife, max-len, no-var, spaced-comment, prefer-arrow-callback, consistent-return, one-var, one-var-declaration-per-line, no-unused-vars, no-else-return, prefer-template, quotes, comma-dangle, no-param-reassign, no-void, radix, keyword-spacing, space-before-blocks, brace-style, no-underscore-dangle, no-plusplus, no-return-assign, camelcase, padded-blocks */ /* eslint-disable func-names, space-before-function-paren, wrap-iife, max-len, no-var, spaced-comment, prefer-arrow-callback, consistent-return, one-var, one-var-declaration-per-line, no-unused-vars, no-else-return, prefer-template, quotes, comma-dangle, no-param-reassign, no-void, radix, keyword-spacing, space-before-blocks, brace-style, no-underscore-dangle, no-return-assign, camelcase, padded-blocks */
/* global Cookies */ /* global Cookies */
(function() { (function() {
...@@ -339,7 +339,7 @@ ...@@ -339,7 +339,7 @@
if (Cookies.get('frequently_used_emojis')) { if (Cookies.get('frequently_used_emojis')) {
frequentlyUsedEmojis = this.getFrequentlyUsedEmojis(); frequentlyUsedEmojis = this.getFrequentlyUsedEmojis();
ul = $("<ul class='clearfix emoji-menu-list frequent-emojis'>"); ul = $("<ul class='clearfix emoji-menu-list frequent-emojis'>");
for (i = 0, len = frequentlyUsedEmojis.length; i < len; i++) { for (i = 0, len = frequentlyUsedEmojis.length; i < len; i += 1) {
emoji = frequentlyUsedEmojis[i]; emoji = frequentlyUsedEmojis[i];
$(".emoji-menu-content [data-emoji='" + emoji + "']").closest('li').clone().appendTo(ul); $(".emoji-menu-content [data-emoji='" + emoji + "']").closest('li').clone().appendTo(ul);
} }
......
/* eslint-disable comma-dangle, space-before-function-paren, max-len, no-plusplus */ /* eslint-disable comma-dangle, space-before-function-paren, max-len */
/* global Vue */ /* global Vue */
/* global Sortable */ /* global Sortable */
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
issues () { issues () {
this.$nextTick(() => { this.$nextTick(() => {
if (this.scrollHeight() <= this.listHeight() && this.list.issuesSize > this.list.issues.length) { if (this.scrollHeight() <= this.listHeight() && this.list.issuesSize > this.list.issues.length) {
this.list.page++; this.list.page += 1;
this.list.getIssues(false); this.list.getIssues(false);
} }
......
/* eslint-disable space-before-function-paren, no-underscore-dangle, class-methods-use-this, consistent-return, no-plusplus, prefer-const, space-in-parens, no-shadow, no-param-reassign, max-len, no-unused-vars */ /* eslint-disable space-before-function-paren, no-underscore-dangle, class-methods-use-this, consistent-return, prefer-const, space-in-parens, no-shadow, no-param-reassign, max-len, no-unused-vars */
/* global ListIssue */ /* global ListIssue */
/* global ListLabel */ /* global ListLabel */
...@@ -58,7 +58,7 @@ class List { ...@@ -58,7 +58,7 @@ class List {
nextPage () { nextPage () {
if (this.issuesSize > this.issues.length) { if (this.issuesSize > this.issues.length) {
this.page++; this.page += 1;
return this.getIssues(false); return this.getIssues(false);
} }
...@@ -94,7 +94,7 @@ class List { ...@@ -94,7 +94,7 @@ class List {
newIssue (issue) { newIssue (issue) {
this.addIssue(issue); this.addIssue(issue);
this.issuesSize++; this.issuesSize += 1;
return gl.boardService.newIssue(this.id, issue) return gl.boardService.newIssue(this.id, issue)
.then((resp) => { .then((resp) => {
...@@ -122,7 +122,7 @@ class List { ...@@ -122,7 +122,7 @@ class List {
} }
if (listFrom) { if (listFrom) {
this.issuesSize++; this.issuesSize += 1;
gl.boardService.moveIssue(issue.id, listFrom.id, this.id) gl.boardService.moveIssue(issue.id, listFrom.id, this.id)
.then(() => { .then(() => {
listFrom.getIssues(false); listFrom.getIssues(false);
...@@ -140,7 +140,7 @@ class List { ...@@ -140,7 +140,7 @@ class List {
const matchesRemove = removeIssue.id === issue.id; const matchesRemove = removeIssue.id === issue.id;
if (matchesRemove) { if (matchesRemove) {
this.issuesSize--; this.issuesSize -= 1;
issue.removeLabel(this.label); issue.removeLabel(this.label);
} }
......
/* eslint-disable func-names, prefer-arrow-callback, no-unused-vars, no-plusplus */ /* eslint-disable func-names, prefer-arrow-callback, no-unused-vars */
/* global Vue */ /* global Vue */
Vue.http.interceptors.push((request, next) => { Vue.http.interceptors.push((request, next) => {
Vue.activeResources = Vue.activeResources ? Vue.activeResources + 1 : 1; Vue.activeResources = Vue.activeResources ? Vue.activeResources + 1 : 1;
next(function (response) { next(function (response) {
Vue.activeResources--; Vue.activeResources -= 1;
}); });
}); });
/* eslint-disable comma-dangle, object-shorthand, func-names, no-else-return, guard-for-in, no-restricted-syntax, one-var, indent, space-before-function-paren, no-plusplus, no-lonely-if, no-continue, brace-style, max-len, quotes, semi */ /* eslint-disable comma-dangle, object-shorthand, func-names, no-else-return, guard-for-in, no-restricted-syntax, one-var, indent, space-before-function-paren, no-lonely-if, no-continue, brace-style, max-len, quotes, semi */
/* global Vue */ /* global Vue */
/* global DiscussionMixins */ /* global DiscussionMixins */
/* global CommentsStore */ /* global CommentsStore */
...@@ -68,11 +68,11 @@ ...@@ -68,11 +68,11 @@
let unresolvedDiscussionCount = 0; let unresolvedDiscussionCount = 0;
for (let i = 0; i < discussionIdsInScope.length; i++) { for (let i = 0; i < discussionIdsInScope.length; i += 1) {
const discussionId = discussionIdsInScope[i]; const discussionId = discussionIdsInScope[i];
const discussion = discussions[discussionId]; const discussion = discussions[discussionId];
if (discussion && !discussion.isResolved()) { if (discussion && !discussion.isResolved()) {
unresolvedDiscussionCount++; unresolvedDiscussionCount += 1;
} }
} }
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
} }
let currentDiscussionFound = false; let currentDiscussionFound = false;
for (let i = 0; i < discussionIdsInScope.length; i++) { for (let i = 0; i < discussionIdsInScope.length; i += 1) {
const discussionId = discussionIdsInScope[i]; const discussionId = discussionIdsInScope[i];
const discussion = discussions[discussionId]; const discussion = discussions[discussionId];
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
// If we are on the diffs tab, we don't scroll to the discussion itself, but to // If we are on the diffs tab, we don't scroll to the discussion itself, but to
// 4 diff lines above it: the line the discussion was in response to + 3 context // 4 diff lines above it: the line the discussion was in response to + 3 context
let prevEl; let prevEl;
for (let i = 0; i < 4; i++) { for (let i = 0; i < 4; i += 1) {
prevEl = $target.prev(); prevEl = $target.prev();
// If the discussion doesn't have 4 lines above it, we'll have to do with fewer. // If the discussion doesn't have 4 lines above it, we'll have to do with fewer.
......
/* eslint-disable object-shorthand, func-names, guard-for-in, no-restricted-syntax, comma-dangle, no-plusplus, no-param-reassign, max-len */ /* eslint-disable object-shorthand, func-names, guard-for-in, no-restricted-syntax, comma-dangle, no-param-reassign, max-len */
((w) => { ((w) => {
w.DiscussionMixins = { w.DiscussionMixins = {
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
const discussion = this.discussions[discussionId]; const discussion = this.discussions[discussionId];
if (discussion.isResolved()) { if (discussion.isResolved()) {
resolvedCount++; resolvedCount += 1;
} }
} }
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
const discussion = this.discussions[discussionId]; const discussion = this.discussions[discussionId];
if (!discussion.isResolved()) { if (!discussion.isResolved()) {
unresolvedCount++; unresolvedCount += 1;
} }
} }
......
/* eslint-disable func-names, space-before-function-paren, wrap-iife, max-len, one-var, no-var, one-var-declaration-per-line, no-unused-vars, camelcase, quotes, no-useless-concat, prefer-template, quote-props, comma-dangle, object-shorthand, consistent-return, no-plusplus, prefer-arrow-callback, padded-blocks */ /* eslint-disable func-names, space-before-function-paren, wrap-iife, max-len, one-var, no-var, one-var-declaration-per-line, no-unused-vars, camelcase, quotes, no-useless-concat, prefer-template, quote-props, comma-dangle, object-shorthand, consistent-return, prefer-arrow-callback, padded-blocks */
/* global Dropzone */ /* global Dropzone */
/*= require preview_markdown */ /*= require preview_markdown */
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
if (item.type.indexOf("image") !== -1) { if (item.type.indexOf("image") !== -1) {
return item; return item;
} }
i++; i += 1;
} }
return false; return false;
}; };
......
/* global Element */ /* global Element */
/* eslint-disable consistent-return, max-len, no-empty, no-plusplus, func-names */ /* eslint-disable consistent-return, max-len, no-empty, func-names */
Element.prototype.closest = Element.prototype.closest || function closest(selector, selectedElement = this) { Element.prototype.closest = Element.prototype.closest || function closest(selector, selectedElement = this) {
if (!selectedElement) return; if (!selectedElement) return;
...@@ -14,7 +14,7 @@ Element.prototype.matches = Element.prototype.matches || ...@@ -14,7 +14,7 @@ Element.prototype.matches = Element.prototype.matches ||
Element.prototype.webkitMatchesSelector || Element.prototype.webkitMatchesSelector ||
function (s) { function (s) {
const matches = (this.document || this.ownerDocument).querySelectorAll(s); const matches = (this.document || this.ownerDocument).querySelectorAll(s);
let i = matches.length; let i = matches.length - 1;
while (--i >= 0 && matches.item(i) !== this) {} while (i >= 0 && matches.item(i) !== this) { i -= 1; }
return i > -1; return i > -1;
}; };
/* eslint-disable func-names, space-before-function-paren, no-var, one-var, one-var-declaration-per-line, space-before-blocks, prefer-rest-params, max-len, vars-on-top, no-plusplus, wrap-iife, no-unused-vars, quotes, no-shadow, no-cond-assign, prefer-arrow-callback, semi, no-return-assign, no-else-return, camelcase, comma-dangle, no-lonely-if, guard-for-in, no-restricted-syntax, consistent-return, padded-blocks, prefer-template, no-param-reassign, no-loop-func, no-extra-semi, keyword-spacing, no-mixed-operators */ /* eslint-disable func-names, space-before-function-paren, no-var, one-var, one-var-declaration-per-line, space-before-blocks, prefer-rest-params, max-len, vars-on-top, wrap-iife, no-unused-vars, quotes, no-shadow, no-cond-assign, prefer-arrow-callback, semi, no-return-assign, no-else-return, camelcase, comma-dangle, no-lonely-if, guard-for-in, no-restricted-syntax, consistent-return, padded-blocks, prefer-template, no-param-reassign, no-loop-func, no-extra-semi, keyword-spacing, no-mixed-operators */
/* global fuzzaldrinPlus */ /* global fuzzaldrinPlus */
/* global Turbolinks */ /* global Turbolinks */
(function() { (function() {
var GitLabDropdown, GitLabDropdownFilter, GitLabDropdownRemote, var GitLabDropdown, GitLabDropdownFilter, GitLabDropdownRemote,
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i += 1) { if (i in this && this[i] === item) return i; } return -1; };
GitLabDropdownFilter = (function() { GitLabDropdownFilter = (function() {
var ARROW_KEY_CODES, BLUR_KEYCODES, HAS_VALUE_CLASS; var ARROW_KEY_CODES, BLUR_KEYCODES, HAS_VALUE_CLASS;
...@@ -494,7 +494,7 @@ ...@@ -494,7 +494,7 @@
} else { } else {
var ul = document.createElement('ul'); var ul = document.createElement('ul');
for (var i = 0; i < html.length; i++) { for (var i = 0; i < html.length; i += 1) {
var el = html[i]; var el = html[i];
if (el instanceof jQuery) { if (el instanceof jQuery) {
......
/* eslint-disable func-names, space-before-function-paren, object-shorthand, no-var, one-var, camelcase, one-var-declaration-per-line, no-plusplus, comma-dangle, no-param-reassign, no-return-assign, quotes, prefer-arrow-callback, wrap-iife, consistent-return, no-unused-vars, max-len, no-cond-assign, no-else-return, padded-blocks, max-len */ /* eslint-disable func-names, space-before-function-paren, object-shorthand, no-var, one-var, camelcase, one-var-declaration-per-line, comma-dangle, no-param-reassign, no-return-assign, quotes, prefer-arrow-callback, wrap-iife, consistent-return, no-unused-vars, max-len, no-cond-assign, no-else-return, padded-blocks, max-len */
(function() { (function() {
window.ContributorsStatGraphUtil = { window.ContributorsStatGraphUtil = {
parse_log: function(log) { parse_log: function(log) {
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
total = {}; total = {};
by_author = {}; by_author = {};
by_email = {}; by_email = {};
for (i = 0, len = log.length; i < len; i++) { for (i = 0, len = log.length; i < len; i += 1) {
entry = log[i]; entry = log[i];
if (total[entry.date] == null) { if (total[entry.date] == null) {
this.add_date(entry.date, total); this.add_date(entry.date, total);
......
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-param-reassign, no-cond-assign, one-var, one-var-declaration-per-line, no-void, no-plusplus, guard-for-in, no-restricted-syntax, prefer-template, quotes, padded-blocks, max-len */ /* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-param-reassign, no-cond-assign, one-var, one-var-declaration-per-line, no-void, guard-for-in, no-restricted-syntax, prefer-template, quotes, padded-blocks, max-len */
(function() { (function() {
(function(w) { (function(w) {
var base; var base;
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
if (sParameterName[0] === sParam) { if (sParameterName[0] === sParam) {
values.push(sParameterName[1].replace(/\+/g, ' ')); values.push(sParameterName[1].replace(/\+/g, ' '));
} }
i++; i += 1;
} }
return values; return values;
}; };
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
return ((function() { return ((function() {
var j, len, results; var j, len, results;
results = []; results = [];
for (j = 0, len = urlVariables.length; j < len; j++) { for (j = 0, len = urlVariables.length; j < len; j += 1) {
variables = urlVariables[j]; variables = urlVariables[j];
if (variables.indexOf(param) === -1) { if (variables.indexOf(param) === -1) {
results.push(variables); results.push(variables);
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-use-before-define, no-underscore-dangle, no-param-reassign, prefer-template, quotes, comma-dangle, prefer-arrow-callback, consistent-return, one-var, one-var-declaration-per-line, spaced-comment, radix, no-else-return, max-len, no-plusplus, padded-blocks */ /* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, no-use-before-define, no-underscore-dangle, no-param-reassign, prefer-template, quotes, comma-dangle, prefer-arrow-callback, consistent-return, one-var, one-var-declaration-per-line, spaced-comment, radix, no-else-return, max-len, padded-blocks */
// LineHighlighter // LineHighlighter
// //
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
var i, lineNumber, ref, ref1, results; var i, lineNumber, ref, ref1, results;
if (range[1]) { if (range[1]) {
results = []; results = [];
for (lineNumber = i = ref = range[0], ref1 = range[1]; ref <= ref1 ? i <= ref1 : i >= ref1; lineNumber = ref <= ref1 ? ++i : --i) { for (lineNumber = i = ref = range[0], ref1 = range[1]; ref <= ref1 ? i <= ref1 : i >= ref1; lineNumber = ref <= ref1 ? (i += 1) : (i -= 1)) {
results.push(this.highlightLine(lineNumber)); results.push(this.highlightLine(lineNumber));
} }
return results; return results;
......
/* eslint-disable comma-dangle, object-shorthand, no-dupe-keys, no-param-reassign, no-plusplus, camelcase, prefer-const, no-nested-ternary, no-continue, semi, func-call-spacing, no-spaced-func, padded-blocks, max-len */ /* eslint-disable comma-dangle, object-shorthand, no-dupe-keys, no-param-reassign, camelcase, prefer-const, no-nested-ternary, no-continue, semi, func-call-spacing, no-spaced-func, padded-blocks, max-len */
/* global Cookies */ /* global Cookies */
/* global Vue */ /* global Vue */
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
this.checkLineLengths(linesObj); this.checkLineLengths(linesObj);
}); });
for (let i = 0, len = linesObj.left.length; i < len; i++) { for (let i = 0, len = linesObj.left.length; i < len; i += 1) {
file.parallelLines.push([ file.parallelLines.push([
linesObj.right[i], linesObj.right[i],
linesObj.left[i] linesObj.left[i]
...@@ -162,11 +162,11 @@ ...@@ -162,11 +162,11 @@
if (file.type === CONFLICT_TYPES.TEXT) { if (file.type === CONFLICT_TYPES.TEXT) {
file.sections.forEach((section) => { file.sections.forEach((section) => {
if (section.conflict) { if (section.conflict) {
count++; count += 1;
} }
}); });
} else { } else {
count++; count += 1;
} }
}); });
...@@ -257,12 +257,12 @@ ...@@ -257,12 +257,12 @@
if (left.length !== right.length) { if (left.length !== right.length) {
if (left.length > right.length) { if (left.length > right.length) {
const diff = left.length - right.length; const diff = left.length - right.length;
for (let i = 0; i < diff; i++) { for (let i = 0; i < diff; i += 1) {
right.push({ lineType: 'emptyLine', richText: '' }); right.push({ lineType: 'emptyLine', richText: '' });
} }
} else { } else {
const diff = right.length - left.length; const diff = right.length - left.length;
for (let i = 0; i < diff; i++) { for (let i = 0; i < diff; i += 1) {
left.push({ lineType: 'emptyLine', richText: '' }); left.push({ lineType: 'emptyLine', richText: '' });
} }
} }
...@@ -316,7 +316,7 @@ ...@@ -316,7 +316,7 @@
const hasCommitMessage = $.trim(this.state.conflictsData.commitMessage).length; const hasCommitMessage = $.trim(this.state.conflictsData.commitMessage).length;
let unresolved = 0; let unresolved = 0;
for (let i = 0, l = files.length; i < l; i++) { for (let i = 0, l = files.length; i < l; i += 1) {
let file = files[i]; let file = files[i];
if (file.resolveMode === INTERACTIVE_RESOLVE_MODE) { if (file.resolveMode === INTERACTIVE_RESOLVE_MODE) {
...@@ -326,14 +326,14 @@ ...@@ -326,14 +326,14 @@
// We only check for conflicts type 'text' // We only check for conflicts type 'text'
// since conflicts `text_editor` can´t be resolved in interactive mode // since conflicts `text_editor` can´t be resolved in interactive mode
if (file.type === CONFLICT_TYPES.TEXT) { if (file.type === CONFLICT_TYPES.TEXT) {
for (let j = 0, k = file.sections.length; j < k; j++) { for (let j = 0, k = file.sections.length; j < k; j += 1) {
if (file.sections[j].conflict) { if (file.sections[j].conflict) {
numberConflicts++; numberConflicts += 1;
} }
} }
if (resolvedConflicts !== numberConflicts) { if (resolvedConflicts !== numberConflicts) {
unresolved++; unresolved += 1;
} }
} }
} else if (file.resolveMode === EDIT_RESOLVE_MODE) { } else if (file.resolveMode === EDIT_RESOLVE_MODE) {
...@@ -341,7 +341,7 @@ ...@@ -341,7 +341,7 @@
// Unlikely to happen since switching to Edit mode saves content automatically. // Unlikely to happen since switching to Edit mode saves content automatically.
// Checking anyway in case the save strategy changes in the future // Checking anyway in case the save strategy changes in the future
if (!file.content) { if (!file.content) {
unresolved++; unresolved += 1;
continue; continue;
} }
} }
......
/* eslint-disable max-len, no-var, func-names, space-before-function-paren, vars-on-top, no-plusplus, comma-dangle, no-return-assign, consistent-return, no-param-reassign, one-var, one-var-declaration-per-line, quotes, prefer-template, no-else-return, prefer-arrow-callback, no-unused-vars, no-underscore-dangle, no-shadow, no-mixed-operators, template-curly-spacing, camelcase, default-case, wrap-iife, semi, padded-blocks */ /* eslint-disable max-len, no-var, func-names, space-before-function-paren, vars-on-top, comma-dangle, no-return-assign, consistent-return, no-param-reassign, one-var, one-var-declaration-per-line, quotes, prefer-template, no-else-return, prefer-arrow-callback, no-unused-vars, no-underscore-dangle, no-shadow, no-mixed-operators, template-curly-spacing, camelcase, default-case, wrap-iife, semi, padded-blocks */
/* global notify */ /* global notify */
/* global notifyPermissions */ /* global notifyPermissions */
/* global merge_request_widget */ /* global merge_request_widget */
/* global Turbolinks */ /* global Turbolinks */
((global) => { ((global) => {
var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i += 1) { if (i in this && this[i] === item) return i; } return -1; };
const DEPLOYMENT_TEMPLATE = `<div class="mr-widget-heading" id="<%- id %>"> const DEPLOYMENT_TEMPLATE = `<div class="mr-widget-heading" id="<%- id %>">
<div class="ci_widget ci-success"> <div class="ci_widget ci-success">
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
}; };
MergeRequestWidget.prototype.renderEnvironments = function(environments) { MergeRequestWidget.prototype.renderEnvironments = function(environments) {
for (let i = 0; i < environments.length; i++) { for (let i = 0; i < environments.length; i += 1) {
const environment = environments[i]; const environment = environments[i];
if ($(`.mr-state-widget #${ environment.id }`).length) return; if ($(`.mr-state-widget #${ environment.id }`).length) return;
const $template = $(DEPLOYMENT_TEMPLATE); const $template = $(DEPLOYMENT_TEMPLATE);
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, quotes, comma-dangle, one-var, one-var-declaration-per-line, no-mixed-operators, new-cap, no-plusplus, no-loop-func, no-floating-decimal, consistent-return, no-unused-vars, prefer-template, prefer-arrow-callback, camelcase, max-len, padded-blocks */ /* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, quotes, comma-dangle, one-var, one-var-declaration-per-line, no-mixed-operators, new-cap, no-loop-func, no-floating-decimal, consistent-return, no-unused-vars, prefer-template, prefer-arrow-callback, camelcase, max-len, padded-blocks */
/* global Raphael */ /* global Raphael */
(function() { (function() {
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
this.top = this.r.set(); this.top = this.r.set();
this.barHeight = Math.max(this.graphHeight, this.unitTime * this.days.length + 320); this.barHeight = Math.max(this.graphHeight, this.unitTime * this.days.length + 320);
ref = this.commits; ref = this.commits;
for (j = 0, len = ref.length; j < len; j++) { for (j = 0, len = ref.length; j < len; j += 1) {
c = ref[j]; c = ref[j];
if (c.id in this.parents) { if (c.id in this.parents) {
c.isParent = true; c.isParent = true;
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
var c, j, len, p, ref, results; var c, j, len, p, ref, results;
ref = this.commits; ref = this.commits;
results = []; results = [];
for (j = 0, len = ref.length; j < len; j++) { for (j = 0, len = ref.length; j < len; j += 1) {
c = ref[j]; c = ref[j];
this.mtime = Math.max(this.mtime, c.time); this.mtime = Math.max(this.mtime, c.time);
this.mspace = Math.max(this.mspace, c.space); this.mspace = Math.max(this.mspace, c.space);
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
var l, len1, ref1, results1; var l, len1, ref1, results1;
ref1 = c.parents; ref1 = c.parents;
results1 = []; results1 = [];
for (l = 0, len1 = ref1.length; l < len1; l++) { for (l = 0, len1 = ref1.length; l < len1; l += 1) {
p = ref1[l]; p = ref1[l];
this.parents[p[0]] = true; this.parents[p[0]] = true;
results1.push(this.mspace = Math.max(this.mspace, p[1])); results1.push(this.mspace = Math.max(this.mspace, p[1]));
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
// Skipping a few colors in the spectrum to get more contrast between colors // Skipping a few colors in the spectrum to get more contrast between colors
Raphael.getColor(); Raphael.getColor();
Raphael.getColor(); Raphael.getColor();
results.push(k++); results.push(k += 1);
} }
return results; return results;
}; };
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
fill: "#444" fill: "#444"
}); });
ref = this.days; ref = this.days;
for (mm = j = 0, len = ref.length; j < len; mm = ++j) { for (mm = j = 0, len = ref.length; j < len; mm = (j += 1)) {
day = ref[mm]; day = ref[mm];
if (cuday !== day[0] || cumonth !== day[1]) { if (cuday !== day[0] || cumonth !== day[1]) {
// Dates // Dates
...@@ -286,7 +286,7 @@ ...@@ -286,7 +286,7 @@
r = this.r; r = this.r;
ref = commit.parents; ref = commit.parents;
results = []; results = [];
for (i = j = 0, len = ref.length; j < len; i = ++j) { for (i = j = 0, len = ref.length; j < len; i = (j += 1)) {
parent = ref[i]; parent = ref[i];
parentCommit = this.preparedCommits[parent[0]]; parentCommit = this.preparedCommits[parent[0]];
parentY = this.offsetY + this.unitTime * parentCommit.time; parentY = this.offsetY + this.unitTime * parentCommit.time;
...@@ -399,7 +399,7 @@ ...@@ -399,7 +399,7 @@
words = content.split(" "); words = content.split(" ");
x = 0; x = 0;
s = []; s = [];
for (j = 0, len = words.length; j < len; j++) { for (j = 0, len = words.length; j < len; j += 1) {
word = words[j]; word = words[j];
if (x + (word.length * letterWidth) > width) { if (x + (word.length * letterWidth) > width) {
s.push("\n"); s.push("\n");
......
/* eslint-disable func-names, space-before-function-paren, no-var, one-var, space-before-blocks, prefer-rest-params, max-len, vars-on-top, no-plusplus, wrap-iife, consistent-return, comma-dangle, one-var-declaration-per-line, quotes, no-return-assign, prefer-arrow-callback, prefer-template, no-shadow, no-else-return, padded-blocks, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, one-var, space-before-blocks, prefer-rest-params, max-len, vars-on-top, wrap-iife, consistent-return, comma-dangle, one-var-declaration-per-line, quotes, no-return-assign, prefer-arrow-callback, prefer-template, no-shadow, no-else-return, padded-blocks, max-len */
(function() { (function() {
var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i += 1) { if (i in this && this[i] === item) return i; } return -1; };
this.NewBranchForm = (function() { this.NewBranchForm = (function() {
function NewBranchForm(form, availableRefs) { function NewBranchForm(form, availableRefs) {
......
/* eslint-disable no-useless-escape, max-len, padded-blocks, quotes, no-var, no-underscore-dangle, func-names, space-before-function-paren, no-unused-vars, no-return-assign, object-shorthand, one-var, one-var-declaration-per-line, comma-dangle, consistent-return, class-methods-use-this, no-plusplus, new-parens, semi */ /* eslint-disable no-useless-escape, max-len, padded-blocks, quotes, no-var, no-underscore-dangle, func-names, space-before-function-paren, no-unused-vars, no-return-assign, object-shorthand, one-var, one-var-declaration-per-line, comma-dangle, consistent-return, class-methods-use-this, new-parens, semi */
((global) => { ((global) => {
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
var array, binary, i, k, len, v; var array, binary, i, k, len, v;
binary = atob(dataURL.split(',')[1]); binary = atob(dataURL.split(',')[1]);
array = []; array = [];
for (k = i = 0, len = binary.length; i < len; k = ++i) { for (k = i = 0, len = binary.length; i < len; k = (i += 1)) {
v = binary[k]; v = binary[k];
array.push(binary.charCodeAt(k)); array.push(binary.charCodeAt(k));
} }
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, quotes, consistent-return, one-var, one-var-declaration-per-line, no-cond-assign, max-len, object-shorthand, no-param-reassign, comma-dangle, no-plusplus, prefer-template, no-unused-vars, no-return-assign, padded-blocks */ /* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, quotes, consistent-return, one-var, one-var-declaration-per-line, no-cond-assign, max-len, object-shorthand, no-param-reassign, comma-dangle, prefer-template, no-unused-vars, no-return-assign, padded-blocks */
/* global fuzzaldrinPlus */ /* global fuzzaldrinPlus */
(function() { (function() {
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
var blobItemUrl, filePath, html, i, j, len, matches, results; var blobItemUrl, filePath, html, i, j, len, matches, results;
this.element.find(".tree-table > tbody").empty(); this.element.find(".tree-table > tbody").empty();
results = []; results = [];
for (i = j = 0, len = filePaths.length; j < len; i = ++j) { for (i = j = 0, len = filePaths.length; j < len; i = (j += 1)) {
filePath = filePaths[i]; filePath = filePaths[i];
if (i === 20) { if (i === 20) {
break; break;
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
lastIndex = 0; lastIndex = 0;
highlightText = ""; highlightText = "";
matchedChars = []; matchedChars = [];
for (j = 0, len = matches.length; j < len; j++) { for (j = 0, len = matches.length; j < len; j += 1) {
matchIndex = matches[j]; matchIndex = matches[j];
unmatched = text.substring(lastIndex, matchIndex); unmatched = text.substring(lastIndex, matchIndex);
if (unmatched) { if (unmatched) {
......
/* eslint-disable comma-dangle, no-return-assign, one-var, no-var, no-underscore-dangle, one-var-declaration-per-line, no-unused-vars, no-cond-assign, consistent-return, object-shorthand, prefer-arrow-callback, func-names, space-before-function-paren, no-plusplus, prefer-template, quotes, class-methods-use-this, no-unused-expressions, no-sequences, wrap-iife, no-lonely-if, no-else-return, no-param-reassign, vars-on-top, padded-blocks, no-extra-semi, indent, max-len */ /* eslint-disable comma-dangle, no-return-assign, one-var, no-var, no-underscore-dangle, one-var-declaration-per-line, no-unused-vars, no-cond-assign, consistent-return, object-shorthand, prefer-arrow-callback, func-names, space-before-function-paren, prefer-template, quotes, class-methods-use-this, no-unused-expressions, no-sequences, wrap-iife, no-lonely-if, no-else-return, no-param-reassign, vars-on-top, padded-blocks, no-extra-semi, indent, max-len */
((global) => { ((global) => {
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
data = []; data = [];
// List results // List results
firstCategory = true; firstCategory = true;
for (i = 0, len = response.length; i < len; i++) { for (i = 0, len = response.length; i < len; i += 1) {
suggestion = response[i]; suggestion = response[i];
// Add group header before list each group // Add group header before list each group
if (lastCategory !== suggestion.category) { if (lastCategory !== suggestion.category) {
...@@ -310,7 +310,7 @@ ...@@ -310,7 +310,7 @@
restoreOriginalState() { restoreOriginalState() {
var i, input, inputs, len; var i, input, inputs, len;
inputs = Object.keys(this.originalState); inputs = Object.keys(this.originalState);
for (i = 0, len = inputs.length; i < len; i++) { for (i = 0, len = inputs.length; i < len; i += 1) {
input = inputs[i]; input = inputs[i];
this.getElement("#" + input).val(this.originalState[input]); this.getElement("#" + input).val(this.originalState[input]);
} }
...@@ -331,7 +331,7 @@ ...@@ -331,7 +331,7 @@
var i, input, inputs, len, results; var i, input, inputs, len, results;
inputs = Object.keys(this.originalState); inputs = Object.keys(this.originalState);
results = []; results = [];
for (i = 0, len = inputs.length; i < len; i++) { for (i = 0, len = inputs.length; i < len; i += 1) {
input = inputs[i]; input = inputs[i];
// _location isnt a input // _location isnt a input
if (input === '_location') { if (input === '_location') {
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, quotes, prefer-arrow-callback, consistent-return, object-shorthand, no-unused-vars, one-var, one-var-declaration-per-line, no-plusplus, no-else-return, comma-dangle, padded-blocks, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, quotes, prefer-arrow-callback, consistent-return, object-shorthand, no-unused-vars, one-var, one-var-declaration-per-line, no-else-return, comma-dangle, padded-blocks, max-len */
/* global Mousetrap */ /* global Mousetrap */
/* global Turbolinks */ /* global Turbolinks */
/* global findFileURL */ /* global findFileURL */
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
var i, l, len, results; var i, l, len, results;
if (location && location.length > 0) { if (location && location.length > 0) {
results = []; results = [];
for (i = 0, len = location.length; i < len; i++) { for (i = 0, len = location.length; i < len; i += 1) {
l = location[i]; l = location[i];
results.push($(l).show()); results.push($(l).show());
} }
......
/* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, camelcase, vars-on-top, semi, keyword-spacing, no-plusplus, object-shorthand, comma-dangle, eqeqeq, no-mixed-operators, no-return-assign, newline-per-chained-call, prefer-arrow-callback, consistent-return, one-var, one-var-declaration-per-line, prefer-template, quotes, no-unused-vars, no-else-return, padded-blocks, max-len */ /* eslint-disable func-names, space-before-function-paren, no-var, space-before-blocks, prefer-rest-params, wrap-iife, camelcase, vars-on-top, semi, keyword-spacing, object-shorthand, comma-dangle, eqeqeq, no-mixed-operators, no-return-assign, newline-per-chained-call, prefer-arrow-callback, consistent-return, one-var, one-var-declaration-per-line, prefer-template, quotes, no-unused-vars, no-else-return, padded-blocks, max-len */
/* global d3 */ /* global d3 */
/* global dateFormat */ /* global dateFormat */
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
var days = gl.utils.getDayDifference(oneYearAgo, today); var days = gl.utils.getDayDifference(oneYearAgo, today);
for(var i = 0; i <= days; i++) { for(var i = 0; i <= days; i += 1) {
var date = new Date(oneYearAgo); var date = new Date(oneYearAgo);
date.setDate(date.getDate() + i); date.setDate(date.getDate() + i);
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
// or if is first object // or if is first object
if ((day === 0 && i !== 0) || i === 0) { if ((day === 0 && i !== 0) || i === 0) {
this.timestampsTmp.push([]); this.timestampsTmp.push([]);
group++; group += 1;
} }
var innerArray = this.timestampsTmp[group - 1]; var innerArray = this.timestampsTmp[group - 1];
......
/* eslint-disable func-names, space-before-function-paren, one-var, no-var, space-before-blocks, prefer-rest-params, wrap-iife, quotes, max-len, one-var-declaration-per-line, vars-on-top, prefer-arrow-callback, consistent-return, comma-dangle, object-shorthand, no-shadow, no-unused-vars, no-plusplus, no-else-return, no-self-compare, prefer-template, no-unused-expressions, no-lonely-if, yoda, prefer-spread, no-void, camelcase, keyword-spacing, no-param-reassign, padded-blocks */ /* eslint-disable func-names, space-before-function-paren, one-var, no-var, space-before-blocks, prefer-rest-params, wrap-iife, quotes, max-len, one-var-declaration-per-line, vars-on-top, prefer-arrow-callback, consistent-return, comma-dangle, object-shorthand, no-shadow, no-unused-vars, no-else-return, no-self-compare, prefer-template, no-unused-expressions, no-lonely-if, yoda, prefer-spread, no-void, camelcase, keyword-spacing, no-param-reassign, padded-blocks */
/* global Vue */ /* global Vue */
/* global Issuable */ /* global Issuable */
/* global ListUser */ /* global ListUser */
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
showDivider = 0; showDivider = 0;
if (firstUser) { if (firstUser) {
// Move current user to the front of the list // Move current user to the front of the list
for (index = j = 0, len = users.length; j < len; index = ++j) { for (index = j = 0, len = users.length; j < len; index = (j += 1)) {
obj = users[index]; obj = users[index];
if (obj.username === firstUser) { if (obj.username === firstUser) {
users.splice(index, 1); users.splice(index, 1);
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
if (firstUser) { if (firstUser) {
// Move current user to the front of the list // Move current user to the front of the list
ref = data.results; ref = data.results;
for (index = j = 0, len = ref.length; j < len; index = ++j) { for (index = j = 0, len = ref.length; j < len; index = (j += 1)) {
obj = ref[index]; obj = ref[index];
if (obj.username === firstUser) { if (obj.username === firstUser) {
data.results.splice(index, 1); data.results.splice(index, 1);
......
/* eslint-disable no-unused-expressions, comma-spacing, prefer-const, no-prototype-builtins, semi, no-new, keyword-spacing, no-plusplus, no-shadow, max-len */ /* eslint-disable no-unused-expressions, comma-spacing, prefer-const, no-prototype-builtins, semi, no-new, keyword-spacing, no-shadow, max-len */
/*= require js.cookie.js */ /*= require js.cookie.js */
/*= require jquery.endless-scroll.js */ /*= require jquery.endless-scroll.js */
...@@ -39,14 +39,14 @@ ...@@ -39,14 +39,14 @@
new gl.Activities(); new gl.Activities();
}); });
for(let i = 0; i < filters.length; i++) { for(let i = 0; i < filters.length; i += 1) {
((i) => { ((i) => {
describe(`when selecting ${getEventName(i)}`, () => { describe(`when selecting ${getEventName(i)}`, () => {
beforeEach(() => { beforeEach(() => {
$(getSelector(i)).click(); $(getSelector(i)).click();
}); });
for(let x = 0; x < filters.length; x++) { for(let x = 0; x < filters.length; x += 1) {
((x) => { ((x) => {
let shouldHighlight = i === x; let shouldHighlight = i === x;
let testName = shouldHighlight ? 'should highlight' : 'should not highlight'; let testName = shouldHighlight ? 'should highlight' : 'should not highlight';
......
/* eslint-disable comma-dangle, prefer-const, no-param-reassign, no-plusplus, semi, no-unused-expressions, arrow-spacing, max-len */ /* eslint-disable comma-dangle, prefer-const, no-param-reassign, semi, no-unused-expressions, arrow-spacing, max-len */
/* global Turbolinks */ /* global Turbolinks */
/*= require jquery */ /*= require jquery */
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
which: ARROW_KEYS[direction], which: ARROW_KEYS[direction],
keyCode: ARROW_KEYS[direction] keyCode: ARROW_KEYS[direction]
}); });
i++; i += 1;
if (i <= steps) { if (i <= steps) {
navigateWithKeys(direction, steps, cb, i); navigateWithKeys(direction, steps, cb, i);
} else { } else {
......
/* eslint-disable no-new, no-plusplus, object-curly-spacing, prefer-const, semi */ /* eslint-disable no-new, object-curly-spacing, prefer-const, semi */
/* global IssuableContext */ /* global IssuableContext */
/* global LabelsSelect */ /* global LabelsSelect */
...@@ -29,12 +29,12 @@ ...@@ -29,12 +29,12 @@
let LABELS_DATA = [] let LABELS_DATA = []
if (req.url === '/root/test/labels.json') { if (req.url === '/root/test/labels.json') {
for (let i = 0; i < 10; i++) { for (let i = 0; i < 10; i += 1) {
LABELS_DATA.push({id: i, title: `test ${i}`, color: '#5CB85C'}); LABELS_DATA.push({id: i, title: `test ${i}`, color: '#5CB85C'});
} }
} else if (req.url === '/root/test/issues/2.json') { } else if (req.url === '/root/test/issues/2.json') {
let tmp = [] let tmp = []
for (let i = 0; i < saveLabelCount; i++) { for (let i = 0; i < saveLabelCount; i += 1) {
tmp.push({id: i, title: `test ${i}`, color: '#5CB85C'}); tmp.push({id: i, title: `test ${i}`, color: '#5CB85C'});
} }
LABELS_DATA = {labels: tmp}; LABELS_DATA = {labels: tmp};
......
/* eslint-disable space-before-function-paren, no-var, no-param-reassign, quotes, prefer-template, no-else-return, new-cap, dot-notation, no-return-assign, comma-dangle, no-new, one-var, one-var-declaration-per-line, no-plusplus, jasmine/no-spec-dupes, no-underscore-dangle, padded-blocks, max-len */ /* eslint-disable space-before-function-paren, no-var, no-param-reassign, quotes, prefer-template, no-else-return, new-cap, dot-notation, no-return-assign, comma-dangle, no-new, one-var, one-var-declaration-per-line, jasmine/no-spec-dupes, no-underscore-dangle, padded-blocks, max-len */
/* global LineHighlighter */ /* global LineHighlighter */
/*= require line_highlighter */ /*= require line_highlighter */
...@@ -33,11 +33,11 @@ ...@@ -33,11 +33,11 @@
return expect($('#LC13')).toHaveClass(this.css); return expect($('#LC13')).toHaveClass(this.css);
}); });
it('highlights a range of lines given in the URL hash', function() { it('highlights a range of lines given in the URL hash', function() {
var i, line, results; var line, results;
new LineHighlighter('#L5-25'); new LineHighlighter('#L5-25');
expect($("." + this.css).length).toBe(21); expect($("." + this.css).length).toBe(21);
results = []; results = [];
for (line = i = 5; i <= 25; line = ++i) { for (line = 5; line <= 25; line += 1) {
results.push(expect($("#LC" + line)).toHaveClass(this.css)); results.push(expect($("#LC" + line)).toHaveClass(this.css));
} }
return results; return results;
...@@ -124,27 +124,27 @@ ...@@ -124,27 +124,27 @@
}); });
describe('with existing single-line highlight', function() { describe('with existing single-line highlight', function() {
it('uses existing line as last line when target is lesser', function() { it('uses existing line as last line when target is lesser', function() {
var i, line, results; var line, results;
clickLine(20); clickLine(20);
clickLine(15, { clickLine(15, {
shiftKey: true shiftKey: true
}); });
expect($("." + this.css).length).toBe(6); expect($("." + this.css).length).toBe(6);
results = []; results = [];
for (line = i = 15; i <= 20; line = ++i) { for (line = 15; line <= 20; line += 1) {
results.push(expect($("#LC" + line)).toHaveClass(this.css)); results.push(expect($("#LC" + line)).toHaveClass(this.css));
} }
return results; return results;
}); });
return it('uses existing line as first line when target is greater', function() { return it('uses existing line as first line when target is greater', function() {
var i, line, results; var line, results;
clickLine(5); clickLine(5);
clickLine(10, { clickLine(10, {
shiftKey: true shiftKey: true
}); });
expect($("." + this.css).length).toBe(6); expect($("." + this.css).length).toBe(6);
results = []; results = [];
for (line = i = 5; i <= 10; line = ++i) { for (line = 5; line <= 10; line += 1) {
results.push(expect($("#LC" + line)).toHaveClass(this.css)); results.push(expect($("#LC" + line)).toHaveClass(this.css));
} }
return results; return results;
...@@ -160,25 +160,25 @@ ...@@ -160,25 +160,25 @@
}); });
}); });
it('uses target as first line when it is less than existing first line', function() { it('uses target as first line when it is less than existing first line', function() {
var i, line, results; var line, results;
clickLine(5, { clickLine(5, {
shiftKey: true shiftKey: true
}); });
expect($("." + this.css).length).toBe(6); expect($("." + this.css).length).toBe(6);
results = []; results = [];
for (line = i = 5; i <= 10; line = ++i) { for (line = 5; line <= 10; line += 1) {
results.push(expect($("#LC" + line)).toHaveClass(this.css)); results.push(expect($("#LC" + line)).toHaveClass(this.css));
} }
return results; return results;
}); });
return it('uses target as last line when it is greater than existing first line', function() { return it('uses target as last line when it is greater than existing first line', function() {
var i, line, results; var line, results;
clickLine(15, { clickLine(15, {
shiftKey: true shiftKey: true
}); });
expect($("." + this.css).length).toBe(6); expect($("." + this.css).length).toBe(6);
results = []; results = [];
for (line = i = 10; i <= 15; line = ++i) { for (line = 10; line <= 15; line += 1) {
results.push(expect($("#LC" + line)).toHaveClass(this.css)); results.push(expect($("#LC" + line)).toHaveClass(this.css));
} }
return results; return results;
......
/* eslint-disable max-len, arrow-parens, comma-dangle, no-plusplus */ /* eslint-disable max-len, arrow-parens, comma-dangle */
//= vue //= vue
//= vue-resource //= vue-resource
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
this.MockResource.subscribe(callbacks.two); this.MockResource.subscribe(callbacks.two);
this.MockResource.subscribe(callbacks.three); this.MockResource.subscribe(callbacks.three);
state.myprop++; state.myprop += 1;
this.MockResource.publish(state); this.MockResource.publish(state);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment