Skip to content

feat: add no-react-native-in-web lint rule#53

Open
danielchen0 wants to merge 3 commits intomainfrom
danielchen0/no-react-native-in-web
Open

feat: add no-react-native-in-web lint rule#53
danielchen0 wants to merge 3 commits intomainfrom
danielchen0/no-react-native-in-web

Conversation

@danielchen0
Copy link
Collaborator

Summary

  • Adds no-react-native-in-web rule that detects imports from react-native and react-native-web in web modules
  • These imports cause ESM load failures on the server — 28K+ production errors/week from user-generated apps
  • Catches both import declarations and require() calls
  • Correctly allows third-party RN packages (e.g. react-native-safe-area-context)
  • Platform: web only

Test plan

Scenario Expected
import { View } from 'react-native' Error flagged
require('react-native') Error flagged
import from 'react-native-web' Error flagged
import from 'react' No error
import from 'react-native-safe-area-context' No error (subpackage)

Detects imports from 'react-native' and 'react-native-web' in web modules,
which cause ESM load failures on the server (28K+ production errors/week).
Catches both import declarations and require() calls.
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.

1 participant