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[];
|
legendaryHeader?: string[];
|
||||||
spellcasting?: RawSpellcasting[];
|
spellcasting?: RawSpellcasting[];
|
||||||
initiative?: { proficiency?: number };
|
initiative?: { proficiency?: number };
|
||||||
|
_copy?: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface RawEntry {
|
interface RawEntry {
|
||||||
@@ -385,8 +386,7 @@ export function normalizeBestiary(raw: { monster: RawMonster[] }): Creature[] {
|
|||||||
// Filter out _copy entries (reference another source's monster) and
|
// Filter out _copy entries (reference another source's monster) and
|
||||||
// monsters missing required fields (ac, hp, size, type)
|
// monsters missing required fields (ac, hp, size, type)
|
||||||
const monsters = raw.monster.filter((m) => {
|
const monsters = raw.monster.filter((m) => {
|
||||||
// biome-ignore lint/suspicious/noExplicitAny: raw JSON may have _copy field
|
if (m._copy) return false;
|
||||||
if ((m as any)._copy) return false;
|
|
||||||
return (
|
return (
|
||||||
Array.isArray(m.ac) &&
|
Array.isArray(m.ac) &&
|
||||||
m.ac.length > 0 &&
|
m.ac.length > 0 &&
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { execSync } from "node:child_process";
|
|||||||
import { readFileSync } from "node:fs";
|
import { readFileSync } from "node:fs";
|
||||||
|
|
||||||
// ── Configuration ──────────────────────────────────────────────────────
|
// ── Configuration ──────────────────────────────────────────────────────
|
||||||
const MAX_SOURCE_IGNORES = 3;
|
const MAX_SOURCE_IGNORES = 2;
|
||||||
const MAX_TEST_IGNORES = 3;
|
const MAX_TEST_IGNORES = 3;
|
||||||
|
|
||||||
/** Rule prefixes that must never be suppressed. */
|
/** Rule prefixes that must never be suppressed. */
|
||||||
|
|||||||
Reference in New Issue
Block a user