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 [];
|
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
|
// Migrate old-format entries
|
||||||
const migrated = parsed.map((entry) => {
|
const migrated = parsed.map((entry) => {
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ if (activeTab && tabs.some((t) => t.id === activeTab)) {
|
|||||||
if (!focused || !focused.hasAttribute("data-tab")) return;
|
if (!focused || !focused.hasAttribute("data-tab")) return;
|
||||||
|
|
||||||
const currentIndex = tabEls.indexOf(focused);
|
const currentIndex = tabEls.indexOf(focused);
|
||||||
let nextIndex = currentIndex;
|
let nextIndex: number;
|
||||||
|
|
||||||
switch (e.key) {
|
switch (e.key) {
|
||||||
case "ArrowRight":
|
case "ArrowRight":
|
||||||
|
|||||||
@@ -139,8 +139,16 @@ import { dmTranslations as T } from "@/i18n/dm-translations";
|
|||||||
const oldRaw = sessionStorage.getItem("it-combatants");
|
const oldRaw = sessionStorage.getItem("it-combatants");
|
||||||
if (oldRaw) {
|
if (oldRaw) {
|
||||||
try {
|
try {
|
||||||
const oldData = JSON.parse(oldRaw) as any[];
|
const oldData = JSON.parse(oldRaw) as Array<{
|
||||||
const migrated = oldData.map((c: any, index: number) => ({
|
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()}`,
|
id: c.id || `legacy-${index}-${Date.now()}`,
|
||||||
name: c.name || 'Unknown',
|
name: c.name || 'Unknown',
|
||||||
modifier: typeof c.modifier === 'number' ? c.modifier : 0,
|
modifier: typeof c.modifier === 'number' ? c.modifier : 0,
|
||||||
@@ -156,7 +164,7 @@ import { dmTranslations as T } from "@/i18n/dm-translations";
|
|||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
const parsed = JSON.parse(raw) as any[];
|
const parsed = JSON.parse(raw) as Array<{ id?: string }>;
|
||||||
|
|
||||||
let migrated = false;
|
let migrated = false;
|
||||||
const combatants = parsed.map((c) => {
|
const combatants = parsed.map((c) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user