tenhobi/effective_dart

conflicting advice for imports?

pq opened this issue · 2 comments

pq commented

Hi!

Looking at advice for imports, it looks like we're suggesting conflicting rules:

- avoid_relative_lib_imports # prefer
- prefer_relative_imports # prefer

Or maybe the docs need to be updated?

Hi, those are not conflicting rules, actually. :-) I have also explored that. The naming is quite confising.

http://dart-lang.github.io/linter/lints/avoid_relative_lib_imports.html

This says "don't use ../lib/ in your relative imports".

http://dart-lang.github.io/linter/lints/prefer_relative_imports.html

This says "prefer relative imports over absolute ones".


Its both part of https://dart.dev/guides/language/effective-dart/usage#prefer-relative-paths-when-importing-libraries-within-your-own-packages-lib-directory

pq commented

Looks like we could make the docs a little clearer. Thanks!