Skip to content

Bug: false positive unused-file warnings with expo-router file-based routing #540

@FabienBounoir

Description

@FabienBounoir

react-native doctor reports a large amount of false positive unused-file warnings when using expo-router.

Files inside the app/ directory are detected as unused even though they are valid routes automatically discovered by Expo Router.

Example warnings:

⚠ deslop/unused-file
Unused file — not reachable from any entry point

src/app/(tabs)/_layout.tsx
src/app/(tabs)/accueil.tsx
src/app/(tabs)/assistance.tsx
src/app/_layout.tsx

Expected behavior

Files used by Expo Router's file-based routing system should not be reported as unused.

Actual behavior

The doctor only seems to analyze explicit imports and does not recognize Expo Router route discovery.

Additional context

Expo Router relies on filesystem conventions instead of direct imports, so route files are intentionally not imported manually.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions