Closed FMorschel closed 3 weeks ago
It does seem reasonable to me that the lint should check part
directives.
Chatting w/ @jakemac53, sorting parts is not something we can safely do in a world with augmentations because then order matters.
Because of that, I don't think we want to go ahead with this after all.
I'm not familiar with augmentations yet, but can't the analyzer see if this is being used to apply the suggestion only when it is not? Or would it be weird to do so?
Fwiw, it is possible to determine when it is safe to do. But, implementing that might not be worth while (or spending the compute on it). It is safe if any of the following are true:
But, it doesn't feel right for this lint to be computing all of that, when today it can operate on just a single parsed AST.
Thats understandable. Could you please link here some docs for augmentations so I can see what you are talking about? And if there is nothing else you'd like to discuss here we can close this issue.
Describe the issue There is the
directives_ordering
. It does not apply topart
, onlyimport
andexport
.To Reproduce
directives_ordering
is being used:a.dart
andb.dart
insidelib
.part
ofmain.dart
:Expected behavior To trigger
directives_ordering
lint.Additional context If you disagree with adding this rule to
directives_ordering
, then maybe we could create a new linter to that.