Skip to content

prefer_final_parameters lint error in generated_plugin_registrant.dart #101252

@DetachHead

Description

@DetachHead

Steps to Reproduce

  1. enable prefer_final_parameters in analysis_options.yaml:
    linter:
        rules:
            prefer_final_parameters: true
  2. run dart analyze

Expected results:
no error, as it's a generated file that should never trigger any lint errors

either final should be added to the registrar parameter, or the rule should be ignored like the others

Actual results:

   info - Prefer final for parameter declarations if they are not reassigned -
          lib\generated_plugin_registrant.dart:13:22 - prefer_final_parameters
Code sample
//
// Generated file. Do not edit.
//

// ignore_for_file: directives_ordering
// ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: depend_on_referenced_packages

import 'package:file_picker/_internal/file_picker_web.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';

// ignore: public_member_api_docs
void registerPlugins(Registrar registrar) {
  FilePickerWeb.registerWith(registrar);
  registrar.registerMessageHandler();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: duplicateIssue is closed as a duplicate of an existing issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions