-
-
Notifications
You must be signed in to change notification settings - Fork 386
Description
Suggest an idea for Knip
Hi 👋,
Expo is a complicated framework, because (unlike others, eg. next or astro which rely on build tools and wrap their configuration) it uses babel/metro config files. Expo depends on @expo/metro, which depends on all the metro tools, but that's not important here.
A project does not need metro in its package.json directly installed, and thus the metro plugin is not activated, and the metro config file is reported as unused. Reference: https://docs.expo.dev/guides/customizing-metro/
Babel is in a similar situation, although in all of the RN/expo projects I've seen where babel.config.js was explicitly added (neither is required, but for customization it's supported), @babel/transform and others were directly depended upon, so it's not as useful to infer in my opinion.
I was looking at the existing expo and metro plugins, and my current best idea is to add expo to the enablers of the metro plugin - but it's possible that there is a better way, hence this issue instead of a PR. Let me know if this is the right approach, or I'd missed a way to cross-reference plugins, happy to add it.