fix(lint): resolve explicit any and useless assignment in DM components
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -166,7 +166,17 @@ const quickDice = [
|
||||
}
|
||||
|
||||
if (!raw) return [];
|
||||
const parsed = JSON.parse(raw) as any[];
|
||||
const parsed = JSON.parse(raw) as Array<{
|
||||
result?: number;
|
||||
total?: number;
|
||||
rolls?: unknown[];
|
||||
formula?: string;
|
||||
notation?: string;
|
||||
modifier?: number;
|
||||
status?: "crit" | "fail" | "normal";
|
||||
isCrit?: boolean;
|
||||
isFail?: boolean;
|
||||
}>;
|
||||
|
||||
// Migrate old-format entries
|
||||
const migrated = parsed.map((entry) => {
|
||||
|
||||
@@ -172,7 +172,7 @@ if (activeTab && tabs.some((t) => t.id === activeTab)) {
|
||||
if (!focused || !focused.hasAttribute("data-tab")) return;
|
||||
|
||||
const currentIndex = tabEls.indexOf(focused);
|
||||
let nextIndex = currentIndex;
|
||||
let nextIndex: number;
|
||||
|
||||
switch (e.key) {
|
||||
case "ArrowRight":
|
||||
|
||||
@@ -139,8 +139,16 @@ import { dmTranslations as T } from "@/i18n/dm-translations";
|
||||
const oldRaw = sessionStorage.getItem("it-combatants");
|
||||
if (oldRaw) {
|
||||
try {
|
||||
const oldData = JSON.parse(oldRaw) as any[];
|
||||
const migrated = oldData.map((c: any, index: number) => ({
|
||||
const oldData = JSON.parse(oldRaw) as Array<{
|
||||
id?: string;
|
||||
name?: string;
|
||||
modifier?: number;
|
||||
initiative?: number;
|
||||
hp?: number;
|
||||
maxHp?: number;
|
||||
active?: boolean;
|
||||
}>;
|
||||
const migrated = oldData.map((c, index) => ({
|
||||
id: c.id || `legacy-${index}-${Date.now()}`,
|
||||
name: c.name || 'Unknown',
|
||||
modifier: typeof c.modifier === 'number' ? c.modifier : 0,
|
||||
@@ -156,7 +164,7 @@ import { dmTranslations as T } from "@/i18n/dm-translations";
|
||||
}
|
||||
return [];
|
||||
}
|
||||
const parsed = JSON.parse(raw) as any[];
|
||||
const parsed = JSON.parse(raw) as Array<{ id?: string }>;
|
||||
|
||||
let migrated = false;
|
||||
const combatants = parsed.map((c) => {
|
||||
|
||||
Reference in New Issue
Block a user