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
7 changes: 7 additions & 0 deletions e2e/react-start/rsc/tests/hydration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { expect, type Page } from '@playwright/test'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Verify relevant lint rules are configured in repo lint files
rg -n --iglob '*eslint*' 'import/consistent-type-specifier-style|sort-imports'

# Verify current import in hydration helper
rg -n "import \{ expect, type Page \} from '@playwright/test'" e2e/react-start/rsc/tests/hydration.ts

Repository: TanStack/router

Length of output: 41


🏁 Script executed:

# Check if file exists and read the actual import
cat -n e2e/react-start/rsc/tests/hydration.ts | head -20

Repository: TanStack/router

Length of output: 315


🏁 Script executed:

# Find ESLint configuration files in the repo
find . -maxdepth 3 -type f \( -name ".eslintrc*" -o -name "eslint.config.*" \) | head -20

Repository: TanStack/router

Length of output: 916


🏁 Script executed:

# Search for import-related lint rules more broadly
rg -A 5 -B 5 "import/consistent-type-specifier-style|sort-imports" --type-list | head -50

Repository: TanStack/router

Length of output: 448


🏁 Script executed:

# Read root ESLint config
cat ./eslint.config.js | head -100

Repository: TanStack/router

Length of output: 818


🏁 Script executed:

# Read e2e ESLint config
cat ./e2e/eslint-plugin-start/eslint.config.js

Repository: TanStack/router

Length of output: 645


🏁 Script executed:

# Check for any other e2e related eslint configs
find ./e2e -type f -name "eslint.config.*"

Repository: TanStack/router

Length of output: 342


🏁 Script executed:

# Search for import-related rules in the codebase
rg "import/consistent-type-specifier-style|sort-imports|simple-import-sort" . --type-list 2>/dev/null | head -30

Repository: TanStack/router

Length of output: 41


🏁 Script executed:

# Try to find where `@tanstack/eslint-config` is defined or check imports in root config
rg "import/consistent-type-specifier-style|type.*import" --type js --type ts . | head -30

Repository: TanStack/router

Length of output: 3853


🏁 Script executed:

# Check the specific e2e/react-start/rsc/eslint.config.js config
cat ./e2e/react-start/rsc/eslint.config.js

Repository: TanStack/router

Length of output: 617


🏁 Script executed:

# Search for any ESLint comments or disable directives in the hydration.ts file
cat -n e2e/react-start/rsc/tests/hydration.ts

Repository: TanStack/router

Length of output: 315


🏁 Script executed:

# Check if `@tanstack/eslint-config` has type-import rules
rg "import/consistent-type-specifier-style" . --type js --type ts

Repository: TanStack/router

Length of output: 41


🏁 Script executed:

# Check if there's a parent or global eslint config for e2e tests
find ./e2e -name ".eslintignore" -o -name "eslint.config.*" | xargs ls -la 2>/dev/null

Repository: TanStack/router

Length of output: 636


🏁 Script executed:

# Search for any eslint overrides or configs that might target tests or hydration.ts
rg "tests.*hydration|hydration\.ts" . --type js --type ts --type json

Repository: TanStack/router

Length of output: 553


🏁 Script executed:

# Check if there's any playwright-specific eslint config or rules
rg "playwright|@playwright" . --type js --type ts -A 3 | grep -i "rule\|config" | head -20

Repository: TanStack/router

Length of output: 1668


🏁 Script executed:

# Check what rules `@tanstack/eslint-config` exports (look for it in node_modules or package.json)
rg "tanstack.*eslint.*config" . --type json -A 3 | head -30

Repository: TanStack/router

Length of output: 905


🏁 Script executed:

# Check if there are any eslint overrides or additional configs in root eslint.config.js that might apply to test files
cat ./eslint.config.js | grep -A 20 -B 5 "test\|e2e"

Repository: TanStack/router

Length of output: 41


🏁 Script executed:

# Look for any other ESLint configs in parent directories or check if test files have any lint rules
rg "import.*type|type.*import" e2e/react-start/rsc/tests/ --type ts -B 2 -A 2

Repository: TanStack/router

Length of output: 1317


🏁 Script executed:

# Check if other test files in same directory use the same pattern
rg "import.*type.*from.*@playwright/test" e2e/react-start/rsc/tests/ -l

Repository: TanStack/router

Length of output: 141


🏁 Script executed:

# Verify the root eslint.config.js doesn't have any overrides for test files
cat ./eslint.config.js

Repository: TanStack/router

Length of output: 818


🏁 Script executed:

# Check if `@tanstack/eslint-config` actually includes import/consistent-type-specifier-style
npm list `@tanstack/eslint-config` 2>/dev/null || grep "@tanstack/eslint-config" ./package.json

Repository: TanStack/router

Length of output: 738


🏁 Script executed:

# Find and examine the `@tanstack/eslint-config` to see what rules it exports
find ./node_modules -path "*@tanstack/eslint-config*" -name "*.js" -o -path "*@tanstack/eslint-config*" -name "*.ts" | head -10

Repository: TanStack/router

Length of output: 2001


🏁 Script executed:

# Check the actual eslint-config content
cat ./node_modules/.pnpm/@tanstack+eslint-config@0.4.0_@typescript-eslint+utils@8.57.1_eslint@9.22.0_jiti@2.6.1__71a7465028deca506823eb713e9f533e/node_modules/@tanstack/eslint-config/dist/index.js 2>/dev/null | head -200

Repository: TanStack/router

Length of output: 1802


🏁 Script executed:

# Search for import/consistent-type-specifier-style in entire node_modules to see if it's even available
rg "import/consistent-type-specifier-style" ./node_modules --max-count 5 2>/dev/null

Repository: TanStack/router

Length of output: 41


🏁 Script executed:

# Check what import rules are defined in `@tanstack/eslint-config`
cat ./node_modules/.pnpm/@tanstack+eslint-config@0.4.0_@typescript-eslint+utils@8.57.1_eslint@9.22.0_jiti@2.6.1__71a7465028deca506823eb713e9f533e/node_modules/@tanstack/eslint-config/dist/import.js

Repository: TanStack/router

Length of output: 592


🏁 Script executed:

# Check if eslint-plugin-import-x (which is used) has the consistent-type-specifier-style rule
rg "consistent-type-specifier-style" ./node_modules/.pnpm/eslint-plugin-import-x* --max-count 5 2>/dev/null | head -10

Repository: TanStack/router

Length of output: 41


Separate the type import to top level to satisfy lint rules.

The file uses inline type Page specifier which violates the configured import/consistent-type-specifier-style rule (set to "error" with "prefer-top-level" style in @tanstack/eslint-config).

♻️ Proposed fix
-import { expect, type Page } from '@playwright/test'
+import { expect } from '@playwright/test'
+import type { Page } from '@playwright/test'
📝 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 { expect, type Page } from '@playwright/test'
import { expect } from '@playwright/test'
import type { Page } from '@playwright/test'
🧰 Tools
🪛 ESLint

[error] 1-1: Member 'Page' of the import declaration should be sorted alphabetically.

(sort-imports)


[error] 1-1: Prefer using a top-level type-only import instead of inline type specifiers.

