Contents

unnecessary_underscores

Contents

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