Replies: 1 comment
-
Overall, it's quite an unusual approach, teams usually choose either relative imports or non-relative imports exclusively. I need to think it over. If other community members show strong interest in this idea, I could consider creating such a rule. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem? Please describe.
Currently when working within a family of folders, or a private folder, we have a requirement to use relative imports. And anything imported outside of this family would use absolute imports. Is there a feature that supports this? Could it be something that would work with the independent module rules?
Describe the solution you'd like
Ability to define whether imports should be relative or absolute (with support for path aliases) when imported from specified files that match the given pattern. For example:
Files within feature 1 or files within feature 2 should use relative imports. However if a file from feature 1 imported a file from feature2 it should use an absolute import. This is just a general example, but it could be applicable to other scenarios such as pages accessing global components vs child components of a given page using relative imports.
Describe alternatives you've considered
I have yet to find an eslint plugin that would allow me full control to do this.
Additional context
Add any other context or screenshots about the feature request here.
Beta Was this translation helpful? Give feedback.
All reactions