-
Notifications
You must be signed in to change notification settings - Fork 1.8k
proposal: specify_parameter_names #59047
Copy link
Copy link
Open
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.customer-flutterdevexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelinter-lint-proposallinter-status-pendingtype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Metadata
Metadata
Assignees
Labels
P3A lower priority bug or feature requestA lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.customer-flutterdevexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelinter-lint-proposallinter-status-pendingtype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
specify_parameter_names
Description
Specify names for the parameters of Function types.
Details
Dart allows omitting the name of parameters in function types:
While that is legal, it degrades the experience of anyone using this widget with code completion in IDEs:
Since no names were given, unhelpful names are generated. This can be avoided by giving the parameters proper names:
The proposed lint would enforce that function types must always contain names for the parameters to improve the experience for anyone using IDE and code completion.
See also flutter/flutter#119877.
Kind
Maybe style? It's kinda a usability thing when people work with IDEs, though.
Bad Examples
Good Examples