parameters-ordering
- Group
- Style
- Path
lint/style/parameters-ordering- Default
- Off, opt in
- Origin
- Falcon
- Rule
- 309 of 512
Requires named parameters to follow the explicitly configured alphabetical order.
Positional parameters are excluded. Set order to ascending or descending;
without a valid order this rule does nothing.
Invalid
void top({int zebra = 0, int alpha = 0}) {}
class Example {
Example({int zebra = 0, int alpha = 0});
void method({int zebra = 0, int alpha = 0}) {}
}
void closures() {
final callback = ({int zebra = 0, int alpha = 0}) {};
void local({int zebra = 0, int alpha = 0}) {}
}
typedef Callback = void Function({int zebra, int alpha});void top({int zebra = 0, int alpha = 0}) {}class Example { Example({int zebra = 0, int alpha = 0}); Example({int zebra = 0, int alpha = 0}); void method({int zebra = 0, int alpha = 0}) {}void closures() { final callback = ({int zebra = 0, int alpha = 0}) {}; final callback = ({int zebra = 0, int alpha = 0}) {}; void local({int zebra = 0, int alpha = 0}) {} typedef Callback = void Function({int zebra, int alpha});Valid
void named({int alpha = 0, int zebra = 0}) {}
void positional(int zebra, int alpha) {}
void optional([int zebra = 0, int alpha = 0]) {}
void mixed(int zebra, int alpha, {int beta = 0, int gamma = 0}) {}
void single({int zebra = 0}) {}
class Example {
final int alpha;
final int zebra;
Example({this.alpha = 0, this.zebra = 0});
}
typedef Callback = void Function({int alpha, int zebra});Configure parameters-ordering
Set its severity in falcon.json. See the configuration guide.
{
"linter": {
"rules": {
"style": {
"parameters-ordering": "error"
}
}
}
}Or silence one occurrence with a suppression comment; the reason is required.
// falcon-ignore lint/style/parameters-ordering: <reason>More style rules
- pattern-fields-ordering
Flags named object and record pattern fields that violate the configured order.
- prefer-adjacent-string-concatenation
prefer_adjacent_string_concatenationrecommendedFlags two string literals joined with the
+operator. - prefer-align-over-containerflutter
Prefers
Alignover aContainerused only foralignment. - prefer-asserts-in-initializer-lists
prefer_asserts_in_initializer_listsFlags leading constructor-body asserts that could live in the initializer list.
- prefer-asserts-with-message
prefer_asserts_with_messageFlags
assertstatements and assert initializers that have no message. - prefer-async-await
prefer-async-awaitFlags
.then(...)future chains that should useasync/await. - prefer-async-callback
prefer_async_callbackflutterFlags the type
Future<void> Function()in favor of Flutter'sAsyncCallback. - prefer-bloc-event-suffixbloc
Enforce the package-confirmed Bloc convention.