Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
The dart_style package defines an opinionated automated formatter for Dart code.
The dart_style package defines an opinionated, [minimally configurable][config]
automated formatter for Dart code.

[config]: https://github.com/dart-lang/dart_style/wiki/Configuration

It replaces the whitespace in your program with what it deems to be the
best formatting for it. It also makes minor changes around non-semantic
punctuation like trailing commas and brackets in parameter lists.
Expand All @@ -16,7 +20,6 @@ code.
The formatter turns code like this:

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

```dart
// AFTER formatting
process = await Process.start(
path.join(
p.pubCacheBinPath,
Expand Down Expand Up @@ -105,7 +107,9 @@ Basic usage looks like this:
import 'package:dart_style/dart_style.dart';

main() {
final formatter = DartFormatter();
final formatter = DartFormatter(
languageVersion: DartFormatter.latestLanguageVersion,
);

try {
print(formatter.format("""
Expand Down