eslint rule to prevent imports from packages to app #9230
-
SummaryWe have a mono-repo with a NextJS webapp and a UI library within packages. In the UI library it is possible to import: // packages/ui-components/src/page-intro.tsx
import { Alpha } from '../../../apps/web/app/_services/models/page-intro'; This imports types from the NextJS app, which doesn't match our architecture. We only allow NextJS to import from the UI components, not the other way around. Is there any eslint/lint rule that can be enabled such that it can flag developers that they have imported files incorrectly? Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This sounds like this rule, if I'm understanding correctly: https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-packages.md |
Beta Was this translation helpful? Give feedback.
This sounds like this rule, if I'm understanding correctly: https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-relative-packages.md