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 @formatjs/intl-localematcher to implement a locale fallback resolver with progressive subtag removal. The focus is on proper use of the package's BestAvailableLocale algorithm and related locale matching capabilities.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Package Import",
"description": "Correctly imports necessary functions or classes from @formatjs/intl-localematcher package (e.g., match, LookupMatcher, or internal utilities)",
"max_score": 15
},
{
"name": "Locale Matching Usage",
"description": "Uses the package's locale matching functionality (such as match() with 'lookup' algorithm or LookupSupportedLocales()) rather than implementing matching logic from scratch",
"max_score": 30
},
{
"name": "Progressive Fallback",
"description": "Implements or leverages the progressive subtag removal algorithm correctly (right-to-left removal: en-Latn-US → en-Latn → en)",
"max_score": 25
},
{
"name": "Efficient Lookups",
"description": "Uses Set-based or efficient data structures for available locales checking, consistent with package's O(1) lookup approach",
"max_score": 15
},
{
"name": "Test Compliance",
"description": "Implementation passes all 5 test cases specified in the problem (exact match, progressive fallback, no match scenario)",
"max_score": 15
}
]
}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