unnecessary_underscores
Unnecessary underscores can be removed.
This rule is currently experimental and not yet available in a stable SDK.
Details
#AVOID using multiple underscores when a single wildcard will do.
BAD:
dart
void function(int __) { }
GOOD:
dart
void function(int _) { }
Usage
#To enable the unnecessary_underscores
rule, add unnecessary_underscores
under linter > rules in your analysis_options.yaml
file:
analysis_options.yaml
yaml
linter:
rules:
- unnecessary_underscores
Unless stated otherwise, the documentation on this site reflects Dart 3.6.0. Page last updated on 2024-07-03. View source or report an issue.