arguments-ordering
added in: 5.1.0
style
Enforces named argument order in function and constructor invocations to be the same as corresponding named parameter declaration order.
The rule can be used together with sort_child_properties_last rule by setting child-last: true
in rule configuration.
⚙️ Config example
dart_code_metrics:
...
rules:
...
- arguments-ordering:
child-last: true
Example
❌ Bad:
Person buildPerson({ String name, String surname, String age });
// LINT
final person = buildPerson(age: 42, surname: 'The Pooh', name: 'Winnie');
✅ Good:
Person buildPerson({ String name, String surname, String age });
final person = buildPerson(name: 'Winnie', surname: 'The Pooh', age: 42);