import_sorter icon indicating copy to clipboard operation
import_sorter copied to clipboard

Convert project imports to relative imports

Open gupta-shrinath opened this issue 4 years ago • 3 comments

Closes #59

  • Add conversion of project imports to relative imports for lib files.
  • Add test for convertToRelativeImports

Question: The example app has the following import but no corresponding dependency import 'package:flutter_gen/gen_l10n/translations.dart';

gupta-shrinath avatar Oct 31 '21 11:10 gupta-shrinath

Hello @gupta-shrinath. Thank you so much for sending in this PR but I am sadly archiving import_sorter (see #63). This means that your work will not be merged into import_sorter. Thank you so much for the effort in trying to improve the project.

gleich avatar Dec 07 '21 20:12 gleich

While I think this feature is useful, it is in my opinion out of the scope of import_sorter. The sole responsibility of this package should be to sort imports, not update them.

@gupta-shrinath would you instead be interested in creating a separate package for this?

I see that someone else already tried to create a solution for this:

  • https://www.reddit.com/r/FlutterDev/comments/gvj6eu/cli_tool_to_change_package_imports_to_relative/
  • https://pub.dev/packages/drtimport

vkammerer avatar Dec 07 '21 22:12 vkammerer

Thank you @gleich for the package and I understand your situation and I agree with making someone the maintainer as it is a good decision in spirit of open source. Hey @vkammerer thank you for appreciating efforts. I think this feature could be added to this package as the code is heavily dependent on existing code. Regarding making a new package for this feature I think is not worth because as you said there is already a package / tool available.

gupta-shrinath avatar Dec 08 '21 09:12 gupta-shrinath