blob: 80ad7866f74439254189c1476b530c86476212b3 [file] [log] [blame]
40 columns |
>>> Discard newlines before first import.
import 'a.dart';
<<<
import 'a.dart';
>>> Don't split after "import" even with long string.
import
'package:some/very/long/import/path.dart';
<<<
import 'package:some/very/long/import/path.dart';
>>> Keep "as" on same line.
import 'package:foo.dart'
as foo;
<<<
import 'package:foo.dart' as foo;
>>> Wrap before "as".
import 'package:some/path/foo.dart' as foo;
<<<
import 'package:some/path/foo.dart'
as foo;
>>> Keep "deferred as" on same line.
import 'foo.dart' deferred as foo;
<<<
import 'foo.dart' deferred as foo;
>>> Wrap before "deferred".
import 'package:foo/foo.dart' deferred as path;
<<<
import 'package:foo/foo.dart'
deferred as path;
>>> Don't split before "deferred" and "as".
import 'package:foo/some/path/foo.dart' deferred as very_long_identifier_path;
<<<
import 'package:foo/some/path/foo.dart'
deferred as very_long_identifier_path;
>>> Dotted identifier in configuration.
import'a'if(b . c . d)'e';
<<<
import 'a' if (b.c.d) 'e';
>>> Multiple configurations on one line.
import 'a' if (b) 'b' if (c) 'c';
<<<
import 'a' if (b) 'b' if (c) 'c';
>>> If configurations don't fit, they all split.
import 'long/import/url.dart' if (b) 'b' if (c) 'c';
<<<
import 'long/import/url.dart'
if (b) 'b'
if (c) 'c';
>>> Configurations don't split before URI.
import 'long/import/url.dart' if (config) 'very/long/configured/import/url.dart';
<<<
import 'long/import/url.dart'
if (config) 'very/long/configured/import/url.dart';
>>> Unsplit configuration with `==`.
import 'a.dart' if (b == 's') 'c';
<<<
import 'a.dart' if (b == 's') 'c';
>>> Split before `if` before `==`.
import 'some/uri.dart' if (debug == 'string') 'c';
<<<
import 'some/uri.dart'
if (debug == 'string') 'c';
>>> Split before `==` in configuration.
import 'some/uri.dart' if (config.name.debug == 'string') 'c';
<<<
import 'some/uri.dart'
if (config.name.debug ==
'string') 'c';