Lints to prefer project root path import #60667
Labels
area-devexp
For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.
devexp-linter
Issues with the analyzer's support for the linter package
I was wondering if you'd consider adding a new lint rule to package:lints that would encourage the use of project root path imports over relative or package imports.
Just to illustrate, currently Dart supports these import styles:
1. Relative import
2. Package import
3. Project root import
I personally find the project root imports (
/core/logger.dart
) to be quite beneficial for code clarity and maintainability, especially in larger projects. They make it immediately clear where a file resides within the project structure, regardless of the current file's location.Would the team be open to the idea of a lint rule that suggests (and ideally provides a dart fix for) preferring these project root path imports?
If you think this is something worth exploring and you'd like some help with it, I'd be happy to volunteer some time to contribute! 🙌🏼
Thanks for considering this! 🙏
The text was updated successfully, but these errors were encountered: