Skip to content

Commit

Permalink
fix(fs-router) remove $phantom (#2262)
Browse files Browse the repository at this point in the history
  • Loading branch information
cromoteca authored Mar 26, 2024
1 parent 2b7ef94 commit c715b6f
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ async function checkFile(url: URL | undefined, logger: Logger): Promise<URL | un

const collator = new Intl.Collator('en-US');

const phantomDirPattern = /\/?\$phantom/giu;

const warningFor = ['.ts', '.js'];

/**
Expand All @@ -67,7 +65,7 @@ export default async function collectRoutesFromFS(
dir: URL,
{ extensions, logger, parent = dir }: CollectRoutesOptions,
): Promise<RouteMeta> {
const path = relative(fileURLToPath(parent), fileURLToPath(dir)).replaceAll(phantomDirPattern, '');
const path = relative(fileURLToPath(parent), fileURLToPath(dir));
let children: RouteMeta[] = [];
let layout: URL | undefined;

Expand All @@ -89,7 +87,7 @@ export default async function collectRoutesFromFS(
});
} else {
throw new Error(
'Symbol "$" is reserved for special directories and files; only "$layout", "$phantom" and "$index" are allowed',
'Symbol "$" is reserved for special directories and files; only "$layout" and "$index" are allowed',
);
}
} else if (!name.startsWith('_')) {
Expand Down

0 comments on commit c715b6f

Please sign in to comment.