Skip to content

Commit 00ccac8

Browse files
committed
Disable no-var rule for service-module mutations
1 parent 16dfac8 commit 00ccac8

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

src/service-module/service-module.mutations.ts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/*
22
eslint
33
@typescript-eslint/explicit-function-return-type: 0,
4-
@typescript-eslint/no-explicit-any: 0
4+
@typescript-eslint/no-explicit-any: 0,
5+
no-var: 0
56
*/
67
import Vue from 'vue'
78
import { serializeError } from 'serialize-error'
@@ -397,10 +398,15 @@ export default function makeServiceMutations() {
397398
state[`is${uppercaseMethod}Pending`] = false
398399
},
399400

400-
setIdPending(state, payload: { method: PendingIdServiceMethodName, id: Id | Id[] }): void {
401+
setIdPending(
402+
state,
403+
payload: { method: PendingIdServiceMethodName; id: Id | Id[] }
404+
): void {
401405
const { method, id } = payload
402406
const uppercaseMethod = method.charAt(0).toUpperCase() + method.slice(1)
403-
const isIdMethodPending = state[`isId${uppercaseMethod}Pending`] as ServiceState['isIdCreatePending']
407+
const isIdMethodPending = state[
408+
`isId${uppercaseMethod}Pending`
409+
] as ServiceState['isIdCreatePending']
404410
// if `id` is an array, ensure it doesn't have duplicates
405411
const ids = Array.isArray(id) ? [...new Set(id)] : [id]
406412
ids.forEach(id => {
@@ -409,10 +415,15 @@ export default function makeServiceMutations() {
409415
}
410416
})
411417
},
412-
unsetIdPending(state, payload: { method: PendingIdServiceMethodName, id: Id | Id[] }): void {
418+
unsetIdPending(
419+
state,
420+
payload: { method: PendingIdServiceMethodName; id: Id | Id[] }
421+
): void {
413422
const { method, id } = payload
414423
const uppercaseMethod = method.charAt(0).toUpperCase() + method.slice(1)
415-
const isIdMethodPending = state[`isId${uppercaseMethod}Pending`] as ServiceState['isIdCreatePending']
424+
const isIdMethodPending = state[
425+
`isId${uppercaseMethod}Pending`
426+
] as ServiceState['isIdCreatePending']
416427
// if `id` is an array, ensure it doesn't have duplicates
417428
const ids = Array.isArray(id) ? [...new Set(id)] : [id]
418429
ids.forEach(id => {
@@ -423,7 +434,10 @@ export default function makeServiceMutations() {
423434
})
424435
},
425436

426-
setError(state, payload: { method: PendingServiceMethodName; error: Error }): void {
437+
setError(
438+
state,
439+
payload: { method: PendingServiceMethodName; error: Error }
440+
): void {
427441
const { method, error } = payload
428442
const uppercaseMethod = method.charAt(0).toUpperCase() + method.slice(1)
429443
state[`errorOn${uppercaseMethod}`] = Object.assign(

0 commit comments

Comments
 (0)