Use String.raw and RegExp.exec, add prefer-regexp-exec oxlint rule

Replace escaped backslash in template literal with String.raw in
auto-number.ts. Use RegExp#exec() instead of String#match() in
bestiary-adapter.ts. Enable typescript/prefer-regexp-exec in oxlint
for automated enforcement.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lukas
2026-03-14 14:55:54 +01:00
parent c94c30e459
commit 8efba288f7
3 changed files with 5 additions and 2 deletions

View File

@@ -170,7 +170,7 @@ function extractAc(ac: RawMonster["ac"]): {
}
if ("special" in first) {
// Variable AC (e.g. spell summons) — parse leading number if possible
const match = first.special.match(LEADING_DIGITS_REGEX);
const match = LEADING_DIGITS_REGEX.exec(first.special);
return {
value: match ? Number(match[1]) : 0,
source: first.special,