VeryGoodOpenSource/very_good_analysis

Include the `prefer_relative_imports`

ffgiraldez opened this issue ยท 2 comments

According to Dart guidelines, prefer_relative_imports prefer relative imports inside lib folder, this request is to enable it by default in this package of tools

Hi @ffgiraldez ๐Ÿ‘‹
Thanks for opening an issue!

We made the decision to prefer package imports because:

  • Package imports make it easier to move files/directories without needing to adjust imports
  • By using package imports within lib we have a consistent imports style everywhere and you don't need to think about when to use one or the other.

The reasoning provided for relative imports in the guidelines is "they're shorter" which doesn't seem to outweigh the benefits of using package imports consistently listed above in my opinion.

If you prefer relative imports feel free to override the rule in very_good_analysis:

include: package:very_good_analysis/analysis_options.yaml
linter:
  rules:
    prefer_relative_imports: true

Let me know what you think and hope that helps ๐Ÿ‘

thanks