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

Sort named constructor parameters alphabetically #351

Closed
ikurek opened this issue Mar 22, 2022 · 2 comments · Fixed by #363
Closed

Sort named constructor parameters alphabetically #351

ikurek opened this issue Mar 22, 2022 · 2 comments · Fixed by #363
Assignees
Labels
code-quality Affects the developer experience when working in our codebase.

Comments

@ikurek
Copy link
Contributor

ikurek commented Mar 22, 2022

Some classes like {{ClientOptions}} or {{TokenDetails}} use named constructor parameters, but currently they're not put in any logical order. It may be good to keep named parameters of constructors in a specific order, for example sorted alphabetically. This would add some consistency across the codebase

I've checked if there's a lint rule available for that, but there doesn't seem to be any static analysis solution available

@ikurek ikurek added the code-quality Affects the developer experience when working in our codebase. label Mar 22, 2022
@QuintinWillison
Copy link
Contributor

I wonder if we could write our own linter for this. 🤔

@ikurek
Copy link
Contributor Author

ikurek commented Mar 22, 2022

@QuintinWillison Sadly, Dart linter doesn't support custom rules yet, there's a really long discussion about that here dart-lang/linter#697. We would need to write the linter from scratch 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-quality Affects the developer experience when working in our codebase.
Development

Successfully merging a pull request may close this issue.

2 participants