Commit 05100749 authored by Mike Greiling's avatar Mike Greiling

Merge branch 'eslint-update-no-param-reassign' into 'master'

Update eslintrc no-param-reassign to allow props reassignment

See merge request gitlab-org/gitlab-ce!21393
parents bd0971bd 254cfcb7
...@@ -33,6 +33,15 @@ rules: ...@@ -33,6 +33,15 @@ rules:
- error - error
- max: 1 - max: 1
promise/catch-or-return: error promise/catch-or-return: error
no-param-reassign:
- error
- props: true
ignorePropertyModificationsFor:
- "acc" # for reduce accumulators
- "accumulator" # for reduce accumulators
- "el" # for DOM elements
- "element" # for DOM elements
- "state" # for Vuex mutations
no-underscore-dangle: no-underscore-dangle:
- error - error
- allow: - allow:
......
...@@ -107,7 +107,6 @@ export default { ...@@ -107,7 +107,6 @@ export default {
}, },
[types.EXPAND_ALL_FILES](state) { [types.EXPAND_ALL_FILES](state) {
// eslint-disable-next-line no-param-reassign
state.diffFiles = state.diffFiles.map(file => ({ state.diffFiles = state.diffFiles.map(file => ({
...file, ...file,
collapsed: false, collapsed: false,
......
...@@ -65,8 +65,8 @@ export const hideMenu = (el) => { ...@@ -65,8 +65,8 @@ export const hideMenu = (el) => {
const parentEl = el.parentNode; const parentEl = el.parentNode;
el.style.display = ''; // eslint-disable-line no-param-reassign el.style.display = '';
el.style.transform = ''; // eslint-disable-line no-param-reassign el.style.transform = '';
el.classList.remove(IS_ABOVE_CLASS); el.classList.remove(IS_ABOVE_CLASS);
parentEl.classList.remove(IS_OVER_CLASS); parentEl.classList.remove(IS_OVER_CLASS);
parentEl.classList.remove(IS_SHOWING_FLY_OUT_CLASS); parentEl.classList.remove(IS_SHOWING_FLY_OUT_CLASS);
......
/* eslint-disable no-param-reassign */
import * as types from './mutation_types'; import * as types from './mutation_types';
export default { export default {
......
/* eslint-disable no-param-reassign */
import * as types from './mutation_types'; import * as types from './mutation_types';
export default { export default {
......
/* eslint-disable no-param-reassign */
import * as types from './mutation_types'; import * as types from './mutation_types';
export default { export default {
......
/* eslint-disable no-param-reassign */
import * as types from './mutation_types'; import * as types from './mutation_types';
import { normalizeJob } from './utils'; import { normalizeJob } from './utils';
......
/* eslint-disable no-param-reassign */
import * as types from './mutation_types'; import * as types from './mutation_types';
import projectMutations from './mutations/project'; import projectMutations from './mutations/project';
import mergeRequestMutation from './mutations/merge_request'; import mergeRequestMutation from './mutations/merge_request';
......
/* eslint-disable no-param-reassign */
import * as types from '../mutation_types'; import * as types from '../mutation_types';
import { sortTree } from '../utils'; import { sortTree } from '../utils';
import { diffModes } from '../../constants'; import { diffModes } from '../../constants';
......
/* eslint-disable no-param-reassign */
import * as types from './mutation_types'; import * as types from './mutation_types';
export default { export default {
......
...@@ -132,10 +132,8 @@ export default { ...@@ -132,10 +132,8 @@ export default {
if (this.pipeline.ref) { if (this.pipeline.ref) {
return Object.keys(this.pipeline.ref).reduce((accumulator, prop) => { return Object.keys(this.pipeline.ref).reduce((accumulator, prop) => {
if (prop === 'path') { if (prop === 'path') {
// eslint-disable-next-line no-param-reassign
accumulator.ref_url = this.pipeline.ref[prop]; accumulator.ref_url = this.pipeline.ref[prop];
} else { } else {
// eslint-disable-next-line no-param-reassign
accumulator[prop] = this.pipeline.ref[prop]; accumulator[prop] = this.pipeline.ref[prop];
} }
return accumulator; return accumulator;
......
/* eslint-disable no-param-reassign */
import * as types from './mutation_types'; import * as types from './mutation_types';
export default { export default {
......
...@@ -28,7 +28,7 @@ Vue.http.interceptors.push((request, next) => { ...@@ -28,7 +28,7 @@ Vue.http.interceptors.push((request, next) => {
response.headers.forEach((value, key) => { response.headers.forEach((value, key) => {
headers[key] = value; headers[key] = value;
}); });
// eslint-disable-next-line no-param-reassign
response.headers = headers; response.headers = headers;
}); });
}); });
...@@ -5,6 +5,7 @@ export const headersInterceptor = (request, next) => { ...@@ -5,6 +5,7 @@ export const headersInterceptor = (request, next) => {
response.headers.forEach((value, key) => { response.headers.forEach((value, key) => {
headers[key] = value; headers[key] = value;
}); });
// eslint-disable-next-line no-param-reassign
response.headers = headers; response.headers = headers;
}); });
}; };
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