Skip to content

Commit

Permalink
Streamline RoutesFormat logic
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Feb 28, 2024
1 parent 1edfbe7 commit 402cd6e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
4 changes: 1 addition & 3 deletions packages/remix-dev/cli/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ export async function routes(
// v3 TODO: Remove this and require the presence of a Vite config
(await readConfig(remixRoot)).routes;

let formatArg = flags.json ? "json" : "jsx";
let format = isRoutesFormat(formatArg) ? formatArg : RoutesFormat.jsx;

let format = flags.json ? RoutesFormat.json : RoutesFormat.jsx;
console.log(formatRoutes(routes, format));
}

Expand Down
4 changes: 0 additions & 4 deletions packages/remix-dev/config/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ export enum RoutesFormat {
jsx = "jsx",
}

export function isRoutesFormat(format: any): format is RoutesFormat {
return format === RoutesFormat.json || format === RoutesFormat.jsx;
}

export function formatRoutes(
routeManifest: RouteManifest,
format: RoutesFormat
Expand Down

0 comments on commit 402cd6e

Please sign in to comment.