Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
83ecc02d
Commit
83ecc02d
authored
Jan 12, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolve all prefer-const eslint violations
parent
0b3f0049
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
44 additions
and
47 deletions
+44
-47
app/assets/javascripts/blob/template_selector.js.es6
app/assets/javascripts/blob/template_selector.js.es6
+2
-2
app/assets/javascripts/boards/mixins/sortable_default_options.js.es6
...javascripts/boards/mixins/sortable_default_options.js.es6
+2
-2
app/assets/javascripts/boards/models/list.js.es6
app/assets/javascripts/boards/models/list.js.es6
+2
-2
app/assets/javascripts/boards/services/board_service.js.es6
app/assets/javascripts/boards/services/board_service.js.es6
+2
-2
app/assets/javascripts/diff_notes/stores/comments.js.es6
app/assets/javascripts/diff_notes/stores/comments.js.es6
+2
-2
app/assets/javascripts/due_date_select.js.es6
app/assets/javascripts/due_date_select.js.es6
+1
-1
app/assets/javascripts/issuable.js.es6
app/assets/javascripts/issuable.js.es6
+2
-2
app/assets/javascripts/merge_conflicts/components/diff_file_editor.js.es6
...cripts/merge_conflicts/components/diff_file_editor.js.es6
+3
-3
app/assets/javascripts/merge_conflicts/merge_conflict_store.js.es6
...s/javascripts/merge_conflicts/merge_conflict_store.js.es6
+5
-7
app/assets/javascripts/project_label_subscription.js.es6
app/assets/javascripts/project_label_subscription.js.es6
+3
-3
app/assets/javascripts/templates/issuable_template_selector.js.es6
...s/javascripts/templates/issuable_template_selector.js.es6
+2
-2
app/assets/javascripts/templates/issuable_template_selectors.js.es6
.../javascripts/templates/issuable_template_selectors.js.es6
+2
-2
spec/javascripts/activities_spec.js.es6
spec/javascripts/activities_spec.js.es6
+5
-5
spec/javascripts/gl_dropdown_spec.js.es6
spec/javascripts/gl_dropdown_spec.js.es6
+9
-10
spec/javascripts/labels_issue_sidebar_spec.js.es6
spec/javascripts/labels_issue_sidebar_spec.js.es6
+2
-2
No files found.
app/assets/javascripts/blob/template_selector.js.es6
View file @
83ecc02d
/* eslint-disable comma-dangle, object-shorthand, func-names, space-before-function-paren, arrow-parens, no-unused-vars, class-methods-use-this, no-var, consistent-return,
prefer-const,
no-param-reassign, space-in-parens, max-len */
/* eslint-disable comma-dangle, object-shorthand, func-names, space-before-function-paren, arrow-parens, no-unused-vars, class-methods-use-this, no-var, consistent-return, no-param-reassign, space-in-parens, max-len */
((global) => {
class TemplateSelector {
...
...
@@ -74,7 +74,7 @@
if (!file) return;
const oldValue = this.editor.getValue();
le
t newValue = file.content;
cons
t newValue = file.content;
this.editor.setValue(newValue, 1);
if (!skipFocus) this.editor.focus();
...
...
app/assets/javascripts/boards/mixins/sortable_default_options.js.es6
View file @
83ecc02d
/* eslint-disable no-unused-vars, no-mixed-operators,
prefer-const,
comma-dangle */
/* eslint-disable no-unused-vars, no-mixed-operators, comma-dangle */
/* global DocumentTouch */
((w) => {
...
...
@@ -19,7 +19,7 @@
gl.issueBoards.touchEnabled = ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch;
gl.issueBoards.getBoardSortableDefaultOptions = (obj) => {
le
t defaultSortOptions = {
cons
t defaultSortOptions = {
animation: 200,
forceFallback: true,
fallbackClass: 'is-dragging',
...
...
app/assets/javascripts/boards/models/list.js.es6
View file @
83ecc02d
/* 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 */
/* eslint-disable space-before-function-paren, no-underscore-dangle, class-methods-use-this, consistent-return, space-in-parens, no-shadow, no-param-reassign, max-len, no-unused-vars */
/* global ListIssue */
/* global ListLabel */
...
...
@@ -66,7 +66,7 @@ class List {
getIssues (emptyIssues = true) {
const filters = this.filters;
le
t data = { page: this.page };
cons
t data = { page: this.page };
Object.keys(filters).forEach((key) => { data[key] = filters[key]; });
...
...
app/assets/javascripts/boards/services/board_service.js.es6
View file @
83ecc02d
/* eslint-disable space-before-function-paren, comma-dangle, no-param-reassign, camelcase,
prefer-const,
max-len, no-unused-vars */
/* eslint-disable space-before-function-paren, comma-dangle, no-param-reassign, camelcase, max-len, no-unused-vars */
/* global Vue */
class BoardService {
...
...
@@ -47,7 +47,7 @@ class BoardService {
}
getIssuesForList (id, filter = {}) {
le
t data = { id };
cons
t data = { id };
Object.keys(filter).forEach((key) => { data[key] = filter[key]; });
return this.issues.get(data);
...
...
app/assets/javascripts/diff_notes/stores/comments.js.es6
View file @
83ecc02d
/* eslint-disable object-shorthand, func-names, camelcase,
prefer-const,
no-restricted-syntax, guard-for-in, comma-dangle, max-len, no-param-reassign */
/* eslint-disable object-shorthand, func-names, camelcase, no-restricted-syntax, guard-for-in, comma-dangle, max-len, no-param-reassign */
/* global Vue */
/* global DiscussionModel */
...
...
@@ -41,7 +41,7 @@
}
},
unresolvedDiscussionIds: function () {
le
t ids = [];
cons
t ids = [];
for (const discussionId in this.state) {
const discussion = this.state[discussionId];
...
...
app/assets/javascripts/due_date_select.js.es6
View file @
83ecc02d
/* eslint-disable wrap-iife, func-names, space-before-function-paren, comma-dangle, prefer-template, consistent-return, class-methods-use-this, arrow-body-style,
prefer-const,
no-unused-vars, no-underscore-dangle, no-new, max-len, no-sequences, no-unused-expressions, no-param-reassign */
/* eslint-disable wrap-iife, func-names, space-before-function-paren, comma-dangle, prefer-template, consistent-return, class-methods-use-this, arrow-body-style, no-unused-vars, no-underscore-dangle, no-new, max-len, no-sequences, no-unused-expressions, no-param-reassign */
(function(global) {
class DueDateSelect {
...
...
app/assets/javascripts/issuable.js.es6
View file @
83ecc02d
/* eslint-disable no-param-reassign, func-names, no-var, camelcase, no-unused-vars, object-shorthand, space-before-function-paren, no-return-assign, comma-dangle, consistent-return, one-var, one-var-declaration-per-line, quotes, prefer-template, prefer-arrow-callback,
prefer-const,
wrap-iife, max-len */
/* eslint-disable no-param-reassign, func-names, no-var, camelcase, no-unused-vars, object-shorthand, space-before-function-paren, no-return-assign, comma-dangle, consistent-return, one-var, one-var-declaration-per-line, quotes, prefer-template, prefer-arrow-callback, wrap-iife, max-len */
/* global Issuable */
/* global Turbolinks */
...
...
@@ -151,7 +151,7 @@
this.issuableBulkActions.setOriginalDropdownData();
if ($checkedIssues.length > 0) {
le
t ids = $.map($checkedIssues, function(value) {
cons
t ids = $.map($checkedIssues, function(value) {
return $(value).data('id');
});
$updateIssuesIds.val(ids);
...
...
app/assets/javascripts/merge_conflicts/components/diff_file_editor.js.es6
View file @
83ecc02d
/* eslint-disable comma-dangle, quote-props, no-useless-computed-key, object-shorthand,
prefer-const,
no-new, no-param-reassign, max-len */
/* eslint-disable comma-dangle, quote-props, no-useless-computed-key, object-shorthand, no-new, no-param-reassign, max-len */
/* global Vue */
/* global ace */
/* global Flash */
...
...
@@ -50,8 +50,8 @@
$.get(this.file.content_path)
.done((file) => {
le
t content = this.$el.querySelector('pre');
le
t fileContent = document.createTextNode(file.content);
cons
t content = this.$el.querySelector('pre');
cons
t fileContent = document.createTextNode(file.content);
content.textContent = fileContent.textContent;
...
...
app/assets/javascripts/merge_conflicts/merge_conflict_store.js.es6
View file @
83ecc02d
/* eslint-disable comma-dangle, object-shorthand, no-param-reassign, camelcase,
prefer-const,
no-nested-ternary, no-continue, max-len */
/* eslint-disable comma-dangle, object-shorthand, no-param-reassign, camelcase, no-nested-ternary, no-continue, max-len */
/* global Cookies */
/* global Vue */
...
...
@@ -251,7 +251,7 @@
},
checkLineLengths(linesObj) {
le
t { left, right } = linesObj;
cons
t { left, right } = linesObj;
if (left.length !== right.length) {
if (left.length > right.length) {
...
...
@@ -316,11 +316,11 @@
let unresolved = 0;
for (let i = 0, l = files.length; i < l; i += 1) {
le
t file = files[i];
cons
t file = files[i];
if (file.resolveMode === INTERACTIVE_RESOLVE_MODE) {
let numberConflicts = 0;
le
t resolvedConflicts = Object.keys(file.resolutionData).length;
cons
t resolvedConflicts = Object.keys(file.resolutionData).length;
// We only check for conflicts type 'text'
// since conflicts `text_editor` can´t be resolved in interactive mode
...
...
@@ -364,9 +364,7 @@
};
this.state.conflictsData.files.forEach((file) => {
let addFile;
addFile = {
const addFile = {
old_path: file.old_path,
new_path: file.new_path
};
...
...
app/assets/javascripts/project_label_subscription.js.es6
View file @
83ecc02d
/* eslint-disable wrap-iife, func-names, space-before-function-paren, object-shorthand, comma-dangle, one-var, one-var-declaration-per-line, no-restricted-syntax,
prefer-const,
max-len, no-param-reassign */
/* eslint-disable wrap-iife, func-names, space-before-function-paren, object-shorthand, comma-dangle, one-var, one-var-declaration-per-line, no-restricted-syntax, max-len, no-param-reassign */
(function(global) {
class ProjectLabelSubscription {
...
...
@@ -38,8 +38,8 @@
this.$buttons.attr('data-status', newStatus);
this.$buttons.find('> span').text(newAction);
for (
le
t button of this.$buttons) {
le
t $button = $(button);
for (
cons
t button of this.$buttons) {
cons
t $button = $(button);
if ($button.attr('data-original-title')) {
$button.tooltip('hide').attr('data-original-title', newAction).tooltip('fixTitle');
...
...
app/assets/javascripts/templates/issuable_template_selector.js.es6
View file @
83ecc02d
/* eslint-disable
prefer-const,
comma-dangle, max-len, no-useless-return, no-param-reassign, max-len */
/* eslint-disable comma-dangle, max-len, no-useless-return, no-param-reassign, max-len */
/* global Api */
/*= require ../blob/template_selector */
...
...
@@ -12,7 +12,7 @@
this.issuableType = this.wrapper.data('issuable-type');
this.titleInput = $(`#${this.issuableType}_title`);
le
t initialQuery = {
cons
t initialQuery = {
name: this.dropdown.data('selected')
};
...
...
app/assets/javascripts/templates/issuable_template_selectors.js.es6
View file @
83ecc02d
/* eslint-disable no-new, comma-dangle, class-methods-use-this,
prefer-const,
no-param-reassign */
/* eslint-disable no-new, comma-dangle, class-methods-use-this, no-param-reassign */
((global) => {
class IssuableTemplateSelectors {
...
...
@@ -19,7 +19,7 @@
}
initEditor() {
le
t editor = $('.markdown-area');
cons
t editor = $('.markdown-area');
// Proxy ace-editor's .setValue to jQuery's .val
editor.setValue = editor.val;
editor.getValue = editor.val;
...
...
spec/javascripts/activities_spec.js.es6
View file @
83ecc02d
/* eslint-disable no-unused-expressions,
prefer-const,
no-prototype-builtins, no-new, no-shadow, max-len */
/* eslint-disable no-unused-expressions, no-prototype-builtins, no-new, no-shadow, max-len */
/*= require js.cookie.js */
/*= require jquery.endless-scroll.js */
...
...
@@ -24,12 +24,12 @@
}];
function getEventName(index) {
le
t filter = filters[index];
cons
t filter = filters[index];
return filter.hasOwnProperty('name') ? filter.name : filter.id;
}
function getSelector(index) {
le
t filter = filters[index];
cons
t filter = filters[index];
return `#${filter.id}_event_filter`;
}
...
...
@@ -48,8 +48,8 @@
for (let x = 0; x < filters.length; x += 1) {
((x) => {
le
t shouldHighlight = i === x;
le
t testName = shouldHighlight ? 'should highlight' : 'should not highlight';
cons
t shouldHighlight = i === x;
cons
t testName = shouldHighlight ? 'should highlight' : 'should not highlight';
it(`${testName} ${getEventName(x)}`, () => {
expect($(getSelector(x)).parent().hasClass('active')).toEqual(shouldHighlight);
...
...
spec/javascripts/gl_dropdown_spec.js.es6
View file @
83ecc02d
/* eslint-disable comma-dangle,
prefer-const,
no-param-reassign, no-unused-expressions, max-len */
/* eslint-disable comma-dangle, no-param-reassign, no-unused-expressions, max-len */
/* global Turbolinks */
/*= require jquery */
...
...
@@ -22,7 +22,7 @@
let remoteCallback;
le
t navigateWithKeys = function navigateWithKeys(direction, steps, cb, i) {
cons
t navigateWithKeys = function navigateWithKeys(direction, steps, cb, i) {
i = i || 0;
if (!i) direction = direction.toUpperCase();
$('body').trigger({
...
...
@@ -38,7 +38,7 @@
}
};
le
t remoteMock = function remoteMock(data, term, callback) {
cons
t remoteMock = function remoteMock(data, term, callback) {
remoteCallback = callback.bind({}, data);
};
...
...
@@ -89,7 +89,7 @@
it('should select a following item on DOWN keypress', () => {
expect($(FOCUSED_ITEM_SELECTOR, this.$dropdownMenuElement).length).toBe(0);
le
t randomIndex = (Math.floor(Math.random() * (this.projectsData.length - 1)) + 0);
cons
t randomIndex = (Math.floor(Math.random() * (this.projectsData.length - 1)) + 0);
navigateWithKeys('down', randomIndex, () => {
expect($(FOCUSED_ITEM_SELECTOR, this.$dropdownMenuElement).length).toBe(1);
expect($(`${ITEM_SELECTOR}:eq(${randomIndex}) a`, this.$dropdownMenuElement)).toHaveClass('is-focused');
...
...
@@ -100,7 +100,7 @@
expect($(FOCUSED_ITEM_SELECTOR, this.$dropdownMenuElement).length).toBe(0);
navigateWithKeys('down', (this.projectsData.length - 1), () => {
expect($(FOCUSED_ITEM_SELECTOR, this.$dropdownMenuElement).length).toBe(1);
le
t randomIndex = (Math.floor(Math.random() * (this.projectsData.length - 2)) + 0);
cons
t randomIndex = (Math.floor(Math.random() * (this.projectsData.length - 2)) + 0);
navigateWithKeys('up', randomIndex, () => {
expect($(FOCUSED_ITEM_SELECTOR, this.$dropdownMenuElement).length).toBe(1);
expect($(`${ITEM_SELECTOR}:eq(${((this.projectsData.length - 2) - randomIndex)}) a`, this.$dropdownMenuElement)).toHaveClass('is-focused');
...
...
@@ -110,14 +110,14 @@
it('should click the selected item on ENTER keypress', () => {
expect(this.dropdownContainerElement).toHaveClass('open');
le
t randomIndex = Math.floor(Math.random() * (this.projectsData.length - 1)) + 0;
cons
t randomIndex = Math.floor(Math.random() * (this.projectsData.length - 1)) + 0;
navigateWithKeys('down', randomIndex, () => {
spyOn(Turbolinks, 'visit').and.stub();
navigateWithKeys('enter', null, () => {
expect(this.dropdownContainerElement).not.toHaveClass('open');
le
t link = $(`${ITEM_SELECTOR}:eq(${randomIndex}) a`, this.$dropdownMenuElement);
cons
t link = $(`${ITEM_SELECTOR}:eq(${randomIndex}) a`, this.$dropdownMenuElement);
expect(link).toHaveClass('is-active');
le
t linkedLocation = link.attr('href');
cons
t linkedLocation = link.attr('href');
if (linkedLocation && linkedLocation !== '#') expect(Turbolinks.visit).toHaveBeenCalledWith(linkedLocation);
});
});
...
...
@@ -171,9 +171,8 @@
});
});
it('should still have input value on close and restore', () => {
le
t $searchInput = $(SEARCH_INPUT_SELECTOR);
cons
t $searchInput = $(SEARCH_INPUT_SELECTOR);
initDropDown.call(this, false, true);
$searchInput
.trigger('focus')
...
...
spec/javascripts/labels_issue_sidebar_spec.js.es6
View file @
83ecc02d
/* eslint-disable no-new
, prefer-const
*/
/* eslint-disable no-new */
/* global IssuableContext */
/* global LabelsSelect */
...
...
@@ -33,7 +33,7 @@
LABELS_DATA.push({ id: i, title: `test ${i}`, color: '#5CB85C' });
}
} else if (req.url === '/root/test/issues/2.json') {
le
t tmp = [];
cons
t tmp = [];
for (let i = 0; i < saveLabelCount; i += 1) {
tmp.push({ id: i, title: `test ${i}`, color: '#5CB85C' });
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment