Skip to content

Commit

Permalink
chore: Minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Alorel committed Jan 21, 2023
1 parent 6a989b5 commit 165e04a
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/lib/data/opts-list-item.mts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default abstract class OptsListItem {
/** Option values */
public opts!: Obj<any>; // Gets set in extending classes' constructors

public constructor({opts}: Init) {
protected constructor({opts}: Init) {
if (opts) {
this.opts = opts;
}
Expand Down
5 changes: 3 additions & 2 deletions src/lib/util/export-modal.mts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ export function showExportModal(title: string, contents: any): void {
html.textContent = JSON.stringify(contents);
html.readOnly = true;

Swal // eslint-disable-line @typescript-eslint/no-floating-promises
Swal
.fire({
confirmButtonText: 'OK',
html,
showCancelButton: false,
showConfirmButton: true,
title,
});
})
.catch(console.error);
}

/** @return Pasted JSON */
Expand Down
18 changes: 0 additions & 18 deletions src/lib/util/registry-utils/get-from-registry-or-log.mts

This file was deleted.

2 changes: 1 addition & 1 deletion src/option-types/media-item/media-edit-base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function RenderBtn<T extends MediaSelectable>({icon = true, value, onChange}: Bt

return (
<Btn kind={'primary'} size={'sm'} onClick={unselect}>
{icon && <img class={'ActionWorkflowsCore-font-sized mr-1'} src={value.media}/>}
{icon && <img class={'ActionWorkflowsCore-font-sized mr-1'} src={value.media} alt={'Icon'}/>}
<span>{value.name}</span>
</Btn>
);
Expand Down
5 changes: 3 additions & 2 deletions src/ui/pages/import-export-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,12 @@ function ExportAll(): VNode {
}

function alertDone() {
Swal // eslint-disable-line @typescript-eslint/no-floating-promises
Swal
.fire({
confirmButtonText: 'OK',
showCancelButton: false,
showConfirmButton: true,
text: 'Done!',
});
})
.catch(console.error);
}
2 changes: 1 addition & 1 deletion src/ui/pages/workflows-dashboard/render-node-media.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface RenderNodeMediaProps extends Pick<NodeDefinition, 'media'> {
export function RenderNodeMedia({label, media}: RenderNodeMediaProps): VNode {
return (
<Fragment>
<img class={'ActionWorkflowsCore-font-sized mr-1'} src={media}/>
<img class={'ActionWorkflowsCore-font-sized mr-1'} src={media} alt={'Icon'}/>
<span>{label}</span>
</Fragment>
);
Expand Down
2 changes: 2 additions & 0 deletions types/melvor/game/combat.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// noinspection JSUnusedGlobalSymbols

import {BaseSpell, NamespacedObject} from './core';
import {Skill} from './skilling';
import type {Character} from './toon';
Expand Down
2 changes: 2 additions & 0 deletions types/melvor/game/core.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// noinspection JSUnusedGlobalSymbols

import {ActivePrayer, CombatArea, CombatSpell, Dungeon, Pet, PetManager, SlayerArea, SpecialAttack} from 'melvor';
import type {Monster} from './combat';
import {Attack, AttackStyle} from './combat';
Expand Down
2 changes: 2 additions & 0 deletions types/melvor/game/item.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// noinspection JSUnusedGlobalSymbols

import type {PotionReuseTarget} from './misc';
import type {EquipSlotType} from './toon';

Expand Down
2 changes: 2 additions & 0 deletions types/melvor/game/misc.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// noinspection JSUnusedGlobalSymbols

import {CombatArea, Dungeon, Enemy, Monster} from 'melvor/game/combat';
import type {NamespaceRegistry} from './core';
import type {Item, PotionItem} from './item';
Expand Down
2 changes: 2 additions & 0 deletions types/melvor/game/skilling.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// noinspection JSUnusedGlobalSymbols

import type {BaseSpell, Game, NamespaceRegistry, RuneRequirement} from './core';
import type {Item} from './item';
import type {ItemCost, ShopPurchase} from './misc';
Expand Down
2 changes: 2 additions & 0 deletions types/melvor/game/toon.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// noinspection JSUnusedGlobalSymbols

import {AttackStyle, AttackTypeID, CombatSpell, FoodItem, NamespacedObject} from 'melvor';
import type {EquipmentItem, Item} from './item';

Expand Down
2 changes: 2 additions & 0 deletions types/melvor/mod.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// noinspection JSUnusedGlobalSymbols

import type {Class, InstanceOf} from 'mod-util/class';

export interface ModContext {
Expand Down
2 changes: 2 additions & 0 deletions types/melvor/ui.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// noinspection JSUnusedGlobalSymbols

export interface SidebarContext {
category(id: string, config?: CategoryConfig, builder?: (cat: Category) => void): Category;
}
Expand Down

0 comments on commit 165e04a

Please sign in to comment.