refactor: 🚨 Turn every linter rule on and fix issues (there were a LOT :3)

This commit is contained in:
Jesse Wierzbinski 2024-06-12 16:26:43 -10:00
parent 2e98859153
commit a1e02d0d78
No known key found for this signature in database
177 changed files with 1826 additions and 1248 deletions

View file

@ -25,9 +25,9 @@ export type Account = {
avatar_static: string;
header: string;
header_static: string;
emojis: Array<Emoji>;
emojis: Emoji[];
moved: Account | null;
fields: Array<Field>;
fields: Field[];
bot: boolean | null;
source?: Source;
role?: Role;

View file

@ -11,11 +11,11 @@ export type Announcement = {
published_at: string;
updated_at: string | null;
read: boolean | null;
mentions: Array<AnnouncementAccount>;
statuses: Array<AnnouncementStatus>;
tags: Array<StatusTag>;
emojis: Array<Emoji>;
reactions: Array<AnnouncementReaction>;
mentions: AnnouncementAccount[];
statuses: AnnouncementStatus[];
tags: StatusTag[];
emojis: Emoji[];
reactions: AnnouncementReaction[];
};
export type AnnouncementAccount = {

View file

@ -1,6 +1,6 @@
import type { Status } from "./status";
export type Context = {
ancestors: Array<Status>;
descendants: Array<Status>;
ancestors: Status[];
descendants: Status[];
};

View file

@ -3,7 +3,7 @@ import type { Status } from "./status";
export type Conversation = {
id: string;
accounts: Array<Account>;
accounts: Account[];
last_status: Status | null;
unread: boolean;
};

View file

@ -1,7 +1,7 @@
export type Filter = {
id: string;
phrase: string;
context: Array<FilterContext>;
context: FilterContext[];
expires_at: string | null;
irreversible: boolean;
whole_word: boolean;

View file

@ -20,6 +20,6 @@ export type FollowRequest = {
followers_count: number;
following_count: number;
statuses_count: number;
emojis: Array<Emoji>;
fields: Array<Field>;
emojis: Emoji[];
fields: Field[];
};

View file

@ -11,7 +11,7 @@ export type Instance = {
thumbnail: string | null;
urls: URLs | null;
stats: Stats;
languages: Array<string>;
languages: string[];
registrations: boolean;
approval_required: boolean;
invites_enabled?: boolean;
@ -29,7 +29,7 @@ export type Instance = {
};
};
contact_account?: Account;
rules?: Array<InstanceRule>;
rules?: InstanceRule[];
};
export type InstanceRule = {

View file

@ -4,7 +4,7 @@ export type Poll = {
expired: boolean;
multiple: boolean;
votes_count: number;
options: Array<PollOption>;
options: PollOption[];
voted: boolean;
};

View file

@ -6,6 +6,6 @@ export type Reaction = {
name: string;
url?: string;
static_url?: string;
accounts?: Array<Account>;
account_ids?: Array<string>;
accounts?: Account[];
account_ids?: string[];
};

View file

@ -4,8 +4,8 @@ export type Report = {
id: string;
action_taken: boolean;
action_taken_at: string | null;
status_ids: Array<string> | null;
rule_ids: Array<string> | null;
status_ids: string[] | null;
rule_ids: string[] | null;
// These parameters don't exist in Pleroma
category: Category | null;
comment: string | null;

View file

@ -3,7 +3,7 @@ import type { Status } from "./status";
import type { Tag } from "./tag";
export type Results = {
accounts: Array<Account>;
statuses: Array<Status>;
hashtags: Array<Tag>;
accounts: Account[];
statuses: Status[];
hashtags: Tag[];
};

View file

@ -5,5 +5,5 @@ export type ScheduledStatus = {
id: string;
scheduled_at: string;
params: StatusParams;
media_attachments: Array<Attachment> | null;
media_attachments: Attachment[] | null;
};

View file

@ -5,5 +5,5 @@ export type Source = {
sensitive: boolean | null;
language: string | null;
note: string;
fields: Array<Field>;
fields: Field[];
};

View file

@ -29,15 +29,15 @@ export type Status = {
sensitive: boolean;
spoiler_text: string;
visibility: StatusVisibility;
media_attachments: Array<Attachment>;
mentions: Array<Mention>;
tags: Array<StatusTag>;
media_attachments: Attachment[];
mentions: Mention[];
tags: StatusTag[];
card: Card | null;
poll: Poll | null;
application: Application | null;
language: string | null;
pinned: boolean | null;
emoji_reactions: Array<Reaction>;
emoji_reactions: Reaction[];
quote: boolean;
bookmarked: boolean;
};

View file

@ -3,7 +3,7 @@ import type { StatusVisibility } from "./status";
export type StatusParams = {
text: string;
in_reply_to_id: string | null;
media_ids: Array<string> | null;
media_ids: string[] | null;
sensitive: boolean | null;
spoiler_text: string | null;
visibility: StatusVisibility | null;

View file

@ -3,6 +3,6 @@ import type { History } from "./history";
export type Tag = {
name: string;
url: string;
history: Array<History>;
history: History[];
following?: boolean;
};