Reduce lint errors

This commit is contained in:
Zef Hemel
2022-10-15 19:02:56 +02:00
parent 68809ff958
commit 574014a8be
27 changed files with 199 additions and 194 deletions
+6 -6
View File
@@ -31,7 +31,7 @@ export class SlashCommandHook implements Hook<SlashCommandHookT> {
buildAllCommands(system: System<SlashCommandHookT>) {
this.slashCommands.clear();
for (let plug of system.loadedPlugs.values()) {
for (const plug of system.loadedPlugs.values()) {
for (
const [name, functionDef] of Object.entries(
plug.manifest!.functions,
@@ -55,19 +55,19 @@ export class SlashCommandHook implements Hook<SlashCommandHookT> {
public slashCommandCompleter(
ctx: CompletionContext,
): CompletionResult | null {
let prefix = ctx.matchBefore(slashCommandRegexp);
const prefix = ctx.matchBefore(slashCommandRegexp);
if (!prefix) {
return null;
}
const prefixText = prefix.text;
let options: Completion[] = [];
const options: Completion[] = [];
// No slash commands in comment blocks (queries and such)
let currentNode = syntaxTree(ctx.state).resolveInner(ctx.pos);
const currentNode = syntaxTree(ctx.state).resolveInner(ctx.pos);
if (currentNode.type.name === "CommentBlock") {
return null;
}
for (let [name, def] of this.slashCommands.entries()) {
for (const def of this.slashCommands.values()) {
options.push({
label: def.slashCommand.name,
detail: def.slashCommand.description,
@@ -105,7 +105,7 @@ export class SlashCommandHook implements Hook<SlashCommandHookT> {
}
validateManifest(manifest: Manifest<SlashCommandHookT>): string[] {
let errors = [];
const errors = [];
for (const [name, functionDef] of Object.entries(manifest.functions)) {
if (!functionDef.slashCommand) {
continue;