Skip to content

Commit 7c16cf2

Browse files
authored
Update the README. (#1713)
Link to the new configuration docs and tweak the examples.
1 parent 100db45 commit 7c16cf2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
The dart_style package defines an opinionated automated formatter for Dart code.
1+
The dart_style package defines an opinionated, [minimally configurable][config]
2+
automated formatter for Dart code.
3+
4+
[config]: https://github.com/dart-lang/dart_style/wiki/Configuration
5+
26
It replaces the whitespace in your program with what it deems to be the
37
best formatting for it. It also makes minor changes around non-semantic
48
punctuation like trailing commas and brackets in parameter lists.
@@ -16,7 +20,6 @@ code.
1620
The formatter turns code like this:
1721

1822
```dart
19-
// BEFORE formatting
2023
process = await Process.start(path.join(p.pubCacheBinPath,Platform.isWindows
2124
?'${command.first}.bat':command.first,),[...command.sublist(1),'web:0',
2225
// Allow for binding to a random available port.
@@ -28,7 +31,6 @@ Platform.environment['PATH']!,},);
2831
into:
2932

3033
```dart
31-
// AFTER formatting
3234
process = await Process.start(
3335
path.join(
3436
p.pubCacheBinPath,
@@ -105,7 +107,9 @@ Basic usage looks like this:
105107
import 'package:dart_style/dart_style.dart';
106108
107109
main() {
108-
final formatter = DartFormatter();
110+
final formatter = DartFormatter(
111+
languageVersion: DartFormatter.latestLanguageVersion,
112+
);
109113
110114
try {
111115
print(formatter.format("""

0 commit comments

Comments
 (0)