Skip to content

Commit fe2dd0e

Browse files
committed
refactor(web): hoist Intl.Collator out of sort comparator
Construct the collator once at module scope and reuse it, satisfying the e18e/prefer-static-collator rule introduced by the dependency bump.
1 parent d36300c commit fe2dd0e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

web/src/features/mentors/selectors.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import {
99
normalizeSearchText,
1010
} from './utils';
1111

12+
const collator = new Intl.Collator();
13+
1214
type FilterOptions = {
1315
query: string;
1416
selectedStatus: string;
@@ -113,7 +115,7 @@ export const buildStatusOptions = (diplomaData: Diploma[] | undefined) =>
113115
return stageA - stageB;
114116
}
115117

116-
return a.localeCompare(b);
118+
return collator.compare(a, b);
117119
},
118120
);
119121

0 commit comments

Comments
 (0)