avoid_unused_parameters

SeverityQuick FixOptions
Warning

Details

DO avoid unused parameters.

Unused parameters should be removed to avoid confusion.

Bad
void log(String a, String b) {
  print(a);
}
Good
void log(String a) {
  print(a);
}

Usage

To enable the avoid_unused_parameters rule, add avoid_unused_parameters under custom_lint > rules in your analysis_options.yaml file:

custom_lint:
  rules:
    - avoid_unused_parameters

Options

OptionTypeDescriptionDefault Value
ignored_parametersList<String>A list of parameters to ignore.[]

To configure the list of ignored parameters, add a list of strings to the ignored_parameters option:

custom_lint:
  rules:
    - avoid_unused_parameters:
      ignored_parameters: ['ref']