From 912c19222eb99c3a7fe18f810b64cb85abfec7e9 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Fri, 24 Jun 2022 12:44:22 +0200 Subject: [PATCH] fix lints --- packages/backend/src/misc/check-word-mute.ts | 2 +- packages/backend/src/remote/activitypub/type.ts | 2 +- packages/backend/src/server/api/define.ts | 1 - packages/backend/src/services/note/polls/update.ts | 1 - packages/client/src/scripts/check-word-mute.ts | 2 +- 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/misc/check-word-mute.ts b/packages/backend/src/misc/check-word-mute.ts index 015a368df..d7662820a 100644 --- a/packages/backend/src/misc/check-word-mute.ts +++ b/packages/backend/src/misc/check-word-mute.ts @@ -18,7 +18,7 @@ export async function checkWordMute(note: NoteLike, me: UserLike | null | undefi if (mutedWords.length > 0) { const text = ((note.cw ?? '') + '\n' + (note.text ?? '')).trim(); - if (text == '') return false; + if (text === '') return false; const matched = mutedWords.some(filter => { if (Array.isArray(filter)) { diff --git a/packages/backend/src/remote/activitypub/type.ts b/packages/backend/src/remote/activitypub/type.ts index 5d00481b7..de7eb0ed8 100644 --- a/packages/backend/src/remote/activitypub/type.ts +++ b/packages/backend/src/remote/activitypub/type.ts @@ -201,7 +201,7 @@ export interface IApMention extends IObject { href: string; } -export const isMention = (object: IObject): object is IApMention=> +export const isMention = (object: IObject): object is IApMention => getApType(object) === 'Mention' && typeof object.href === 'string'; diff --git a/packages/backend/src/server/api/define.ts b/packages/backend/src/server/api/define.ts index 152989434..47dcb44ea 100644 --- a/packages/backend/src/server/api/define.ts +++ b/packages/backend/src/server/api/define.ts @@ -21,7 +21,6 @@ ajv.addFormat('misskey:id', /^[a-zA-Z0-9]+$/); export default function (meta: T, paramDef: Ps, cb: executor) : (params: any, user: T['requireCredential'] extends true ? CacheableLocalUser : CacheableLocalUser | null, token: AccessToken | null, file?: any) => Promise { - const validate = ajv.compile(paramDef); return (params: any, user: T['requireCredential'] extends true ? CacheableLocalUser : CacheableLocalUser | null, token: AccessToken | null, file?: any) => { diff --git a/packages/backend/src/services/note/polls/update.ts b/packages/backend/src/services/note/polls/update.ts index 43ca3eff4..68cbb9835 100644 --- a/packages/backend/src/services/note/polls/update.ts +++ b/packages/backend/src/services/note/polls/update.ts @@ -14,7 +14,6 @@ export async function deliverQuestionUpdate(noteId: Note['id']) { if (user == null) throw new Error('note not found'); if (Users.isLocalUser(user)) { - const content = renderActivity(renderUpdate(await renderNote(note, false), user)); deliverToFollowers(user, content); deliverToRelays(user, content); diff --git a/packages/client/src/scripts/check-word-mute.ts b/packages/client/src/scripts/check-word-mute.ts index aafdd8920..35d40a6e0 100644 --- a/packages/client/src/scripts/check-word-mute.ts +++ b/packages/client/src/scripts/check-word-mute.ts @@ -5,7 +5,7 @@ export function checkWordMute(note: Record, me: Record if (mutedWords.length > 0) { const text = ((note.cw ?? '') + '\n' + (note.text ?? '')).trim(); - if (text == '') return false; + if (text === '') return false; const matched = mutedWords.some(filter => { if (Array.isArray(filter)) {