Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
devj3ns opened this issue Apr 27, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@devj3ns
Copy link

devj3ns commented Apr 27, 2024

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?

@devj3ns devj3ns added the bug Something isn't working label Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant