CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-nuqs

Type-safe search params state manager for Next.js - Like React.useState, but stored in the URL query string

Overall
score

96%

Overview
Eval results
Files

rubric.jsonevals/scenario-8/

{
  "context": "This evaluation assesses the engineer's ability to use nuqs parser builder methods (withDefault and withOptions) to configure query parameter parsing with default values, history modes, and other behaviors. The focus is on proper usage of these builder pattern methods to achieve the specified URL behavior.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "withDefault usage",
      "description": "Uses .withDefault() method on parsers to provide default values for all four query parameters (search query defaults to empty string, category to 'all', min price to 0, and page to 1)",
      "max_score": 30
    },
    {
      "name": "String parser with default",
      "description": "Correctly uses parseAsString with .withDefault('') or parseAsString.withDefault('all') for the search query and category parameters respectively",
      "max_score": 15
    },
    {
      "name": "Integer parser with default",
      "description": "Correctly uses parseAsInteger with .withDefault(0) for min price and .withDefault(1) for page number parameters",
      "max_score": 15
    },
    {
      "name": "String literal type",
      "description": "Uses parseAsStringLiteral or parseAsStringEnum for the category parameter to enforce type safety for the allowed values ('electronics', 'clothing', 'books', 'all')",
      "max_score": 15
    },
    {
      "name": "History mode configuration",
      "description": "Uses .withOptions({ history: 'push' }) on the page parameter parser to create new history entries, while using default 'replace' mode (or explicit withOptions({ history: 'replace' })) for other parameters",
      "max_score": 20
    },
    {
      "name": "Parser method chaining",
      "description": "Demonstrates proper method chaining by combining .withDefault() and .withOptions() methods on the same parser (e.g., parseAsInteger.withDefault(1).withOptions({ history: 'push' }))",
      "max_score": 5
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-nuqs

tile.json