(import/consistent-type-specifier-style)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@e2e/react-start/rsc/tests/hydration.ts` at line 1, The import currently mixes
a value and a type specifier inline; split them into two top-level imports to
satisfy the lint rule: keep the value import for expect as import { expect }
from '@playwright/test' and add a separate top-level type-only import import
type { Page } from '@playwright/test' so the type Page is imported with the
"type" specifier on its own import declaration.


export async function waitForHydration(page: Page) {
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated', {
timeout: 15000,
})
}
5 changes: 3 additions & 2 deletions e2e/react-start/rsc/tests/rsc-async-bundle.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect } from '@playwright/test'
import { test } from '@tanstack/router-e2e-utils'
import { waitForHydration } from './hydration'

test.describe('RSC Async Bundle Tests - Multiple RSC Promises with React.use()', () => {
test('Loading states appear for each RSC before they resolve', async ({
Expand Down Expand Up @@ -222,7 +223,7 @@ test.describe('RSC Async Bundle Tests - Multiple RSC Promises with React.use()',
// Start at home
await page.goto('/')
await page.waitForURL('/')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Navigate to async bundle page via link (if nav exists) or direct navigation
await page.goto('/rsc-async-bundle')
Expand Down Expand Up @@ -265,7 +266,7 @@ test.describe('RSC Async Bundle Tests - Multiple RSC Promises with React.use()',
// Navigate away
await page.goto('/')
await page.waitForURL('/')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Second visit (force new request)
await page.goto('/rsc-async-bundle')
Expand Down
3 changes: 2 additions & 1 deletion e2e/react-start/rsc/tests/rsc-basic.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect } from '@playwright/test'
import { test } from '@tanstack/router-e2e-utils'
import { waitForHydration } from './hydration'

test.describe('RSC Basic Tests', () => {
test('RSC renders with server timestamp', async ({ page }) => {
Expand Down Expand Up @@ -29,7 +30,7 @@ test.describe('RSC Basic Tests', () => {
// Start from home
await page.goto('/')
await page.waitForURL('/')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Navigate to RSC page via nav bar (need to be specific to avoid matching example cards)
await page.getByTestId('nav-basic').click()
Expand Down
9 changes: 5 additions & 4 deletions e2e/react-start/rsc/tests/rsc-bundle.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect } from '@playwright/test'
import { test } from '@tanstack/router-e2e-utils'
import { waitForHydration } from './hydration'

test.describe('RSC Bundle Tests - Multiple RSCs from single server function', () => {
test('All bundled RSCs render correctly on initial load', async ({
Expand Down Expand Up @@ -49,7 +50,7 @@ test.describe('RSC Bundle Tests - Multiple RSCs from single server function', ()
test('Client slots in bundled RSCs work correctly', async ({ page }) => {
await page.goto('/rsc-bundle')
await page.waitForURL('/rsc-bundle')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Verify client actions area is rendered
await expect(page.getByTestId('content-actions')).toBeVisible()
Expand Down Expand Up @@ -81,7 +82,7 @@ test.describe('RSC Bundle Tests - Multiple RSCs from single server function', ()
test('Client interactions do not reload bundled RSCs', async ({ page }) => {
await page.goto('/rsc-bundle')
await page.waitForURL('/rsc-bundle')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Get initial timestamp
const initialTimestamp = await page
Expand Down Expand Up @@ -120,7 +121,7 @@ test.describe('RSC Bundle Tests - Multiple RSCs from single server function', ()
// Start at home
await page.goto('/')
await page.waitForURL('/')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Navigate to bundle page via nav bar (use exact match to avoid 'Async Bundle')
await page.getByTestId('nav-bundle').click()
Expand All @@ -145,7 +146,7 @@ test.describe('RSC Bundle Tests - Multiple RSCs from single server function', ()
// Navigate away
await page.goto('/')
await page.waitForURL('/')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Second visit (force reload)
await page.goto('/rsc-bundle')
Expand Down
11 changes: 6 additions & 5 deletions e2e/react-start/rsc/tests/rsc-caching.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect } from '@playwright/test'
import { test } from '@tanstack/router-e2e-utils'
import { waitForHydration } from './hydration'

test.describe('RSC Caching Tests - staleTime behavior', () => {
test('Page loads with cache controls visible', async ({ page }) => {
Expand All @@ -24,7 +25,7 @@ test.describe('RSC Caching Tests - staleTime behavior', () => {
test('Force refresh button triggers RSC refetch', async ({ page }) => {
await page.goto('/rsc-caching')
await page.waitForURL('/rsc-caching')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Get initial timestamp
const initialTimestamp = await page
Expand All @@ -51,7 +52,7 @@ test.describe('RSC Caching Tests - staleTime behavior', () => {
test('Multiple force refreshes increment counter', async ({ page }) => {
await page.goto('/rsc-caching')
await page.waitForURL('/rsc-caching')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Click force refresh multiple times
await page.getByTestId('force-refresh-btn').click()
Expand All @@ -75,7 +76,7 @@ test.describe('RSC Caching Tests - staleTime behavior', () => {
}) => {
await page.goto('/rsc-caching')
await page.waitForURL('/rsc-caching')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Get initial timestamp
const initialTimestamp = await page
Expand Down Expand Up @@ -104,7 +105,7 @@ test.describe('RSC Caching Tests - staleTime behavior', () => {
test('Each force refresh updates the timestamp', async ({ page }) => {
await page.goto('/rsc-caching')
await page.waitForURL('/rsc-caching')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

const timestamps: number[] = []

Expand Down Expand Up @@ -148,7 +149,7 @@ test.describe('RSC Caching Tests - staleTime behavior', () => {
// Start at home
await page.goto('/')
await page.waitForURL('/')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Navigate to caching page via nav bar
await page.getByTestId('nav-caching').click()
Expand Down
5 changes: 3 additions & 2 deletions e2e/react-start/rsc/tests/rsc-client-preload.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect } from '@playwright/test'
import { test } from '@tanstack/router-e2e-utils'
import { waitForHydration } from './hydration'

test.describe('RSC Client Component Preload Tests', () => {
function getModulePreloads(html: string): Array<string> {
Expand Down Expand Up @@ -76,7 +77,7 @@ test.describe('RSC Client Component Preload Tests', () => {
test('client component is interactive after hydration', async ({ page }) => {
await page.goto('/rsc-client-preload')
await page.waitForURL('/rsc-client-preload')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Verify initial count is 0
await expect(page.getByTestId('client-widget-count')).toHaveText('0')
Expand Down Expand Up @@ -104,7 +105,7 @@ test.describe('RSC Client Component Preload Tests', () => {

await page.goto('/rsc-client-preload')
await page.waitForURL('/rsc-client-preload')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Verify content is visible
await expect(page.getByTestId('client-widget')).toBeVisible()
Expand Down
15 changes: 8 additions & 7 deletions e2e/react-start/rsc/tests/rsc-component-slot.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { expect } from '@playwright/test'
import { test } from '@tanstack/router-e2e-utils'
import { waitForHydration } from './hydration'

test.describe('RSC Component Slot Tests - Passing components as props', () => {
test('Renders server product card with client component slots', async ({
page,
}) => {
await page.goto('/rsc-component-slot')
await page.waitForURL('/rsc-component-slot')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Verify server-rendered product card
await expect(page.getByTestId('rsc-product-card')).toBeVisible()
Expand All @@ -27,7 +28,7 @@ test.describe('RSC Component Slot Tests - Passing components as props', () => {
test('Changing quantity does not reload RSC', async ({ page }) => {
await page.goto('/rsc-component-slot')
await page.waitForURL('/rsc-component-slot')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Get initial RSC timestamp
const initialTimestamp = await page
Expand Down Expand Up @@ -64,7 +65,7 @@ test.describe('RSC Component Slot Tests - Passing components as props', () => {
test('Toggling badge details does not reload RSC', async ({ page }) => {
await page.goto('/rsc-component-slot')
await page.waitForURL('/rsc-component-slot')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Get initial RSC timestamp
const initialTimestamp = await page
Expand Down Expand Up @@ -94,7 +95,7 @@ test.describe('RSC Component Slot Tests - Passing components as props', () => {
test('Add to cart interaction does not reload RSC', async ({ page }) => {
await page.goto('/rsc-component-slot')
await page.waitForURL('/rsc-component-slot')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Get initial RSC timestamp
const initialTimestamp = await page
Expand Down Expand Up @@ -129,7 +130,7 @@ test.describe('RSC Component Slot Tests - Passing components as props', () => {
}) => {
await page.goto('/rsc-component-slot')
await page.waitForURL('/rsc-component-slot')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Get initial RSC timestamp
const initialTimestamp = await page
Expand Down Expand Up @@ -159,7 +160,7 @@ test.describe('RSC Component Slot Tests - Passing components as props', () => {
test('Reset quantity works without reloading RSC', async ({ page }) => {
await page.goto('/rsc-component-slot')
await page.waitForURL('/rsc-component-slot')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Get initial RSC timestamp
const initialTimestamp = await page
Expand Down Expand Up @@ -191,7 +192,7 @@ test.describe('RSC Component Slot Tests - Passing components as props', () => {
}) => {
await page.goto('/rsc-component-slot')
await page.waitForURL('/rsc-component-slot')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Verify server-provided data is passed to client components
// Product ID comes from server and is displayed in client component
Expand Down
11 changes: 6 additions & 5 deletions e2e/react-start/rsc/tests/rsc-context.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect } from '@playwright/test'
import { test } from '@tanstack/router-e2e-utils'
import { waitForHydration } from './hydration'

test.describe('RSC Context Tests - React Context interaction', () => {
test('Page loads with context controls visible', async ({ page }) => {
Expand All @@ -25,7 +26,7 @@ test.describe('RSC Context Tests - React Context interaction', () => {
test('Theme toggle changes context', async ({ page }) => {
await page.goto('/rsc-context')
await page.waitForURL('/rsc-context')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Verify initial theme
await expect(page.getByTestId('current-theme')).toContainText(
Expand Down Expand Up @@ -53,7 +54,7 @@ test.describe('RSC Context Tests - React Context interaction', () => {
test('Notifications toggle works correctly', async ({ page }) => {
await page.goto('/rsc-context')
await page.waitForURL('/rsc-context')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Verify initial notifications state is ON
await expect(page.getByTestId('toggle-notifications-btn')).toContainText(
Expand Down Expand Up @@ -83,7 +84,7 @@ test.describe('RSC Context Tests - React Context interaction', () => {
test('Theme changes do not refetch RSC', async ({ page }) => {
await page.goto('/rsc-context')
await page.waitForURL('/rsc-context')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Get initial timestamp
const initialTimestamp = await page
Expand Down Expand Up @@ -121,7 +122,7 @@ test.describe('RSC Context Tests - React Context interaction', () => {
}) => {
await page.goto('/rsc-context')
await page.waitForURL('/rsc-context')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Verify context consumer is visible
await expect(page.getByTestId('context-consumer')).toBeVisible()
Expand All @@ -144,7 +145,7 @@ test.describe('RSC Context Tests - React Context interaction', () => {
test('Multiple context changes work correctly', async ({ page }) => {
await page.goto('/rsc-context')
await page.waitForURL('/rsc-context')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Change both theme and notifications
await page.getByTestId('toggle-theme-btn').click()
Expand Down
5 changes: 3 additions & 2 deletions e2e/react-start/rsc/tests/rsc-css-modules.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect } from '@playwright/test'
import { test } from '@tanstack/router-e2e-utils'
import { waitForHydration } from './hydration'

test.describe('RSC CSS Modules Tests', () => {
test('RSC with CSS modules hydrates without errors', async ({ page }) => {
Expand All @@ -13,7 +14,7 @@ test.describe('RSC CSS Modules Tests', () => {

await page.goto('/rsc-css-modules')
await page.waitForURL('/rsc-css-modules')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Verify content is visible
await expect(page.getByTestId('rsc-css-modules-content')).toBeVisible()
Expand Down Expand Up @@ -106,7 +107,7 @@ test.describe('RSC CSS Modules Tests', () => {
}) => {
await page.goto('/')
await page.waitForURL('/')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

await page.getByTestId('nav-css-modules').click()
await page.waitForURL('/rsc-css-modules')
Expand Down
7 changes: 4 additions & 3 deletions e2e/react-start/rsc/tests/rsc-deferred.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { expect } from '@playwright/test'
import { test } from '@tanstack/router-e2e-utils'
import { waitForHydration } from './hydration'
const DEFERRED_DATA_TIMEOUT = 5000 // Deferred data takes ~2 seconds
Comment on lines +3 to 4
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix lint error: add a blank line after imports.

Line 3 is currently followed by a declaration on Line 4, which violates import/newline-after-import reported by ESLint.

Suggested fix
 import { expect } from '@playwright/test'
 import { test } from '@tanstack/router-e2e-utils'
 import { waitForHydration } from './hydration'
+
 const DEFERRED_DATA_TIMEOUT = 5000 // Deferred data takes ~2 seconds
📝 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 { waitForHydration } from './hydration'
const DEFERRED_DATA_TIMEOUT = 5000 // Deferred data takes ~2 seconds
import { expect } from '@playwright/test'
import { test } from '@tanstack/router-e2e-utils'
import { waitForHydration } from './hydration'
const DEFERRED_DATA_TIMEOUT = 5000 // Deferred data takes ~2 seconds
🧰 Tools
🪛 ESLint

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

(import/newline-after-import)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@e2e/react-start/rsc/tests/rsc-deferred.spec.ts` around lines 3 - 4, Add a
blank line after the import statement to satisfy the import/newline-after-import
rule: separate the import of waitForHydration from the constant declaration
DEFERRED_DATA_TIMEOUT by inserting an empty line after the import so the file's
top-of-file imports and subsequent declarations are visually and lint-wise
separated.


test.describe('RSC Deferred Tests - RSC with streamed Promise data', () => {
Expand Down Expand Up @@ -64,7 +65,7 @@ test.describe('RSC Deferred Tests - RSC with streamed Promise data', () => {
await expect(page.getByTestId('analytics-display')).toBeVisible({
timeout: DEFERRED_DATA_TIMEOUT,
})
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Initially no metric selected
await expect(page.getByTestId('selected-metric')).not.toBeVisible()
Expand Down Expand Up @@ -126,7 +127,7 @@ test.describe('RSC Deferred Tests - RSC with streamed Promise data', () => {
await expect(page.getByTestId('analytics-display')).toBeVisible({
timeout: DEFERRED_DATA_TIMEOUT,
})
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Get initial values
const initialTimestamp = await page
Expand Down Expand Up @@ -158,7 +159,7 @@ test.describe('RSC Deferred Tests - RSC with streamed Promise data', () => {
// Start at home
await page.goto('/')
await page.waitForURL('/')
await expect(page.getByTestId('app-hydrated')).toHaveText('hydrated')
await waitForHydration(page)

// Navigate to deferred page via nav bar
await page.getByTestId('nav-deferred').click()
Expand Down
Loading
Loading