bamlab / bamlab/equatable_lint

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

Open
#9 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Dart
Stars
6
Forks
14
PR merge metrics
No merged PRs in 30d

Description

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> get inputs =>
[firstName, lastName, email];

@override
List 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?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the Dart code example in the issue and tracing how the linter determines which fields appear in the props list. The issue is done when fields included through the inputs list spread no longer produce missing-prop warnings, while genuinely omitted fields still do.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.