Skip to content

False positive when some props are spreaded into props from another list #9

@jhb-dev

Description

@jhb-dev

Hey, first of all I really like this package, thanks for creating it!

When using this linter with flutter_bloc and formz I run into a false positive when some props are spreaded from another list.

Code Example:

final class FormState extends Equatable with FormzMixin {
  const FormState ({
    this.firstName = const NameInput.pure(),
    this.lastName = const NameInput.pure(),
    this.email = const EmailInput.pure(),
    this.formValidationState = FormValidationState.unknown,
  });

  // Form inputs:
  final NameInput firstName;
  final NameInput lastName;
  final EmailInput email;

  // Form metadata:
  final FormValidationState formValidationState;

  @override
  List<FormzInput<dynamic, dynamic>> get inputs =>
      [firstName, lastName, email];

  @override
  List<Object?> get props => [
        ...inputs,
        status,
      ];

With this code the linter warns me that the three input fields are missing inside the props list. But technically, they are included because of the list spread.

Is there a way the linter can check this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions