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

monorepo/no-internal-import prevents some safe imports #10

Open
mxmul opened this issue Jun 3, 2020 · 2 comments
Open

monorepo/no-internal-import prevents some safe imports #10

mxmul opened this issue Jun 3, 2020 · 2 comments

Comments

@mxmul
Copy link

mxmul commented Jun 3, 2020

My understanding of this rule is that it's meant to prevent packages in the monorepo from importing files that exist locally, but would not be present after publishing to NPM.

It's also preventing valid internal imports of files that we know do get published to NPM, e.g. anything that is listed in the files array of package.json. For example if we know that package-a has files: ["lib"] in it's package.json, we should be able to tell that an import like import foo from 'package-a/lib/foo.js' is safe.

Would you be open to a flag that allowed these sort of internal imports?

@shmidt-i
Copy link
Contributor

shmidt-i commented Oct 7, 2020

@azz hey, we have a similar use-case in https://github.com/spotify/backstage, basically we want to allow everything included in files field inside package.json to be allowed by the rule:
Example of rule error that we want to avoid - https://github.com/spotify/backstage/blob/108ce379493e8a7a805b1501a696dd79ebe1dadd/packages/app/src/index.tsx#L17-L18

Please let me know if this is something you are interested in and happy to contribute!

@azz
Copy link
Owner

azz commented Oct 8, 2020

@shmidt-i Absolutely! Go wild.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants