Skip to content

Commit

Permalink
fix: 🐛 lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hcfw007 committed Apr 25, 2023
1 parent d5f887e commit 53f8fd4
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/agents/cache-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class CacheAgent {
*/
const lruOptions = (maxSize = 100): QuickLruOptions<any, any> => ({
maxAge: 15 * 60 * 1000 * 1000, // 15 minutes
maxSize: maxSize,
maxSize,
})

this.contact = new QuickLru<string, ContactPayload>(lruOptions(
Expand Down
2 changes: 1 addition & 1 deletion src/mixins/contact-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const contactMixin = <MixinBase extends CacheMixin & typeof PuppetSkeleton>(mixi
try {
// make sure the contact id has valid payload
await this.contactPayload(query.id)
return [query.id]
return [ query.id ]
} catch (e) {
log.verbose('PuppetContactMixin', 'contactSearch() payload not found for id "%s"', query.id)
await this.contactPayloadDirty(query.id)
Expand Down
4 changes: 2 additions & 2 deletions src/mixins/message-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const messageMixin = <MinxinBase extends typeof PuppetSkeleton & CacheMixin>(bas

messageList (): string[] {
log.verbose('PuppetMessageMixin', 'messageList()')
return [...this.cache.message.keys()]
return [ ...this.cache.message.keys() ]
}

async messageSearch (
Expand All @@ -162,7 +162,7 @@ const messageMixin = <MinxinBase extends typeof PuppetSkeleton & CacheMixin>(bas
try {
// make sure the room id has valid payload
await this.messagePayload(query.id)
return [query.id]
return [ query.id ]
} catch (e) {
log.verbose('PuppetMessageMixin', 'messageSearch() payload not found for id "%s"', query.id)
return []
Expand Down
2 changes: 1 addition & 1 deletion src/mixins/post-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const postMixin = <MinxinBase extends typeof PuppetSkeleton & CacheMixin>(baseMi
*/
postList (): string[] {
log.verbose('PuppetPostMixin', 'postList()')
return [...this.cache.post.keys()]
return [ ...this.cache.post.keys() ]
}

async postPayloadDirty (
Expand Down
2 changes: 1 addition & 1 deletion src/mixins/room-member-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const roomMemberMixin = <MixinBase extends typeof PuppetSkeleton & ContactMixin>
*/
if (typeof query === 'symbol') {
if (query === YOU) {
return [this.currentUserId]
return [ this.currentUserId ]
}
/**
* Huan(202111): We use `symbol` instead of `uniq symbol` in the method argument
Expand Down
2 changes: 1 addition & 1 deletion src/mixins/room-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const roomMixin = <MixinBase extends typeof PuppetSkeleton & ContactMixin & Room
try {
// make sure the room id has valid payload
await this.roomPayload(query.id)
return [query.id]
return [ query.id ]
} catch (e) {
log.verbose('PuppetRoomMixin', 'roomSearch() payload not found for id "%s"', query.id)
await this.roomPayloadDirty(query.id)
Expand Down
16 changes: 8 additions & 8 deletions src/puppet/puppet-abstract.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ test('contactQueryFilterFunction()', async t => {

void t.test('filter name by regex', async t => {
const QUERY = { name: REGEX_VALUE }
const ID_LIST = ['id1', 'id3']
const ID_LIST = [ 'id1', 'id3' ]

const func = puppet.contactQueryFilterFactory(QUERY)
const idList = PAYLOAD_LIST.filter(func).map(payload => payload.id)
Expand All @@ -92,7 +92,7 @@ test('contactQueryFilterFunction()', async t => {

void t.test('filter name by text', async t => {
const QUERY = { name: TEXT_VALUE }
const ID_LIST = ['id2', 'id4']
const ID_LIST = [ 'id2', 'id4' ]

const func = puppet.contactQueryFilterFactory(QUERY)
const idList = PAYLOAD_LIST.filter(func).map(payload => payload.id)
Expand All @@ -101,7 +101,7 @@ test('contactQueryFilterFunction()', async t => {

void t.test('filter alias by regex', async t => {
const QUERY = { alias: REGEX_VALUE }
const ID_LIST = ['id2', 'id4']
const ID_LIST = [ 'id2', 'id4' ]

const func = puppet.contactQueryFilterFactory(QUERY)
const idList = PAYLOAD_LIST.filter(func).map(payload => payload.id)
Expand All @@ -110,7 +110,7 @@ test('contactQueryFilterFunction()', async t => {

void t.test('filter alias by text', async t => {
const QUERY = { alias: TEXT_VALUE }
const ID_LIST = ['id1', 'id3']
const ID_LIST = [ 'id1', 'id3' ]

const func = puppet.contactQueryFilterFactory(QUERY)
const idList = PAYLOAD_LIST.filter(func).map(payload => payload.id)
Expand All @@ -119,7 +119,7 @@ test('contactQueryFilterFunction()', async t => {

void t.test('filter contact existing id', async t => {
const QUERY = { id: 'id1' }
const ID_LIST = ['id1']
const ID_LIST = [ 'id1' ]

const func = puppet.contactQueryFilterFactory(QUERY)
const idList = PAYLOAD_LIST.filter(func).map(payload => payload.id)
Expand Down Expand Up @@ -186,7 +186,7 @@ test('roomQueryFilterFunction()', async t => {

void t.test('filter name by regex', async t => {
const QUERY = { topic: REGEX_VALUE }
const ID_LIST = ['id2', 'id4']
const ID_LIST = [ 'id2', 'id4' ]

const func = puppet.roomQueryFilterFactory(QUERY)
const idList = PAYLOAD_LIST.filter(func).map(payload => payload.id)
Expand All @@ -195,7 +195,7 @@ test('roomQueryFilterFunction()', async t => {

void t.test('filter name by text', async t => {
const QUERY = { topic: TEXT_VALUE }
const ID_LIST = ['id1', 'id3']
const ID_LIST = [ 'id1', 'id3' ]

const func = puppet.roomQueryFilterFactory(QUERY)
const idList = PAYLOAD_LIST.filter(func).map(payload => payload.id)
Expand All @@ -204,7 +204,7 @@ test('roomQueryFilterFunction()', async t => {

void t.test('filter name by existing id', async t => {
const QUERY = { id: 'id4' }
const ID_LIST = ['id4']
const ID_LIST = [ 'id4' ]

const func = puppet.roomQueryFilterFactory(QUERY)
const idList = PAYLOAD_LIST.filter(func).map(payload => payload.id)
Expand Down
2 changes: 1 addition & 1 deletion src/puppet/puppet-skeleton.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ test('emit(error, ...) with GError', async t => {
'',
'foo',
[],
[1],
[ 1 ],
{},
{ foo: 'bar' },
new Error(),
Expand Down

0 comments on commit 53f8fd4

Please sign in to comment.