Skip to content

Commit 53df628

Browse files
committed
fix(lint): run lint --fix
1 parent 15f5fb1 commit 53df628

File tree

5 files changed

+43
-21
lines changed

5 files changed

+43
-21
lines changed

src/FeathersVuexFind.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,23 @@ export default {
7070
return _get(this.pagination, `[${this.queryId}]`) || {}
7171
},
7272
pageInfo() {
73-
if (this.pagination == null || this.queryId == null || this.pageId == null) return {}
73+
if (
74+
this.pagination == null ||
75+
this.queryId == null ||
76+
this.pageId == null
77+
)
78+
return {}
7479
return _get(this.pagination, `[${this.queryId}][${this.pageId}]`) || {}
7580
},
7681
scope() {
7782
const { items, isFindPending, pagination, queryInfo, pageInfo } = this
78-
const defaultScope = { isFindPending, pagination, items, queryInfo, pageInfo }
83+
const defaultScope = {
84+
isFindPending,
85+
pagination,
86+
items,
87+
queryInfo,
88+
pageInfo
89+
}
7990

8091
return this.editScope(defaultScope) || defaultScope
8192
}
@@ -96,7 +107,7 @@ export default {
96107

97108
return this.$store
98109
.dispatch(`${this.service}/find`, params)
99-
.then((response) => {
110+
.then(response => {
100111
this.isFindPending = false
101112
const { queryId, pageId } = getQueryInfo(params, response)
102113
this.queryId = queryId
@@ -110,7 +121,7 @@ export default {
110121
if (this.query) {
111122
return this.findData()
112123
} else {
113-
// TODO: access debug boolean from from the store config, somehow.
124+
// TODO: access debug boolean from the store config, somehow.
114125
// eslint-disable-next-line no-console
115126
console.log(
116127
`No query and no id provided, so no data will be fetched.`
@@ -127,7 +138,7 @@ export default {
127138
}
128139
if (!this.$store.state[this.service]) {
129140
throw new Error(
130-
`The '${ this.service }' plugin not registered with feathers-vuex`
141+
`The '${this.service}' plugin not registered with feathers-vuex`
131142
)
132143
}
133144

test/auth-module/actions.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe('Auth Module - Actions', () => {
4242
assert(authState.errorOnLogout === null)
4343
assert(authState.isAuthenticatePending === false)
4444
assert(authState.isLogoutPending === false)
45-
let expectedPayload = {
45+
const expectedPayload = {
4646
userId: 0,
4747
exp: 9999999999999
4848
}
@@ -109,7 +109,7 @@ describe('Auth Module - Actions', () => {
109109
actions.authenticate
110110
.call({ $store: store }, request)
111111
.then(response => {
112-
let expectedUser = {
112+
const expectedUser = {
113113
id: 0,
114114
115115
}

test/auth.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ describe('feathers-vuex:auth', () => {
1414
})
1515

1616
it('throws an error if the auth plugin is missing', () => {
17-
var app = {}
18-
var store = {}
19-
var plugin = feathersVuexAuth(store).bind(app)
17+
const app = {}
18+
const store = {}
19+
const plugin = feathersVuexAuth(store).bind(app)
2020
assert.throws(
2121
plugin,
2222
'You must first register the @feathersjs/authentication-client plugin'
2323
)
2424
})
2525

2626
it('returns the app, is chainable', () => {
27-
var app = {
27+
const app = {
2828
authenticate() {}
2929
}
30-
var store = {}
31-
var returnValue = feathersVuexAuth(store).bind(app)()
30+
const store = {}
31+
const returnValue = feathersVuexAuth(store).bind(app)()
3232
assert(returnValue === app)
3333
})
3434

test/service-module/service-module.actions.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,19 @@ function makeContext() {
7979
})
8080
class Todo extends BaseModel {
8181
public static modelName = 'Todo'
82-
public static test: boolean = true
82+
public static test = true
8383
}
8484
class Task extends BaseModel {
8585
public static modelName = 'Task'
86-
public static test: boolean = true
86+
public static test = true
8787
}
8888
class NoId extends BaseModel {
8989
public static modelName = 'NoId'
90-
public static test: boolean = true
90+
public static test = true
9191
}
9292
class Broken extends BaseModel {
9393
public static modelName = 'Broken'
94-
public static test: boolean = true
94+
public static test = true
9595
}
9696
return {
9797
makeServicePlugin,
@@ -151,7 +151,7 @@ describe('Service Module - Actions', () => {
151151
assert(todoState.ids.length === 10, 'three ids populated')
152152
assert(todoState.errorOnFind === null, 'errorOnFind still null')
153153
assert(todoState.isFindPending === false, 'isFindPending is false')
154-
let expectedKeyedById: NumberedList = makeStore()
154+
const expectedKeyedById: NumberedList = makeStore()
155155
const currentKeyedById = JSON.parse(
156156
JSON.stringify(todoState.keyedById)
157157
)

test/service-module/service-module.test.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ function makeContext() {
4949
public constructor(data, options?) {
5050
super(data, options)
5151
}
52+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
5253
public static instanceDefaults(data) {
5354
return {
5455
description: ''
@@ -309,22 +310,22 @@ describe('Service Module', function() {
309310
})
310311

311312
it(`the object returned from clone is not the same as the original`, function() {
312-
const { serviceTodo, owners } = this
313+
const { serviceTodo } = this
313314
const serviceTodoClone = serviceTodo.clone()
314315

315316
assert(serviceTodo !== serviceTodoClone, 'the objects are distinct')
316317
})
317318

318319
it(`the object returned from commit is not the same as the clone`, function() {
319-
const { serviceTodo, owners } = this
320+
const { serviceTodo } = this
320321
const serviceTodoClone = serviceTodo.clone()
321322
const committedTodo = serviceTodoClone.commit()
322323

323324
assert(committedTodo !== serviceTodoClone, 'the objects are distinct')
324325
})
325326

326327
it(`the object returned from commit is the same as the original`, function() {
327-
const { serviceTodo, owners } = this
328+
const { serviceTodo } = this
328329
const serviceTodoClone = serviceTodo.clone()
329330
const committedTodo = serviceTodoClone.commit()
330331

@@ -718,6 +719,7 @@ describe('Service Module', function() {
718719
// Load some data into the store
719720
store
720721
.dispatch('todos/find', { query: {} })
722+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
721723
.then(todos => {
722724
// Remove the third item from the service
723725
// @ts-ignore
@@ -731,6 +733,7 @@ describe('Service Module', function() {
731733
// Perform the same query again
732734
return store.dispatch('todos/find', { query: {} })
733735
})
736+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
734737
.then(todos => {
735738
assert(
736739
todoState.ids.length === 2,
@@ -768,6 +771,7 @@ describe('Service Module', function() {
768771
// Load some data into the store
769772
store
770773
.dispatch('tasks/find', { query: {} })
774+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
771775
.then(todos => {
772776
// Remove the third item from the service
773777
// @ts-ignore
@@ -818,6 +822,7 @@ describe('Service Module', function() {
818822
// Load some data into the store
819823
store
820824
.dispatch('todos/find', { query: {} })
825+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
821826
.then(todos => {
822827
// Remove the third item from the service
823828
// @ts-ignore
@@ -831,6 +836,7 @@ describe('Service Module', function() {
831836
// Perform the same query again
832837
return store.dispatch('todos/find', { query: {} })
833838
})
839+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
834840
.then(todos => {
835841
assert(
836842
todoState.ids.length === 3,
@@ -902,6 +908,7 @@ describe('Service Module', function() {
902908
it('allows custom getters', function() {
903909
const { makeServicePlugin, ServiceTodo } = makeContext()
904910
const customGetters = {
911+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
905912
oneTwoThree(state) {
906913
return 123
907914
}
@@ -973,6 +980,7 @@ describe('Service Module', function() {
973980
]
974981
})
975982

983+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
976984
feathersSocketioClient.service('things').on('created', item => {
977985
assert(
978986
store.state.things.keyedById[0].test,
@@ -997,6 +1005,7 @@ describe('Service Module', function() {
9971005

9981006
store.commit('things/addItem', { id: 1, test: false })
9991007

1008+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
10001009
feathersSocketioClient.service('things').on('patched', item => {
10011010
assert(
10021011
store.state.things.keyedById[1].test,
@@ -1021,6 +1030,7 @@ describe('Service Module', function() {
10211030

10221031
store.commit('things/addItem', { id: 1, test: false })
10231032

1033+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
10241034
feathersSocketioClient.service('things').on('updated', item => {
10251035
assert(
10261036
store.state.things.keyedById[1].test,
@@ -1045,6 +1055,7 @@ describe('Service Module', function() {
10451055

10461056
store.commit('things/addItem', { id: 1, test: false })
10471057

1058+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
10481059
feathersSocketioClient.service('things').on('removed', item => {
10491060
assert(
10501061
!store.state.things.keyedById[1],

0 commit comments

Comments
 (0)