Add _copy field to RawMonster, remove noExplicitAny biome-ignore
The _copy field is a real property in the raw bestiary JSON — adding it to the interface is more accurate than casting through any. Ratchet source ignore threshold from 3 to 2. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -51,6 +51,7 @@ interface RawMonster {
|
||||
legendaryHeader?: string[];
|
||||
spellcasting?: RawSpellcasting[];
|
||||
initiative?: { proficiency?: number };
|
||||
_copy?: unknown;
|
||||
}
|
||||
|
||||
interface RawEntry {
|
||||
@@ -385,8 +386,7 @@ export function normalizeBestiary(raw: { monster: RawMonster[] }): Creature[] {
|
||||
// Filter out _copy entries (reference another source's monster) and
|
||||
// monsters missing required fields (ac, hp, size, type)
|
||||
const monsters = raw.monster.filter((m) => {
|
||||
// biome-ignore lint/suspicious/noExplicitAny: raw JSON may have _copy field
|
||||
if ((m as any)._copy) return false;
|
||||
if (m._copy) return false;
|
||||
return (
|
||||
Array.isArray(m.ac) &&
|
||||
m.ac.length > 0 &&
|
||||
|
||||
Reference in New Issue
Block a user