Skip to content

Commit f546c48

Browse files
committed
Enforce strictPropertyInitialization
1 parent 1c90659 commit f546c48

41 files changed

Lines changed: 78 additions & 78 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/algorithm/search.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,9 @@ class NgramIndex<T extends IndexEntry> extends BaseIndex<T> {
456456

457457
class IDFNgramIndex<T extends IndexEntry> extends NgramIndex<T> {
458458
ngram_idf: Record<string, number> = {};
459-
default_idf: number; // idf for something we haven't seen, important for weighting the cosine
460-
keyword_count: number;
461-
posix_count: number;
459+
default_idf!: number; // idf for something we haven't seen, important for weighting the cosine
460+
keyword_count!: number;
461+
posix_count!: number;
462462
constructor(entries: T[], normalizer = normalize_and_split_cppref_title) {
463463
super(entries, normalizer);
464464
// artificially lower the count of "keyword" so this only turns up keyword results when that's really the best

src/command-abstractions/interaction-base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const ApplicationCommandTypeUser = 2;
77
export const ApplicationCommandTypeMessage = 3;
88

99
export abstract class BaseBuilder<HasHandler extends boolean = false, HandlerArgs extends unknown[] = []> {
10-
handler: ConditionalOptional<HasHandler, (...args: HandlerArgs) => Promise<void>>;
10+
handler!: ConditionalOptional<HasHandler, (...args: HandlerArgs) => Promise<void>>;
1111
}
1212

1313
export abstract class BaseInteractionBuilder<

src/command-abstractions/text-based-command-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class TextBasedCommandBuilder<
3535
> extends BaseBuilder<HasHandler, [TextBasedCommand, ...Args]> {
3636
readonly names: string[];
3737
early_reply_mode: EarlyReplyMode;
38-
descriptions: ConditionalOptional<HasDescriptions, string[]>;
38+
descriptions!: ConditionalOptional<HasDescriptions, string[]>;
3939
options = new Discord.Collection<string, TextBasedCommandParameterOptions & { type: TextBasedCommandOptionType }>();
4040
slash_config: boolean[];
4141
permissions: undefined | bigint = undefined;

src/components/anti-executable.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import { CommandSetBuilder } from "../command-abstractions/command-set-builder.j
1515
const ACTION_THRESHOLD = 5;
1616

1717
export default class AntiExecutable extends BotComponent {
18-
private staff_flag_log: Discord.TextChannel;
19-
private staff_action_log: Discord.TextChannel;
20-
virustotal: Virustotal | null;
18+
private staff_flag_log!: Discord.TextChannel;
19+
private staff_action_log!: Discord.TextChannel;
20+
virustotal!: Virustotal | null;
2121

2222
static override get is_freestanding() {
2323
return true;

src/components/anti-invite-links.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default class AntiInviteLinks extends BotComponent {
2727
return true;
2828
}
2929

30-
private staff_flag_log: Discord.TextChannel;
30+
private staff_flag_log!: Discord.TextChannel;
3131

3232
override async setup(commands: CommandSetBuilder) {
3333
this.staff_flag_log = await this.utilities.get_channel(this.wheatley.channels.staff_flag_log);

src/components/emoji-log.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { BotComponent } from "../bot-component.js";
88
import { CommandSetBuilder } from "../command-abstractions/command-set-builder.js";
99

1010
export default class EmojiLog extends BotComponent {
11-
private staff_action_log: Discord.TextChannel;
11+
private staff_action_log!: Discord.TextChannel;
1212

1313
override async setup(commands: CommandSetBuilder) {
1414
this.staff_action_log = await this.utilities.get_channel(this.wheatley.channels.staff_action_log);

src/components/join-leave-log.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { equal } from "../utils/arrays.js";
1010
import { CommandSetBuilder } from "../command-abstractions/command-set-builder.js";
1111

1212
export default class JoinLeaveLog extends BotComponent {
13-
private staff_member_log: Discord.TextChannel;
13+
private staff_member_log!: Discord.TextChannel;
1414

1515
override async setup(commands: CommandSetBuilder) {
1616
this.staff_member_log = await this.utilities.get_channel(this.wheatley.channels.staff_member_log);

src/components/moderation/massban.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { CommandSetBuilder } from "../../command-abstractions/command-set-builde
99
const snowflake_re = /\b\d{10,}\b/g;
1010

1111
export default class Massban extends BotComponent {
12-
private staff_action_log: Discord.TextChannel;
12+
private staff_action_log!: Discord.TextChannel;
1313

1414
override async setup(commands: CommandSetBuilder) {
1515
this.staff_action_log = await this.utilities.get_channel(this.wheatley.channels.staff_action_log);

src/components/moderation/moderation-common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ export abstract class ModerationComponent extends BotComponent {
167167
component_state: moderation_state;
168168
moderations: moderation_entry;
169169
}>();
170-
protected staff_action_log: Discord.TextChannel;
171-
protected public_action_log: Discord.TextChannel;
170+
protected staff_action_log!: Discord.TextChannel;
171+
protected public_action_log!: Discord.TextChannel;
172172

173173
// Sorted by moderation end time
174174
sleep_list: SleepList<mongo.WithId<moderation_entry>, mongo.BSON.ObjectId>;

src/components/moderation/moderation-control.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export default class ModerationControl extends BotComponent {
1919
private database = this.wheatley.database.create_proxy<{
2020
moderations: moderation_entry;
2121
}>();
22-
private staff_action_log: Discord.TextChannel;
23-
private public_action_log: Discord.TextChannel;
22+
private staff_action_log!: Discord.TextChannel;
23+
private public_action_log!: Discord.TextChannel;
2424

2525
override async setup(commands: CommandSetBuilder) {
2626
this.staff_action_log = await this.utilities.get_channel(this.wheatley.channels.staff_action_log);

0 commit comments

Comments
 (0)