diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-01-11 01:35:09 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-01-19 02:15:27 +0300 |
commit | 9e4d04913ab9267d4a59df4d7feafd97b8117fe7 (patch) | |
tree | 35846b4ce22e0c5824f982bfbcc0e36281192a95 /spec | |
parent | e7fdb1aae5a61b30f66ea3489d4e0759ed8ea3a1 (diff) |
resolve all no-plusplus eslint violations
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/activities_spec.js.es6 | 6 | ||||
-rw-r--r-- | spec/javascripts/gl_dropdown_spec.js.es6 | 4 | ||||
-rw-r--r-- | spec/javascripts/labels_issue_sidebar_spec.js.es6 | 6 | ||||
-rw-r--r-- | spec/javascripts/line_highlighter_spec.js | 22 | ||||
-rw-r--r-- | spec/javascripts/subbable_resource_spec.js.es6 | 4 |
5 files changed, 21 insertions, 21 deletions
diff --git a/spec/javascripts/activities_spec.js.es6 b/spec/javascripts/activities_spec.js.es6 index b3617a45bd4..54b6efc0f95 100644 --- a/spec/javascripts/activities_spec.js.es6 +++ b/spec/javascripts/activities_spec.js.es6 @@ -1,4 +1,4 @@ -/* 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 jquery.endless-scroll.js */ @@ -39,14 +39,14 @@ new gl.Activities(); }); - for(let i = 0; i < filters.length; i++) { + for(let i = 0; i < filters.length; i += 1) { ((i) => { describe(`when selecting ${getEventName(i)}`, () => { beforeEach(() => { $(getSelector(i)).click(); }); - for(let x = 0; x < filters.length; x++) { + for(let x = 0; x < filters.length; x += 1) { ((x) => { let shouldHighlight = i === x; let testName = shouldHighlight ? 'should highlight' : 'should not highlight'; diff --git a/spec/javascripts/gl_dropdown_spec.js.es6 b/spec/javascripts/gl_dropdown_spec.js.es6 index d11b1182d9a..252ec4f590f 100644 --- a/spec/javascripts/gl_dropdown_spec.js.es6 +++ b/spec/javascripts/gl_dropdown_spec.js.es6 @@ -1,4 +1,4 @@ -/* 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 */ /*= require jquery */ @@ -30,7 +30,7 @@ which: ARROW_KEYS[direction], keyCode: ARROW_KEYS[direction] }); - i++; + i += 1; if (i <= steps) { navigateWithKeys(direction, steps, cb, i); } else { diff --git a/spec/javascripts/labels_issue_sidebar_spec.js.es6 b/spec/javascripts/labels_issue_sidebar_spec.js.es6 index e3146559a4a..4f06893f365 100644 --- a/spec/javascripts/labels_issue_sidebar_spec.js.es6 +++ b/spec/javascripts/labels_issue_sidebar_spec.js.es6 @@ -1,4 +1,4 @@ -/* 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 LabelsSelect */ @@ -29,12 +29,12 @@ let LABELS_DATA = [] 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'}); } } else if (req.url === '/root/test/issues/2.json') { 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'}); } LABELS_DATA = {labels: tmp}; diff --git a/spec/javascripts/line_highlighter_spec.js b/spec/javascripts/line_highlighter_spec.js index 31f516b41bf..0354a16c099 100644 --- a/spec/javascripts/line_highlighter_spec.js +++ b/spec/javascripts/line_highlighter_spec.js @@ -1,4 +1,4 @@ -/* 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 */ /*= require line_highlighter */ @@ -33,11 +33,11 @@ return expect($('#LC13')).toHaveClass(this.css); }); it('highlights a range of lines given in the URL hash', function() { - var i, line, results; + var line, results; new LineHighlighter('#L5-25'); expect($("." + this.css).length).toBe(21); results = []; - for (line = i = 5; i <= 25; line = ++i) { + for (line = 5; line <= 25; line += 1) { results.push(expect($("#LC" + line)).toHaveClass(this.css)); } return results; @@ -124,27 +124,27 @@ }); describe('with existing single-line highlight', function() { it('uses existing line as last line when target is lesser', function() { - var i, line, results; + var line, results; clickLine(20); clickLine(15, { shiftKey: true }); expect($("." + this.css).length).toBe(6); results = []; - for (line = i = 15; i <= 20; line = ++i) { + for (line = 15; line <= 20; line += 1) { results.push(expect($("#LC" + line)).toHaveClass(this.css)); } return results; }); return it('uses existing line as first line when target is greater', function() { - var i, line, results; + var line, results; clickLine(5); clickLine(10, { shiftKey: true }); expect($("." + this.css).length).toBe(6); results = []; - for (line = i = 5; i <= 10; line = ++i) { + for (line = 5; line <= 10; line += 1) { results.push(expect($("#LC" + line)).toHaveClass(this.css)); } return results; @@ -160,25 +160,25 @@ }); }); it('uses target as first line when it is less than existing first line', function() { - var i, line, results; + var line, results; clickLine(5, { shiftKey: true }); expect($("." + this.css).length).toBe(6); results = []; - for (line = i = 5; i <= 10; line = ++i) { + for (line = 5; line <= 10; line += 1) { results.push(expect($("#LC" + line)).toHaveClass(this.css)); } return results; }); 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, { shiftKey: true }); expect($("." + this.css).length).toBe(6); results = []; - for (line = i = 10; i <= 15; line = ++i) { + for (line = 10; line <= 15; line += 1) { results.push(expect($("#LC" + line)).toHaveClass(this.css)); } return results; diff --git a/spec/javascripts/subbable_resource_spec.js.es6 b/spec/javascripts/subbable_resource_spec.js.es6 index 6a70dd856a7..99f45850ea3 100644 --- a/spec/javascripts/subbable_resource_spec.js.es6 +++ b/spec/javascripts/subbable_resource_spec.js.es6 @@ -1,4 +1,4 @@ -/* eslint-disable max-len, arrow-parens, comma-dangle, no-plusplus */ +/* eslint-disable max-len, arrow-parens, comma-dangle */ //= vue //= vue-resource @@ -53,7 +53,7 @@ this.MockResource.subscribe(callbacks.two); this.MockResource.subscribe(callbacks.three); - state.myprop++; + state.myprop += 1; this.MockResource.publish(state); |