Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

sort_constructors_first shows improper suggestions in Flutter #26

Closed
ThinkDigitalSoftware opened this issue Jul 5, 2019 · 6 comments
Closed

Comments

@ThinkDigitalSoftware
Copy link

const ValueSlider(
      {Key key,
      @required this.onChanged,
      @required this.labels,
      @required this.values,
      @required this.type,
      this.status = AttendanceStatus.none})
      : super(key: key);

this is caught by the linter even though Flutter puts Key first by default.

@a14n
Copy link
Contributor

a14n commented Jul 5, 2019

I don't understand what you mean. sort_constructors_first ensures you sort constructor declarations before other members.

@ThinkDigitalSoftware
Copy link
Author

@a14n Right. It catches correctly, however, I've read in certain linting rules that they have conditions when they're run and when they aren't. It wouldn't be proper for a warning to suggest that you move away from Google suggested practices

@bwilkerson
Copy link

We don't limit the lints supported by the linter to all be self-consistent. We won't enable inconsistent lints in the pedantic rule set, but don't guarantee that all of the supported lints will be consistent with these rules.

@ThinkDigitalSoftware
Copy link
Author

OK, So it's probably best to disable the rule then you're saying?

@bwilkerson
Copy link

What's "best" depends on what your goal is. But if your goal is to follow all of the Flutter recommended rules and all the rules in pedantic, then recognize that those lists are controlled by two different groups and they don't always agree about matters of style. I suspect that in some cases you're going to have to decide for yourself which rules you want to follow and which to ignore.

@ThinkDigitalSoftware
Copy link
Author

Makes sense. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants