Skip to content

Commit 5c3a09b

Browse files
committed
test(lint): type the retired-key finding filter
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D6F9axfoPzR7t8G1J7Ytzz
1 parent ea63001 commit 5c3a09b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎packages/lint/src/list-view-filterable-fields-retired.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const stackWithList = (list: AnyRec, objects: unknown[] = [task, person]): AnyRe
5454
views: [{ name: 'task', objectName: 'duly_task', list }],
5555
});
5656

57-
const retiredOf = (findings: Array<{ rule: string }>) => findings.filter((f) => f.rule === LIST_VIEW_KEY_RETIRED);
57+
const retiredOf = <F extends { rule: string }>(findings: F[]): F[] => findings.filter((f) => f.rule === LIST_VIEW_KEY_RETIRED);
5858

5959
describe('the list view\'s retired `filterableFields` is reported by name, never as a field position', () => {
6060
const prescription = listViewRetiredKeyPrescription('filterableFields');
@@ -98,7 +98,7 @@ describe('the list view\'s retired `filterableFields` is reported by name, never
9898
{ name: 'duly_task.item', object: 'duly_task', viewKind: 'list', config: lv },
9999
],
100100
};
101-
expect(retiredOf(validateListViewFieldRefs(stack)).map((f) => (f as { path: string }).path).sort()).toEqual([
101+
expect(retiredOf(validateListViewFieldRefs(stack)).map((f) => f.path).sort()).toEqual([
102102
'objects[0].listViews.mine.filterableFields',
103103
'views[0].list.filterableFields',
104104
'views[0].listViews.open.filterableFields',

0 commit comments

Comments
 (0)