← 返回
未分类 中文

Remix V2 Routing Review

Reviews Remix v2 route files for naming convention violations, missing layouts, resource-route shape, and v1 holdovers. Use when reviewing files under app/ro...
审查 Remix v2路由文件,检查命名规范违规、缺失布局、资源路由结构及 v1 遗留项。适用于审查 app/ro... 下的文件。
anderskev anderskev 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 117
下载
💾 0
安装
1
版本
#latest

概述

Remix v2 Routing Code Review

Loaded by review-remix-v2 (umbrella) to flag routing anti-patterns in app/routes/ modules. See remix-v2-routing for canonical patterns.

Quick Reference

Issue TypeReference
-----------------------
Filename smells (index.tsx, __auth, wrong escape, non-route files)references/route-files.md
Missing , orphan dotted segments, duplicated layout logicreferences/layouts-outlets.md
Default export on a resource, without reloadDocument, splat paramsreferences/resource-routes.md
react-router-dom imports, __double folders, v1-adapter fallbackreferences/v1-holdovers.md
Missing ///, Vite-vs-Classic , root ErrorBoundary without document shellreferences/root-shell.md

Scope

This skill flags issues in:

  • Files under app/routes/ (filenames, exports, imports, JSX shape)
  • app/root.tsx (document shell, root )
  • remix.config.js (entries that change route discovery: routes(), ignoredRouteFiles, @remix-run/v1-route-convention)
  • Any module that links to a resource route ( usage)

Out of scope: loader/action data contracts (covered by remix-v2-data-flow-review), form behavior (remix-v2-forms-review), meta/headers (remix-v2-meta-sessions-review).

Review Checklist

Valid Patterns (Do NOT Flag)

  • Resource route with no default export — this is the convention that makes it a resource route. Never flag.
  • Any _-prefixed pathless layout file without when the module is intentionally a wrapper that renders fixed UI only. Confirm by checking children — if no *.{segment}.tsx siblings exist, the wrapper-only shape is intentional.
  • Files prefixed with _ that don't appear in any URL — pathless layouts and _index are supposed to be hidden from the URL.
  • @remix-run/v1-route-convention wired up in remix.config.js — legitimate migration adapter, not a smell on its own. Only flag if v1-style files appear without the adapter installed.
  • useLoaderData() — type annotation, not assertion.
  • Splat route accessing params["*"] with bracket syntax — that is the only correct access pattern.
  • Folder app/routes/dashboard/ with route.tsx plus sibling .server.ts, .css, component files — co-location is the documented pattern.
  • Trailing underscore (concerts_.mine.tsx) when a sibling concerts.tsx layout exists and this URL intentionally skips it.

Context-Sensitive Rules

Only flag these issues when the specific context applies:

IssueFlag ONLY IF
---------------------
index.tsx under app/routes/Project is v2 and @remix-run/v1-route-convention is NOT wired in remix.config.js
Parent module without Sibling dotted children (parent.*.tsx) exist in app/routes/
__double underscore folderNo v1-convention adapter is installed
Trailing-underscore segmentNo corresponding parent layout exists (nothing to opt out of)
Default export on a module returning non-HTMLThe loader/action actually returns a raw Response (PDF, JSON, RSS)
to resource routeTarget route has no default export AND lacks reloadDocument

Hard gates (before writing findings)

Run these in order. Do not draft user-facing findings until every gate passes for the batch you are about to report.

  1. Location evidencePass: Each issue lists a repo path (file under app/routes/ or remix.config.js) and either a line range or a short verbatim quote from the file you read. Filename-only smells must quote the literal filename.
  1. Exemption checkPass: For each issue, state in one line why it is not covered by Valid Patterns (Do NOT Flag). Resource-route flags require explicit evidence of a default export or a without reloadDocument.
  1. Version checkPass: Confirm the project is Remix v2 (check package.json for @remix-run/react ^2, or presence of v2 flat-routes filenames elsewhere in app/routes/). If @remix-run/v1-route-convention is wired in remix.config.js, v1 filenames (__auth/, index.tsx) are intentional — do not flag them as smells.
  1. ProtocolPass: Complete the Pre-Report Verification Checklist in review-verification-protocol for this review.

When to Load References

Review Questions

  1. Does every parent route render , or is it a deliberate wrapper-only?
  2. Do filenames match the v2 grammar (single _ for pathless, _index for index, [...] for escapes)?
  3. Are resource routes free of default exports, and do all s to them use reloadDocument?
  4. Are all router imports from @remix-run/react (and server helpers from @remix-run/node)?
  5. If v1 filenames exist, is @remix-run/v1-route-convention wired up — or are they accidental?

Additional Documentation

  • Route file naming smells: references/route-files.mdindex.tsx, __double folders, wrong escape syntax, dot/underscore confusion, non-route files under app/routes/.
  • Layouts and outlets: references/layouts-outlets.md — pathless layout misuse, missing , orphan dotted children, duplicated layout logic.
  • Resource routes: references/resource-routes.md — accidental default export, without reloadDocument, splat params["*"] access.
  • v1 holdovers: references/v1-holdovers.mdreact-router-dom imports, __auth folders, @remix-run/v1-route-convention as a deliberate-vs-accidental tell.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-06-04 14:04 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 78 📥 182,596
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 681 📥 329,857
dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 197 📥 68,021