googlearchive / pedantic

How to get the most value from Dart static analysis
https://pub.dev/packages/pedantic
BSD 3-Clause "New" or "Revised" License
324 stars 56 forks source link

sort_constructors_first gives false positives for factories #85

Closed buttonsrtoys closed 3 years ago

buttonsrtoys commented 3 years ago

class Sample { Sample(this.answer); int answer; factory Sample.fortyTwo() => Sample(42); // <- "Sort constructor declarations before other members" }

bwilkerson commented 3 years ago

According to the specification, factories are constructors, they just aren't generative constructors. I believe that the lint is working as intended.

davidmorgan commented 3 years ago

Please file linter things at the linter depot, pedantic is just about which lints to enable :)

https://github.com/dart-lang/linter