Skip to content

feat: add Expo and React Native framework detection and enable RN-specific rules#64

Merged
aidenybai merged 1 commit intomillionco:mainfrom
athul-binu:feat/expo-react-native-framework-detection
Feb 21, 2026
Merged

feat: add Expo and React Native framework detection and enable RN-specific rules#64
aidenybai merged 1 commit intomillionco:mainfrom
athul-binu:feat/expo-react-native-framework-detection

Conversation

@athul-binu
Copy link
Copy Markdown
Contributor

Summary

React Native and Expo projects are currently detected as "unknown" framework (displayed as just "React"), and the 8 existing rn-* lint rules in the plugin are never enabled in the oxlint config — they're effectively dead code.

This PR:

  • Adds "expo" and "react-native" as recognized Framework types in types.ts
  • Detects expo and react-native packages in FRAMEWORK_PACKAGES during project discovery, so the CLI correctly displays "Expo" or "React Native" instead of "React"
  • Conditionally enables all 8 rn-* rules when framework is Expo or React Native (same pattern as NEXTJS_RULES):
    • rn-no-raw-text (error) — raw text outside <Text> crashes on RN
    • rn-no-deprecated-modules (error) — removed modules from react-native core
    • rn-no-legacy-expo-packages (warn) — deprecated Expo packages
    • rn-no-dimensions-get (warn) — non-reactive dimension API
    • rn-no-inline-flatlist-renderitem (warn) — perf issue with inline renderItem
    • rn-no-legacy-shadow-styles (warn) — legacy shadow props vs boxShadow
    • rn-prefer-reanimated (warn) — UI-thread animations over JS-thread
    • rn-no-single-element-style-array (warn) — unnecessary array allocation
  • Adds "React Native" category for all rn-* rules in diagnostic output
  • Adds actionable help text for each rn-* rule

Before

✓ Detecting framework. Found React.     ← wrong
  (no RN-specific diagnostics)           ← rules exist but never fire

After (tested on a real Expo project)

✓ Detecting framework. Found Expo.
✗ "SafeAreaView" was removed from react-native — use react-native-safe-area-context instead
    Import from the community package instead — deprecated modules were removed from the react-native core
⚠ Dimensions.get() does not update on screen rotation or resize — use useWindowDimensions()
    Use const { width, height } = useWindowDimensions() — it updates reactively on rotation and resize

Test plan

  • pnpm build succeeds
  • All 125 existing tests pass (pnpm test)
  • No new files created — follows existing patterns exactly (mirrors NEXTJS_RULES approach)
  • Verified on a real Expo project: framework shows as "Expo" and RN rules fire correctly

…cific rules

React Native/Expo projects were detected as "unknown" framework, and the 8
existing rn-* lint rules were never enabled in the oxlint config. This change:

- Adds "expo" and "react-native" as recognized Framework types
- Detects expo/react-native packages in dependency detection
- Conditionally enables all 8 rn-* rules when framework is Expo or React Native
- Adds "React Native" category mapping and help text for all rn-* rules
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 20, 2026

@athul-binu is attempting to deploy a commit to the Million Team on Vercel.

A member of the Team first needs to authorize it.

@aidenybai aidenybai merged commit 79af7ca into millionco:main Feb 21, 2026
1 of 2 checks passed
@aidenybai
Copy link
Copy Markdown
Member

good catch, ty

@athul-binu athul-binu deleted the feat/expo-react-native-framework-detection branch February 22, 2026 19:58
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