arguments-ordering
added in: 1.6.0
style
Enforces named argument order in function and constructor invocations to be the same as corresponding named parameter declaration order.
⚙️ Config
Set child-last
(default is false
) to keep the child
property last.
This option allows you to use this rule together with sort_child_properties_last.
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);