CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-formatjs--intl-localematcher

Intl.LocaleMatcher ponyfill providing comprehensive locale matching algorithms with support for 'lookup' and 'best fit' strategies

94

1.09x
Overview
Eval results
Files

rubric.jsonevals/scenario-4/

{
  "context": "This criteria evaluates the engineer's understanding and correct usage of @formatjs/intl-localematcher's two distinct locale matching algorithms: 'lookup' (strict hierarchical) and 'best fit' (linguistically-aware). The focus is on whether they correctly select and configure the appropriate algorithm based on the matching requirements.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Import match function",
      "description": "Correctly imports the `match` function from '@formatjs/intl-localematcher' package",
      "max_score": 10
    },
    {
      "name": "Lookup algorithm usage",
      "description": "Uses `match()` function with `algorithm: 'lookup'` option parameter to implement strict hierarchical matching that does not match across locale variants",
      "max_score": 25
    },
    {
      "name": "Best fit algorithm usage",
      "description": "Uses `match()` function with `algorithm: 'best fit'` option parameter (or omits algorithm option to use default) to implement flexible linguistically-aware matching that can match across related locale variants",
      "max_score": 25
    },
    {
      "name": "Algorithm selection logic",
      "description": "Correctly selects between 'lookup' and 'best fit' algorithms based on the `requireExactFallback` parameter: 'lookup' when true (strict), 'best fit' when false (flexible)",
      "max_score": 20
    },
    {
      "name": "Function signature correctness",
      "description": "Passes correct arguments to `match()` in proper order: requestedLocales array, availableLocales array, defaultLocale string, and options object with algorithm property",
      "max_score": 15
    },
    {
      "name": "Return value handling",
      "description": "Returns the string result from `match()` function directly as the resolved locale",
      "max_score": 5
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-formatjs--intl-localematcher

tile.json