Summary
Add detection of implicit relative imports equivalent to Basedpyright's reportImplicitRelativeImport rule.
Documentation:
https://docs.basedpyright.com/latest/benefits-over-pyright/new-diagnostic-rules/#reportimplicitrelativeimport
Existing Pyrefly handling
Pyrefly recognizes reportImplicitRelativeImport while migrating Pyright
configuration and maps it to missing-import:
46dacdd
This issue is for first-class detection of the more specific implicit-relative-
import condition rather than treating it solely as a general missing import.
Desired behavior
- Detect an unqualified import that cannot be resolved through the normal absolute import roots but resolves only by searching from the importing file’s directory upward toward the configured execution root.
- Explain that the import may fail when the file is imported as part of a package.
- Suggest either an explicit relative import or the full absolute package path.
- Do not report imports that resolve normally through configured import roots, search paths, the standard library, or installed packages.
- Provide a dedicated, independently configurable diagnostic such as implicit-relative-import.
- Define an appropriate default severity; Basedpyright enables the equivalent diagnostic as an error in its default recommended mode.
Summary
Add detection of implicit relative imports equivalent to Basedpyright's
reportImplicitRelativeImportrule.Documentation:
https://docs.basedpyright.com/latest/benefits-over-pyright/new-diagnostic-rules/#reportimplicitrelativeimport
Existing Pyrefly handling
Pyrefly recognizes
reportImplicitRelativeImportwhile migrating Pyrightconfiguration and maps it to
missing-import:46dacdd
This issue is for first-class detection of the more specific implicit-relative-
import condition rather than treating it solely as a general missing import.
Desired behavior