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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
dbc74800
Commit
dbc74800
authored
Jun 13, 2018
by
gfyoung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable no-multi-assignment in JS files
Partially addresses #47006.
parent
102db0aa
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
38 additions
and
13 deletions
+38
-13
.eslintrc.yml
.eslintrc.yml
+0
-2
app/assets/javascripts/lib/utils/common_utils.js
app/assets/javascripts/lib/utils/common_utils.js
+4
-1
app/assets/javascripts/line_highlighter.js
app/assets/javascripts/line_highlighter.js
+2
-0
app/assets/javascripts/monitoring/components/dashboard.vue
app/assets/javascripts/monitoring/components/dashboard.vue
+1
-1
app/assets/javascripts/monitoring/components/graph.vue
app/assets/javascripts/monitoring/components/graph.vue
+1
-1
app/assets/javascripts/network/branch_graph.js
app/assets/javascripts/network/branch_graph.js
+4
-0
app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors.js
...pts/pages/projects/graphs/show/stat_graph_contributors.js
+3
-1
app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors_util.js
...ages/projects/graphs/show/stat_graph_contributors_util.js
+6
-1
app/assets/javascripts/profile/gl_crop.js
app/assets/javascripts/profile/gl_crop.js
+2
-0
app/assets/javascripts/project_find_file.js
app/assets/javascripts/project_find_file.js
+2
-0
app/assets/javascripts/prometheus_metrics/prometheus_metrics.js
...sets/javascripts/prometheus_metrics/prometheus_metrics.js
+1
-1
app/assets/javascripts/users_select.js
app/assets/javascripts/users_select.js
+3
-0
app/assets/javascripts/vue_merge_request_widget/components/memory_usage.vue
...ipts/vue_merge_request_widget/components/memory_usage.vue
+1
-1
spec/javascripts/gl_field_errors_spec.js
spec/javascripts/gl_field_errors_spec.js
+3
-1
spec/javascripts/helpers/user_mock_data_helper.js
spec/javascripts/helpers/user_mock_data_helper.js
+1
-1
spec/javascripts/profile/account/components/update_username_spec.js
...cripts/profile/account/components/update_username_spec.js
+2
-1
spec/javascripts/test_bundle.js
spec/javascripts/test_bundle.js
+2
-1
No files found.
.eslintrc.yml
View file @
dbc74800
...
@@ -71,5 +71,3 @@ rules:
...
@@ -71,5 +71,3 @@ rules:
body
:
1
body
:
1
## Destructuring: https://eslint.org/docs/rules/prefer-destructuring
## Destructuring: https://eslint.org/docs/rules/prefer-destructuring
prefer-destructuring
:
off
prefer-destructuring
:
off
## no-multi-assign: https://eslint.org/docs/rules/no-multi-assign
no-multi-assign
:
off
app/assets/javascripts/lib/utils/common_utils.js
View file @
dbc74800
...
@@ -197,7 +197,10 @@ export const insertText = (target, text) => {
...
@@ -197,7 +197,10 @@ export const insertText = (target, text) => {
// eslint-disable-next-line no-param-reassign
// eslint-disable-next-line no-param-reassign
target
.
value
=
newText
;
target
.
value
=
newText
;
// eslint-disable-next-line no-param-reassign
// eslint-disable-next-line no-param-reassign
target
.
selectionStart
=
target
.
selectionEnd
=
selectionStart
+
insertedText
.
length
;
target
.
selectionStart
=
selectionStart
+
insertedText
.
length
;
// eslint-disable-next-line no-param-reassign
target
.
selectionEnd
=
selectionStart
+
insertedText
.
length
;
// Trigger autosave
// Trigger autosave
target
.
dispatchEvent
(
new
Event
(
'
input
'
));
target
.
dispatchEvent
(
new
Event
(
'
input
'
));
...
...
app/assets/javascripts/line_highlighter.js
View file @
dbc74800
...
@@ -145,6 +145,8 @@ LineHighlighter.prototype.highlightRange = function(range) {
...
@@ -145,6 +145,8 @@ LineHighlighter.prototype.highlightRange = function(range) {
var
i
,
lineNumber
,
ref
,
ref1
,
results
;
var
i
,
lineNumber
,
ref
,
ref1
,
results
;
if
(
range
[
1
])
{
if
(
range
[
1
])
{
results
=
[];
results
=
[];
// eslint-disable-next-line no-multi-assign
for
(
lineNumber
=
i
=
ref
=
range
[
0
],
ref1
=
range
[
1
];
ref
<=
ref1
?
i
<=
ref1
:
i
>=
ref1
;
lineNumber
=
ref
<=
ref1
?
(
i
+=
1
)
:
(
i
-=
1
))
{
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
));
}
}
...
...
app/assets/javascripts/monitoring/components/dashboard.vue
View file @
dbc74800
...
@@ -139,7 +139,7 @@ export default {
...
@@ -139,7 +139,7 @@ export default {
this
.
updateAspectRatio
=
true
;
this
.
updateAspectRatio
=
true
;
},
},
toggleAspectRatio
()
{
toggleAspectRatio
()
{
this
.
updatedAspectRatios
=
this
.
updatedAspectRatios
+=
1
;
this
.
updatedAspectRatios
+=
1
;
if
(
this
.
store
.
getMetricsCount
()
===
this
.
updatedAspectRatios
)
{
if
(
this
.
store
.
getMetricsCount
()
===
this
.
updatedAspectRatios
)
{
this
.
updateAspectRatio
=
!
this
.
updateAspectRatio
;
this
.
updateAspectRatio
=
!
this
.
updateAspectRatio
;
this
.
updatedAspectRatios
=
0
;
this
.
updatedAspectRatios
=
0
;
...
...
app/assets/javascripts/monitoring/components/graph.vue
View file @
dbc74800
...
@@ -154,7 +154,7 @@ export default {
...
@@ -154,7 +154,7 @@ export default {
point
.
x
=
e
.
clientX
;
point
.
x
=
e
.
clientX
;
point
.
y
=
e
.
clientY
;
point
.
y
=
e
.
clientY
;
point
=
point
.
matrixTransform
(
this
.
$refs
.
graphData
.
getScreenCTM
().
inverse
());
point
=
point
.
matrixTransform
(
this
.
$refs
.
graphData
.
getScreenCTM
().
inverse
());
point
.
x
=
point
.
x
+=
7
;
point
.
x
+=
7
;
const
firstTimeSeries
=
this
.
timeSeries
[
0
];
const
firstTimeSeries
=
this
.
timeSeries
[
0
];
const
timeValueOverlay
=
firstTimeSeries
.
timeSeriesScaleX
.
invert
(
point
.
x
);
const
timeValueOverlay
=
firstTimeSeries
.
timeSeriesScaleX
.
invert
(
point
.
x
);
const
overlayIndex
=
bisectDate
(
firstTimeSeries
.
values
,
timeValueOverlay
,
1
);
const
overlayIndex
=
bisectDate
(
firstTimeSeries
.
values
,
timeValueOverlay
,
1
);
...
...
app/assets/javascripts/network/branch_graph.js
View file @
dbc74800
...
@@ -112,6 +112,8 @@ export default (function() {
...
@@ -112,6 +112,8 @@ export default (function() {
fill
:
"
#444
"
fill
:
"
#444
"
});
});
ref
=
this
.
days
;
ref
=
this
.
days
;
// eslint-disable-next-line no-multi-assign
for
(
mm
=
j
=
0
,
len
=
ref
.
length
;
j
<
len
;
mm
=
(
j
+=
1
))
{
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
])
{
...
@@ -285,6 +287,8 @@ export default (function() {
...
@@ -285,6 +287,8 @@ export default (function() {
r
=
this
.
r
;
r
=
this
.
r
;
ref
=
commit
.
parents
;
ref
=
commit
.
parents
;
results
=
[];
results
=
[];
// eslint-disable-next-line no-multi-assign
for
(
i
=
j
=
0
,
len
=
ref
.
length
;
j
<
len
;
i
=
(
j
+=
1
))
{
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
]];
...
...
app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors.js
View file @
dbc74800
...
@@ -36,7 +36,9 @@ export default (function() {
...
@@ -36,7 +36,9 @@ export default (function() {
var
author_graph
,
author_header
;
var
author_graph
,
author_header
;
author_header
=
_this
.
create_author_header
(
d
);
author_header
=
_this
.
create_author_header
(
d
);
$
(
"
.contributors-list
"
).
append
(
author_header
);
$
(
"
.contributors-list
"
).
append
(
author_header
);
_this
.
authors
[
d
.
author_name
]
=
author_graph
=
new
ContributorsAuthorGraph
(
d
.
dates
);
author_graph
=
new
ContributorsAuthorGraph
(
d
.
dates
);
_this
.
authors
[
d
.
author_name
]
=
author_graph
;
return
author_graph
.
draw
();
return
author_graph
.
draw
();
};
};
})(
this
));
})(
this
));
...
...
app/assets/javascripts/pages/projects/graphs/show/stat_graph_contributors_util.js
View file @
dbc74800
...
@@ -111,10 +111,15 @@ export default {
...
@@ -111,10 +111,15 @@ export default {
parse_log_entry
:
function
(
log_entry
,
field
,
date_range
)
{
parse_log_entry
:
function
(
log_entry
,
field
,
date_range
)
{
var
parsed_entry
;
var
parsed_entry
;
parsed_entry
=
{};
parsed_entry
=
{};
parsed_entry
.
author_name
=
log_entry
.
author_name
;
parsed_entry
.
author_name
=
log_entry
.
author_name
;
parsed_entry
.
author_email
=
log_entry
.
author_email
;
parsed_entry
.
author_email
=
log_entry
.
author_email
;
parsed_entry
.
dates
=
{};
parsed_entry
.
dates
=
{};
parsed_entry
.
commits
=
parsed_entry
.
additions
=
parsed_entry
.
deletions
=
0
;
parsed_entry
.
commits
=
0
;
parsed_entry
.
additions
=
0
;
parsed_entry
.
deletions
=
0
;
_
.
each
(
_
.
omit
(
log_entry
,
'
author_name
'
,
'
author_email
'
),
(
function
(
_this
)
{
_
.
each
(
_
.
omit
(
log_entry
,
'
author_name
'
,
'
author_email
'
),
(
function
(
_this
)
{
return
function
(
value
,
key
)
{
return
function
(
value
,
key
)
{
if
(
_this
.
in_range
(
value
.
date
,
date_range
))
{
if
(
_this
.
in_range
(
value
.
date
,
date_range
))
{
...
...
app/assets/javascripts/profile/gl_crop.js
View file @
dbc74800
...
@@ -139,6 +139,8 @@ import _ from 'underscore';
...
@@ -139,6 +139,8 @@ import _ from 'underscore';
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
=
[];
// eslint-disable-next-line no-multi-assign
for
(
k
=
i
=
0
,
len
=
binary
.
length
;
i
<
len
;
k
=
(
i
+=
1
))
{
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
));
...
...
app/assets/javascripts/project_find_file.js
View file @
dbc74800
...
@@ -91,6 +91,8 @@ export default class ProjectFindFile {
...
@@ -91,6 +91,8 @@ export default class ProjectFindFile {
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
=
[];
// eslint-disable-next-line no-multi-assign
for
(
i
=
j
=
0
,
len
=
filePaths
.
length
;
j
<
len
;
i
=
(
j
+=
1
))
{
for
(
i
=
j
=
0
,
len
=
filePaths
.
length
;
j
<
len
;
i
=
(
j
+=
1
))
{
filePath
=
filePaths
[
i
];
filePath
=
filePaths
[
i
];
if
(
i
===
20
)
{
if
(
i
===
20
)
{
...
...
app/assets/javascripts/prometheus_metrics/prometheus_metrics.js
View file @
dbc74800
...
@@ -107,7 +107,7 @@ export default class PrometheusMetrics {
...
@@ -107,7 +107,7 @@ export default class PrometheusMetrics {
if
(
data
&&
data
.
success
)
{
if
(
data
&&
data
.
success
)
{
stop
(
data
);
stop
(
data
);
}
else
{
}
else
{
this
.
backOffRequestCounter
=
this
.
backOffRequestCounter
+=
1
;
this
.
backOffRequestCounter
+=
1
;
if
(
this
.
backOffRequestCounter
<
3
)
{
if
(
this
.
backOffRequestCounter
<
3
)
{
next
();
next
();
}
else
{
}
else
{
...
...
app/assets/javascripts/users_select.js
View file @
dbc74800
...
@@ -259,6 +259,7 @@ function UsersSelect(currentUser, els, options = {}) {
...
@@ -259,6 +259,7 @@ function UsersSelect(currentUser, els, options = {}) {
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
// eslint-disable-next-line no-multi-assign
for
(
index
=
j
=
0
,
len
=
users
.
length
;
j
<
len
;
index
=
(
j
+=
1
))
{
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
)
{
...
@@ -561,6 +562,8 @@ function UsersSelect(currentUser, els, options = {}) {
...
@@ -561,6 +562,8 @@ function UsersSelect(currentUser, els, options = {}) {
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
;
// eslint-disable-next-line no-multi-assign
for
(
index
=
j
=
0
,
len
=
ref
.
length
;
j
<
len
;
index
=
(
j
+=
1
))
{
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
)
{
...
...
app/assets/javascripts/vue_merge_request_widget/components/memory_usage.vue
View file @
dbc74800
...
@@ -105,7 +105,7 @@ export default {
...
@@ -105,7 +105,7 @@ export default {
MRWidgetService
.
fetchMetrics
(
this
.
metricsUrl
)
MRWidgetService
.
fetchMetrics
(
this
.
metricsUrl
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
if
(
res
.
status
===
statusCodes
.
NO_CONTENT
)
{
if
(
res
.
status
===
statusCodes
.
NO_CONTENT
)
{
this
.
backOffRequestCounter
=
this
.
backOffRequestCounter
+=
1
;
this
.
backOffRequestCounter
+=
1
;
/* eslint-disable no-unused-expressions */
/* eslint-disable no-unused-expressions */
this
.
backOffRequestCounter
<
3
?
next
()
:
stop
(
res
);
this
.
backOffRequestCounter
<
3
?
next
()
:
stop
(
res
);
}
else
{
}
else
{
...
...
spec/javascripts/gl_field_errors_spec.js
View file @
dbc74800
...
@@ -8,7 +8,9 @@ describe('GL Style Field Errors', function() {
...
@@ -8,7 +8,9 @@ describe('GL Style Field Errors', function() {
beforeEach
(
function
()
{
beforeEach
(
function
()
{
loadFixtures
(
'
static/gl_field_errors.html.raw
'
);
loadFixtures
(
'
static/gl_field_errors.html.raw
'
);
const
$form
=
this
.
$form
=
$
(
'
form.gl-show-field-errors
'
);
const
$form
=
$
(
'
form.gl-show-field-errors
'
);
this
.
$form
=
$form
;
this
.
fieldErrors
=
new
GlFieldErrors
(
$form
);
this
.
fieldErrors
=
new
GlFieldErrors
(
$form
);
});
});
...
...
spec/javascripts/helpers/user_mock_data_helper.js
View file @
dbc74800
export
default
{
export
default
{
createNumberRandomUsers
(
numberUsers
)
{
createNumberRandomUsers
(
numberUsers
)
{
const
users
=
[];
const
users
=
[];
for
(
let
i
=
0
;
i
<
numberUsers
;
i
=
i
+=
1
)
{
for
(
let
i
=
0
;
i
<
numberUsers
;
i
+=
1
)
{
users
.
push
(
users
.
push
(
{
{
avatar
:
'
https://gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon
'
,
avatar
:
'
https://gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon
'
,
...
...
spec/javascripts/profile/account/components/update_username_spec.js
View file @
dbc74800
...
@@ -90,7 +90,8 @@ describe('UpdateUsername component', () => {
...
@@ -90,7 +90,8 @@ describe('UpdateUsername component', () => {
it
(
'
confirmation modal should escape usernames properly
'
,
done
=>
{
it
(
'
confirmation modal should escape usernames properly
'
,
done
=>
{
const
{
modalBody
}
=
findElements
();
const
{
modalBody
}
=
findElements
();
vm
.
username
=
vm
.
newUsername
=
'
<i>Italic</i>
'
;
vm
.
username
=
'
<i>Italic</i>
'
;
vm
.
newUsername
=
vm
.
username
;
Vue
.
nextTick
()
Vue
.
nextTick
()
.
then
(()
=>
{
.
then
(()
=>
{
...
...
spec/javascripts/test_bundle.js
View file @
dbc74800
...
@@ -39,7 +39,8 @@ jasmine.getJSONFixtures().fixturesPath = FIXTURES_PATH;
...
@@ -39,7 +39,8 @@ jasmine.getJSONFixtures().fixturesPath = FIXTURES_PATH;
beforeAll
(()
=>
jasmine
.
addMatchers
(
customMatchers
));
beforeAll
(()
=>
jasmine
.
addMatchers
(
customMatchers
));
// globalize common libraries
// globalize common libraries
window
.
$
=
window
.
jQuery
=
$
;
window
.
$
=
$
;
window
.
jQuery
=
window
.
$
;
// stub expected globals
// stub expected globals
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
...
...
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