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 tsParser from '@typescript-eslint/parser';
import sharedConfig from '../shared/eslint.config.js'; import sharedConfig from '../shared/eslint.config.js';
// eslint-disable-next-line import/no-default-export
export default [ export default [
...sharedConfig, ...sharedConfig,
{ {

View File

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

View File

@ -14,6 +14,7 @@ export type APIError = {
code: string; code: string;
message: string; message: string;
kind: 'client' | 'server'; kind: 'client' | 'server';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
info: Record<string, any>; info: Record<string, any>;
}; };
@ -29,6 +30,7 @@ export type FetchLike = (input: string, init?: {
headers: { [key in string]: string } headers: { [key in string]: string }
}) => Promise<{ }) => Promise<{
status: number; status: number;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
json(): Promise<any>; json(): Promise<any>;
}>; }>;
@ -49,6 +51,7 @@ export class APIClient {
this.fetch = opts.fetch ?? ((...args) => fetch(...args)); 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> { private assertIsRecord<T>(obj: T): obj is T & Record<string, any> {
return obj !== null && typeof obj === 'object' && !Array.isArray(obj); 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> = type IsCaseMatched<E extends keyof Endpoints, P extends Endpoints[E]['req'], C extends number> =
Endpoints[E]['res'] extends SwitchCase 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 ? IsNeverType<StrictExtract<Endpoints[E]['res']['$switch']['$cases'][C], [P, any]>> extends false ? true : false
: false : false
type GetCaseResult<E extends keyof Endpoints, P extends Endpoints[E]['req'], C extends number> = type GetCaseResult<E extends keyof Endpoints, P extends Endpoints[E]['req'], C extends number> =
Endpoints[E]['res'] extends SwitchCase Endpoints[E]['res'] extends SwitchCase
// eslint-disable-next-line @typescript-eslint/no-explicit-any
? StrictExtract<Endpoints[E]['res']['$switch']['$cases'][C], [P, any]>[1] ? StrictExtract<Endpoints[E]['res']['$switch']['$cases'][C], [P, any]>[1]
: never : never

View File

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