chore: update lint rules

This commit is contained in:
2026-09-25 15:52:30 +05:00
parent ebb2176a2c
commit c1d2957ba5
13 changed files with 268 additions and 116 deletions
+32
View File
@@ -15,6 +15,22 @@ function toolKeys(tool: ToolEntry): { fields: string[]; groups: string[] } {
return { fields, groups };
}
type SelectOption = { value: string; label: string };
function selectOptions(
tool: ToolEntry,
): { fieldId: string; option: SelectOption }[] {
const result: { fieldId: string; option: SelectOption }[] = [];
for (const [fieldId, field] of Object.entries(tool.schema?.fields ?? {})) {
const spec = (
field as { spec?: { kind?: string; options?: SelectOption[] } }
).spec;
if (spec?.kind !== "select") continue;
for (const option of spec.options ?? []) result.push({ fieldId, option });
}
return result;
}
describe("полнота словарей для нового registry", () => {
it("у каждого инструмента есть перевод ru с непустыми title/description", () => {
for (const tool of TOOLS) {
@@ -43,6 +59,22 @@ describe("полнота словарей для нового registry", () => {
}
});
it("все active select options переведены в en и ru", () => {
for (const tool of TOOLS) {
for (const { fieldId, option } of selectOptions(tool)) {
if (fieldId === "component") continue;
const key = `${tool.id}: ${fieldId}.${option.value}`;
expect(en.tools[tool.id]?.options?.[fieldId]?.[option.value], key).toBe(
option.label,
);
expect(
ru.tools[tool.id]?.options?.[fieldId]?.[option.value],
key,
).toBeTruthy();
}
}
});
it("в словарях нет лишних инструментов", () => {
const ids = new Set(TOOLS.map((tool) => tool.id));
for (const dict of [ru.tools, en.tools]) {