Intl.LocaleMatcher ponyfill providing comprehensive locale matching algorithms with support for 'lookup' and 'best fit' strategies
94
{
"context": "This criteria evaluates how well the engineer uses the @formatjs/intl-localematcher package to implement locale availability checking, specifically focusing on the correct usage of the LookupSupportedLocales function for filtering and matching user-preferred locales against application-supported locales.",
"type": "weighted_checklist",
"checklist": [
{
"name": "LookupSupportedLocales usage",
"description": "Uses the LookupSupportedLocales function from @formatjs/intl-localematcher to perform the locale filtering and matching logic",
"max_score": 40
},
{
"name": "Correct parameter order",
"description": "Passes the availableLocales (app locales) as the first parameter and requestedLocales (user locales) as the second parameter to LookupSupportedLocales",
"max_score": 20
},
{
"name": "Return value handling",
"description": "Returns the array result from LookupSupportedLocales directly without unnecessary transformation or processing",
"max_score": 15
},
{
"name": "Package import",
"description": "Correctly imports LookupSupportedLocales from @formatjs/intl-localematcher using require or import syntax",
"max_score": 15
},
{
"name": "Test coverage",
"description": "All four test cases pass correctly, demonstrating proper handling of exact matches, fallback matching, no matches, and multiple locale matching",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-formatjs--intl-localematcherdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10