Skip to content

Commit fd9665b

Browse files
Change effective dart rule about line length (#6404)
Fixes #6142
1 parent 9306a58 commit fd9665b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/content/effective-dart/style.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,8 @@ formatting the code by hand and trying to make it more readable. Think of
454454
`dart format` as a partnership where you work together, sometimes iteratively,
455455
to produce beautiful code.
456456

457-
458-
### AVOID lines longer than 80 characters
457+
<a id="avoid-lines-longer-than-80-characters"></a>
458+
### PREFER lines 80 characters or fewer
459459

460460
{% render 'linter-rule-mention.md', rules:'lines_longer_than_80_chars' %}
461461

@@ -469,7 +469,8 @@ compact. The main offender is usually `VeryLongCamelCaseClassNames`. Ask
469469
yourself, "Does each word in that type name tell me something critical or
470470
prevent a name collision?" If not, consider omitting it.
471471

472-
Note that `dart format` does 99% of this for you, but the last 1% is you.
472+
Note that `dart format` defaults to 80 characters or fewer, though you can
473+
[configure][] the default.
473474
It does not split long string literals to fit in 80 columns,
474475
so you have to do that manually.
475476

@@ -481,6 +482,8 @@ an import or export), it may remain whole even if it causes the line to go over
481482
because newlines are significant inside the string and splitting the lines into
482483
shorter ones can alter the program.
483484

485+
[configure]: /tools/dart-format#configuring-formatter-page-width
486+
484487
<a id="do-use-curly-braces-for-all-flow-control-structures"></a>
485488
### DO use curly braces for all flow control statements
486489

0 commit comments

Comments
 (0)