Tests: fix test-project typecheck (casts, Rule arity) and base-to-string lint warnings

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-27 16:17:40 +01:00
co-authored by Claude Opus 5.5
parent a92bc51814
commit 2dafcd0852
3 changed files with 11 additions and 11 deletions
+3 -3
View File
@@ -92,12 +92,12 @@ function checkText(where: string, kind: 'description' | 'label' | 'option', valu
function walk(fields: Field[], path: string, problems: Problem[]) {
for (const field of fields) {
const f = field as { admin?: Record<string, unknown> } & Field & Record<string, unknown>
const where = `${path}.${'name' in f && f.name ? String(f.name) : f.type}`
const where = `${path}.${'name' in f && typeof f.name === 'string' && f.name ? f.name : f.type}`
if (f.hidden || f.admin?.hidden || f.admin?.disabled) {continue}
if (f.type === 'tabs') {
for (const tab of (f as unknown as { tabs: ({ fields: Field[] } & Record<string, unknown>)[] }).tabs) {
const tabWhere = `${path}.tab(${String(tab.name ?? JSON.stringify(tab.label))})`
const tabWhere = `${path}.tab(${typeof tab.name === 'string' ? tab.name : JSON.stringify(tab.label)})`
checkText(tabWhere, 'label', tab.label, problems)
if (tab.description) {checkText(tabWhere, 'description', tab.description, problems)}
walk(tab.fields, tabWhere, problems)
@@ -226,7 +226,7 @@ describe('admin languages', () => {
const key = Object.keys(adminTexts.en)[0]
const config = applyAdminI18n({
i18n: { supportedLanguages: { de } as never, translations: { de: { ipal: { [key]: 'Eigener Text' } } } as never },
} as Config)
} as unknown as Config)
expect(Object.keys(config.i18n!.supportedLanguages!)).toEqual(['de'])
const translations = config.i18n!.translations as Record<string, { ipal: Record<string, string> }>
expect(translations.de.ipal[key]).toBe('Eigener Text')