Updapte eslintrc no-param-reassign with 'ignorePropertyModificationsFor'

This commit is contained in:
Paul Slaughter 2018-08-27 16:21:02 +02:00
parent 44d251edf7
commit 254cfcb7f4
14 changed files with 13 additions and 15 deletions

View file

@ -33,6 +33,15 @@ rules:
- error
- max: 1
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:
- error
- allow:

View file

@ -107,7 +107,6 @@ export default {
},
[types.EXPAND_ALL_FILES](state) {
// eslint-disable-next-line no-param-reassign
state.diffFiles = state.diffFiles.map(file => ({
...file,
collapsed: false,

View file

@ -65,8 +65,8 @@ export const hideMenu = (el) => {
const parentEl = el.parentNode;
el.style.display = ''; // eslint-disable-line no-param-reassign
el.style.transform = ''; // eslint-disable-line no-param-reassign
el.style.display = '';
el.style.transform = '';
el.classList.remove(IS_ABOVE_CLASS);
parentEl.classList.remove(IS_OVER_CLASS);
parentEl.classList.remove(IS_SHOWING_FLY_OUT_CLASS);

View file

@ -1,4 +1,3 @@
/* eslint-disable no-param-reassign */
import * as types from './mutation_types';
export default {

View file

@ -1,4 +1,3 @@
/* eslint-disable no-param-reassign */
import * as types from './mutation_types';
export default {

View file

@ -1,4 +1,3 @@
/* eslint-disable no-param-reassign */
import * as types from './mutation_types';
export default {

View file

@ -1,4 +1,3 @@
/* eslint-disable no-param-reassign */
import * as types from './mutation_types';
import { normalizeJob } from './utils';

View file

@ -1,4 +1,3 @@
/* eslint-disable no-param-reassign */
import * as types from './mutation_types';
import projectMutations from './mutations/project';
import mergeRequestMutation from './mutations/merge_request';

View file

@ -1,4 +1,3 @@
/* eslint-disable no-param-reassign */
import * as types from '../mutation_types';
import { sortTree } from '../utils';
import { diffModes } from '../../constants';

View file

@ -1,5 +1,3 @@
/* eslint-disable no-param-reassign */
import * as types from './mutation_types';
export default {

View file

@ -132,10 +132,8 @@ export default {
if (this.pipeline.ref) {
return Object.keys(this.pipeline.ref).reduce((accumulator, prop) => {
if (prop === 'path') {
// eslint-disable-next-line no-param-reassign
accumulator.ref_url = this.pipeline.ref[prop];
} else {
// eslint-disable-next-line no-param-reassign
accumulator[prop] = this.pipeline.ref[prop];
}
return accumulator;

View file

@ -1,4 +1,3 @@
/* eslint-disable no-param-reassign */
import * as types from './mutation_types';
export default {

View file

@ -28,7 +28,7 @@ Vue.http.interceptors.push((request, next) => {
response.headers.forEach((value, key) => {
headers[key] = value;
});
// eslint-disable-next-line no-param-reassign
response.headers = headers;
});
});

View file

@ -5,6 +5,7 @@ export const headersInterceptor = (request, next) => {
response.headers.forEach((value, key) => {
headers[key] = value;
});
// eslint-disable-next-line no-param-reassign
response.headers = headers;
});
};