Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail build on unintended cross-platform imports #21

Closed
amcclain opened this issue Feb 21, 2020 · 2 comments
Closed

Fail build on unintended cross-platform imports #21

amcclain opened this issue Feb 21, 2020 · 2 comments

Comments

@amcclain
Copy link
Member

A desktop app (or desktop Hoist components) should never import from the /mobile/ package, and vice-versa. Unfortunately this is easy to do accidentally w/IDE import suggestions and the like.

The build should detect this case and fail. I don't think we should ever have a bundle including imports from both /desktop/ and /mobile/, which seems like it would make this case easy to detect.

@amcclain
Copy link
Member Author

Looks like we might also be able to get some coverage here from the linter:

https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-restricted-paths.md

Did not review in depth, but appears that this would do a pretty good job in hoist-react itself where we can setup rules for the known top-level paths for desktop and mobile. Apps could do the same for their platform-specific app directories.

@amcclain
Copy link
Member Author

amcclain commented Sep 9, 2022

Effectively handled via Hoist React approach in xh/hoist-react#3082

@amcclain amcclain closed this as completed Sep 9, 2022
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

No branches or pull requests

1 participant