Skip to content

fix: support custom variable names in expo-font-loaded-check#49

Merged
danielchen0 merged 1 commit intomainfrom
fix-expo-font-loaded-check
Feb 26, 2026
Merged

fix: support custom variable names in expo-font-loaded-check#49
danielchen0 merged 1 commit intomainfrom
fix-expo-font-loaded-check

Conversation

@danielchen0
Copy link
Collaborator

Summary

  • The expo-font-loaded-check rule previously only matched the exact variable name loaded
  • Now it tracks the actual destructured variable name from useFonts() (e.g. fontsLoaded)
  • Patterns like if (!fontsLoaded && !fontError) return null are now correctly recognized

Example

// This was incorrectly flagged before:
const [fontsLoaded, fontError] = useFonts({ Inter_400Regular });
if (!fontsLoaded && !fontError) return null;

The rule previously only matched the exact variable name `loaded` when
checking for font load guards. Now it tracks the actual destructured
variable name from useFonts() (e.g. `fontsLoaded`), so patterns like
`if (!fontsLoaded && !fontError) return null` are correctly recognized.
@danielchen0 danielchen0 merged commit 961ed37 into main Feb 26, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants