Why this matters
Relative imports can make the code harder to understand and maintain, especially in large projects. They can also break when the project structure changes. Absolute imports make dependencies clearer and more reliable.
Detect relative imports (e.g., `from .module import x`). Relative imports can break if the project structure changes. Recommend using absolute imports (`from package.module import x`) for better clarity and maintainability.
Relative imports can make the code harder to understand and maintain, especially in large projects. They can also break when the project structure changes. Absolute imports make dependencies clearer and more reliable.
Side-by-side examples engineers can pattern-match during review.
from .module import MyClassfrom project.module import MyClassfrom .module import MyClassfrom project.module import MyClassFrom the same buckets as this rule.