Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
329 changes: 242 additions & 87 deletions e2e/solid-router/basic-file-based/src/routeTree.gen.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createFileRoute } from '@tanstack/solid-router'

export const Route = createFileRoute('/non-nested/named/$baz_/bar')({
export const Route = createFileRoute('/non-nested/named/$baz/bar')({
component: RouteComponent,
})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createFileRoute } from '@tanstack/solid-router'

export const Route = createFileRoute('/non-nested/path/baz_/bar')({
export const Route = createFileRoute('/non-nested/path/baz/bar')({
component: RouteComponent,
})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createFileRoute } from '@tanstack/solid-router'

export const Route = createFileRoute('/non-nested/prefix/prefix{$baz}_/bar')({
export const Route = createFileRoute('/non-nested/prefix/prefix{$baz}/bar')({
component: RouteComponent,
})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createFileRoute } from '@tanstack/solid-router'

export const Route = createFileRoute('/non-nested/suffix/{$baz}suffix_/bar')({
export const Route = createFileRoute('/non-nested/suffix/{$baz}suffix/bar')({
component: RouteComponent,
})

Expand Down
49 changes: 49 additions & 0 deletions e2e/solid-router/basic-file-based/src/routes/params-ps/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,55 @@ function RouteComponent() {
/params-ps/named/$foo
</Link>
</li>
<li>
<Link
data-testid="l-to-named-prefixfoo"
to="/params-ps/named/prefix{$foo}"
params={{ foo: 'foo' }}
>
/params-ps/named/{'prefix{$foo}'}
</Link>
</li>
<li>
<Link
data-testid="l-to-named-foosuffix"
to="/params-ps/named/{$foo}suffix"
params={{ foo: 'foo' }}
>
/params-ps/named/{'{$foo}suffix'}
</Link>
</li>
</ul>
<hr />
<h3 class="pb-2">Wildcard path params</h3>
<ul class="grid mb-2">
<li>
<Link
data-testid="l-to-wildcard-foo"
to="/params-ps/wildcard/$"
params={{ _splat: 'foo' }}
>
/params-ps/wildcard/$
</Link>
</li>
<li>
<Link
data-testid="l-to-wildcard-prefixfoo"
to="/params-ps/wildcard/prefix{$}"
params={{ _splat: 'foo' }}
>
/params-ps/wildcard/{'prefix{$}'}
</Link>
</li>
<li>
<Link
data-testid="l-to-wildcard-foosuffix"
to="/params-ps/wildcard/{$}suffix"
params={{ _splat: 'foo' }}
>
/params-ps/wildcard/{'{$}suffix'}
</Link>
</li>
</ul>
<hr />
<h3 class="pb-2">Non-nested path params</h3>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { createFileRoute, redirect } from '@tanstack/solid-router'

export const Route = createFileRoute('/params-ps/named/')({
beforeLoad: () => {
throw redirect({ to: '/params-ps' })
},
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { createFileRoute } from '@tanstack/solid-router'
export const Route = createFileRoute('/params-ps/named/prefix{$foo}')({
Comment on lines +1 to +2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add blank line after import statement.

The import statement should be followed by a blank line per project conventions.

Apply this diff:

 import { createFileRoute } from '@tanstack/solid-router'
+
 export const Route = createFileRoute('/params-ps/named/prefix{$foo}')({
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { createFileRoute } from '@tanstack/solid-router'
export const Route = createFileRoute('/params-ps/named/prefix{$foo}')({
import { createFileRoute } from '@tanstack/solid-router'
export const Route = createFileRoute('/params-ps/named/prefix{$foo}')({
🧰 Tools
🪛 ESLint

[error] 1-1: Expected 1 empty line after import statement not followed by another import.

(import/newline-after-import)

🤖 Prompt for AI Agents
In e2e/solid-router/basic-file-based/src/routes/params-ps/named/prefix{$foo}.tsx
lines 1-2, add a blank line after the import statement; modify the file so the
import line is followed by an empty line before the export statement to match
project conventions.

component: RouteComponent,
})

function RouteComponent() {
const p = Route.useParams()
return (
<div>
<h3>ParamsNamedFooPrefix</h3>
<div data-testid="params-output">{JSON.stringify(p())}</div>
</div>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { createFileRoute } from '@tanstack/solid-router'
export const Route = createFileRoute('/params-ps/named/{$foo}suffix')({
Comment on lines +1 to +2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add blank line after import statement.

The import statement should be followed by a blank line per project conventions.

Apply this diff:

 import { createFileRoute } from '@tanstack/solid-router'
+
 export const Route = createFileRoute('/params-ps/named/{$foo}suffix')({
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { createFileRoute } from '@tanstack/solid-router'
export const Route = createFileRoute('/params-ps/named/{$foo}suffix')({
import { createFileRoute } from '@tanstack/solid-router'
export const Route = createFileRoute('/params-ps/named/{$foo}suffix')({
🧰 Tools
🪛 ESLint

[error] 1-1: Expected 1 empty line after import statement not followed by another import.

(import/newline-after-import)

🤖 Prompt for AI Agents
In e2e/solid-router/basic-file-based/src/routes/params-ps/named/{$foo}suffix.tsx
around lines 1 to 2, the import statement is not followed by a blank line as
required by project conventions; insert a single blank line immediately after
the import statement so the file begins with the import, one empty line, then
the export/createFileRoute call.

component: RouteComponent,
})

function RouteComponent() {
const p = Route.useParams()
return (
<div>
<h3>ParamsNamedFooSuffix</h3>
<div data-testid="params-output">{JSON.stringify(p())}</div>
</div>
)
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createFileRoute, useParams } from '@tanstack/solid-router'
import { useExperimentalNonNestedRoutes } from '../../../../../tests/utils/useExperimentalNonNestedRoutes'

export const Route = createFileRoute('/params-ps/non-nested/$foo_/$bar')({
export const Route = createFileRoute('/params-ps/non-nested/$foo/$bar')({
component: RouteComponent,
})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { createFileRoute } from '@tanstack/solid-router'

export const Route = createFileRoute('/params-ps/non-nested/$foo_')()
export const Route = createFileRoute('/params-ps/non-nested/$foo')()
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { createFileRoute } from '@tanstack/solid-router'
export const Route = createFileRoute('/params-ps/wildcard/$')({
Comment on lines +1 to +2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add blank line after import statement.

The import statement should be followed by a blank line per project conventions.

Apply this diff:

 import { createFileRoute } from '@tanstack/solid-router'
+
 export const Route = createFileRoute('/params-ps/wildcard/$')({
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { createFileRoute } from '@tanstack/solid-router'
export const Route = createFileRoute('/params-ps/wildcard/$')({
import { createFileRoute } from '@tanstack/solid-router'
export const Route = createFileRoute('/params-ps/wildcard/$')({
🧰 Tools
🪛 ESLint

[error] 1-1: Expected 1 empty line after import statement not followed by another import.

(import/newline-after-import)

🤖 Prompt for AI Agents
In e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/$.tsx around
lines 1 to 2, the import statement is not followed by a blank line per project
conventions; insert a single blank line immediately after the import statement
so there is an empty line between the import and the subsequent
export/createFileRoute call.

component: RouteComponent,
})

function RouteComponent() {
const p = Route.useParams()
return (
<div>
<h3>ParamsWildcardSplat</h3>
<div data-testid="params-output">{JSON.stringify(p())}</div>
</div>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { createFileRoute } from '@tanstack/solid-router'
import { redirect } from '@tanstack/solid-router'

export const Route = createFileRoute('/params-ps/wildcard/')({
beforeLoad: () => {
throw redirect({ to: '/params-ps' })
},
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { createFileRoute } from '@tanstack/solid-router'
export const Route = createFileRoute('/params-ps/wildcard/prefix{$}')({
Comment on lines +1 to +2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add blank line after import statement.

The import statement should be followed by a blank line per project conventions.

Apply this diff:

 import { createFileRoute } from '@tanstack/solid-router'
+
 export const Route = createFileRoute('/params-ps/wildcard/prefix{$}')({
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { createFileRoute } from '@tanstack/solid-router'
export const Route = createFileRoute('/params-ps/wildcard/prefix{$}')({
import { createFileRoute } from '@tanstack/solid-router'
export const Route = createFileRoute('/params-ps/wildcard/prefix{$}')({
🧰 Tools
🪛 ESLint

[error] 1-1: Expected 1 empty line after import statement not followed by another import.

(import/newline-after-import)

🤖 Prompt for AI Agents
In e2e/solid-router/basic-file-based/src/routes/params-ps/wildcard/prefix{$}.tsx
around lines 1 to 2, the import statement is not followed by a blank line as
required by project conventions; insert a single blank line immediately after
the import statement so there is an empty line between the import and the
following export/createFileRoute call.

component: RouteComponent,
})

function RouteComponent() {
const p = Route.useParams()
return (
<div>
<h3>ParamsWildcardSplatPrefix</h3>
<div data-testid="params-output">{JSON.stringify(p())}</div>
</div>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { createFileRoute } from '@tanstack/solid-router'
export const Route = createFileRoute('/params-ps/wildcard/{$}suffix')({
component: RouteComponent,
})

function RouteComponent() {
const p = Route.useParams()
return (
<div>
<h3>ParamsWildcardSplatSuffix</h3>
<div data-testid="params-output">{JSON.stringify(p())}</div>
</div>
)
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createFileRoute, getRouteApi, useParams } from '@tanstack/solid-router'
import { useExperimentalNonNestedRoutes } from '../../tests/utils/useExperimentalNonNestedRoutes'

export const Route = createFileRoute('/posts_/$postId/edit')({
export const Route = createFileRoute('/posts/$postId/edit')({
component: PostEditPage,
})

Expand Down
Loading
Loading