Open Hixie opened 5 years ago
For example, WidgetInspectorService.initServiceExtensions
has an argument whose type is private, which makes no sense.
WidgetInspectorService.initServiceExtensions
fyi @jacob314
I have a significant start at this. I've wanted it for the analyzer API for a long time, so I started implementing it last fall. Then I got busy and never returned to it. Nevertheless, a significant portion of the work has been done if someone wants to finish it.
Fantastic! Maybe push it up on a branch in case anyone wants to jump?
I dusted off the code that I have and updated it a bit. The question that I have is exactly what this lint should catch.
It seems fairly obvious to me that we want to flag when a private type is used as either a return type or parameter type for a public function/method (including getters and setters induced by a public field). But do we want to also flag private types being used as a supertype of a public type? How about as the bounds of a type parameter on a public class or function?
A publicly-accessible method with an argument whose type is private, or a publicly-accessible field with a type that is private, or a method with a return value that is private, or similarly with getters/setters or other such things, should be flagged by the linter.
See also dart-lang/sdk#57951.