dart-code-metrics
dart-code-metrics copied to clipboard
[New rule] avoid export from another package
Please describe what the rule should do: avoid export from another package If your rule is inspired by other please provide link to it:
What category of rule is this? (place an "X" next to just one item)
[ X] Warns about a potential error (problem) [ ] Suggests an alternate way of doing something (suggestion) [ ] Other (please specify:)
Provide 2-3 code examples that this rule will warn about (it will be better if you can provide both good and bad examples):
For example current package has name current_package.
export 'package:another_package/src/math.dart'; //<--- Bad
export 'package:current_package/src/some_lib_1.dart';
export 'package:current_package/src/some_lib_2.dart';
Are you willing to submit a pull request to implement this rule? may be
@andrewst could you explain the motivation behind the rule? It seems valid to reexport code from external packages (allows to hide them from your package users).
@incendial I think is bad practices, because you can using code from another package, however you has't direct dependence for this package.
@andrewst why would you care about that? All those packages are external and their implementation is hidden for you as an end user. It seems strange to disable this flexible ability to reexport.
@incendial This is just a rule, whether to use it or not is up to you.