www/apps/resources/app/lint/rules/ui-route-file-name-page-tsx/page.mdx
export const metadata = {
title: ui-route-file-name-page-tsx - ESLint plugin rules,
}
This rule requires UI route files under src/admin/routes to be named page.tsx.
error. This rule is enabled in the recommended preset.
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:
import { defineRouteConfig } from "@medusajs/admin-sdk"
const CustomPage = () => <div />
export const config = defineRouteConfig({
label: "Custom",
})
export default CustomPage
Instead, rename the file to page.tsx:
import { defineRouteConfig } from "@medusajs/admin-sdk"
const CustomPage = () => <div />
export const config = defineRouteConfig({
label: "Custom",
})
export default CustomPage
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.
This rule isn't auto-fixable.