chore(misskey-js): Unchanged files with check annotationsで紛らわしい部分の警告を抑制

ロジック面は後で直す
This commit is contained in:
Kisaragi Marine 2024-07-18 20:46:55 +09:00
parent 10ce7bf3c4
commit fad2ec5641
No known key found for this signature in database
GPG Key ID: C6631564CD2110E4
5 changed files with 10 additions and 0 deletions

View File

@ -1,6 +1,7 @@
import tsParser from '@typescript-eslint/parser';
import sharedConfig from '../shared/eslint.config.js';
// eslint-disable-next-line import/no-default-export
export default [
...sharedConfig,
{

View File

@ -4,6 +4,7 @@ export type Acct = {
};
export function parse(acct: string): Acct {
// eslint-disable-next-line no-param-reassign
if (acct.startsWith('@')) acct = acct.substring(1);
const split = acct.split('@', 2);
return { username: split[0], host: split[1] || null };

View File

@ -14,6 +14,7 @@ export type APIError = {
code: string;
message: string;
kind: 'client' | 'server';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
info: Record<string, any>;
};
@ -29,6 +30,7 @@ export type FetchLike = (input: string, init?: {
headers: { [key in string]: string }
}) => Promise<{
status: number;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
json(): Promise<any>;
}>;
@ -49,6 +51,7 @@ export class APIClient {
this.fetch = opts.fetch ?? ((...args) => fetch(...args));
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private assertIsRecord<T>(obj: T): obj is T & Record<string, any> {
return obj !== null && typeof obj === 'object' && !Array.isArray(obj);
}

View File

@ -28,11 +28,13 @@ type StrictExtract<Union, Cond> = Cond extends Union ? Union : never;
type IsCaseMatched<E extends keyof Endpoints, P extends Endpoints[E]['req'], C extends number> =
Endpoints[E]['res'] extends SwitchCase
// eslint-disable-next-line @typescript-eslint/no-explicit-any
? IsNeverType<StrictExtract<Endpoints[E]['res']['$switch']['$cases'][C], [P, any]>> extends false ? true : false
: false
type GetCaseResult<E extends keyof Endpoints, P extends Endpoints[E]['req'], C extends number> =
Endpoints[E]['res'] extends SwitchCase
// eslint-disable-next-line @typescript-eslint/no-explicit-any
? StrictExtract<Endpoints[E]['res']['$switch']['$cases'][C], [P, any]>[1]
: never

View File

@ -137,7 +137,9 @@ export const moderationLogTypes = [
export type ModerationLogPayloads = {
updateServerSettings: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
before: any | null;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
after: any | null;
};
suspend: {
@ -159,6 +161,7 @@ export type ModerationLogPayloads = {
};
addCustomEmoji: {
emojiId: string;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
emoji: any;
};
updateCustomEmoji: {