ui-route-file-name-page-tsx - ESLint plugin rules

This rule requires UI route files under src/admin/routes to be named page.tsx.

Severity#

error. This rule is enabled in the recommended preset.

What it Targets#

This rule targets files in your project's src/admin/routes directory. It reports a file that uses defineRouteConfig but isn't named page.tsx.

The following code is reported by the rule:

src/admin/routes/custom/custom.tsx
1import { defineRouteConfig } from "@medusajs/admin-sdk"2
3const CustomPage = () => <div />4
5export const config = defineRouteConfig({6  label: "Custom",7})8
9export default CustomPage

Instead, rename the file to page.tsx:

src/admin/routes/custom/page.tsx
1import { defineRouteConfig } from "@medusajs/admin-sdk"2
3const CustomPage = () => <div />4
5export const config = defineRouteConfig({6  label: "Custom",7})8
9export default CustomPage

Why it's Important#

Medusa only registers UI routes from files named page.tsx. A route defined in a differently named file won't be added to the admin dashboard.

Learn more in the UI Routes documentation.

Fixable#

This rule isn't auto-fixable.

Was this page helpful?
Ask Bloom
For assistance in your development, use Claude Code Plugins or Docs MCP server in Cursor, VSCode, etc...FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break
⇧↵