combinators-ordering

Same as combinators_ordering in Dart lints

Group
Style
Path
lint/style/combinators-ordering
Default
Off, opt in
Origin
Dart lints
Rule
206 of 512

Flags show/hide combinators whose names are not sorted alphabetically.

Sorted combinator lists are easier to scan and produce smaller diffs when a name is added. Each show or hide clause on an import or export is checked on its own; the clause is reported when its names are out of order:

import 'a.dart' show B, A;        // flagged
import 'a.dart' show A, B hide D, C; // `hide D, C` flagged
import 'a.dart' show A, B;

Invalid

example.dartdart
// Combinator names must be sorted alphabetically.
import 'dart:async' show Timer, Future;
import 'dart:collection' hide Queue, LinkedList;
import 'dart:math' show max, min, Random;
import 'dart:convert' show utf8, json hide base64;
export 'dart:io' show stdout, File;
export 'dart:typed_data' hide Uint8List, ByteData;

void main() {}
Sort combinator names alphabetically.
1// Combinator names must be sorted alphabetically.
2import 'dart:async' show Timer, Future;
Sort combinator names alphabetically.
2import 'dart:async' show Timer, Future;
3import 'dart:collection' hide Queue, LinkedList;
Sort combinator names alphabetically.
3import 'dart:collection' hide Queue, LinkedList;
4import 'dart:math' show max, min, Random;
Sort combinator names alphabetically.
4import 'dart:math' show max, min, Random;
5import 'dart:convert' show utf8, json hide base64;
Sort combinator names alphabetically.
5import 'dart:convert' show utf8, json hide base64;
6export 'dart:io' show stdout, File;
Sort combinator names alphabetically.
6export 'dart:io' show stdout, File;
7export 'dart:typed_data' hide Uint8List, ByteData;

Valid

example.dartdart
// Sorted combinators, single names, and directives without combinators.
import 'dart:async' show Future, Timer;
import 'dart:collection' hide LinkedList, Queue;
import 'dart:math' show Random, max, min;
import 'dart:convert' show json, utf8 hide base64;
import 'dart:developer';
export 'dart:io' show File, stdout;
export 'dart:typed_data' hide ByteData;

void main() {}

Configure combinators-ordering

Set its severity in falcon.json. See the configuration guide.

falcon.jsonjson
{
  "linter": {
    "rules": {
      "style": {
        "combinators-ordering": "error"
      }
    }
  }
}

Or silence one occurrence with a suppression comment; the reason is required.

example.dartdart
// falcon-ignore lint/style/combinators-ordering: <reason>