Crux
API Reference@crux/coreIndex Lints

routing.missing_stable_id

What it checks

Crux emits this finding when a router(), cascade(), or fallback() definition is authored without a stable id.

Why it matters

Stable routing ids let the Project Index, runtime spans, quality history, and architecture graph keep referring to the same routing primitive across file moves and variable renames.

How to fix

Add an id to the routing primitive options.

export const modelRouter = router({
  id: 'model-router',
  classify,
  routes: {
    cheap,
    default: strong,
  },
})

When to suppress

Suppress only for short-lived experiments or inline routing choices where you do not need durable runtime joins or historical comparisons.

// crux-lint-disable-next-line routing.missing_stable_id -- temporary local experiment
const model = router({ classify, routes })

Rule metadata

  • Rule id: routing.missing_stable_id
  • Category: composition
  • Maturity: preview
  • Default profiles: recommended, strict
  • Default severity: info

On this page