Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.

Commit 2f67251

Browse files
authored
docs: Improve readability of no-equal-then-else description (#739)
1 parent d7eeee9 commit 2f67251

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

website/docs/rules/common/no-equal-then-else.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,38 +17,38 @@ Warns when if statement has equal then and else statements or conditional expres
1717
Bad:
1818

1919
```dart
20-
final value1 = 1;
21-
final value2 = 2;
20+
final firstValue = 1;
21+
final secondValue = 2;
2222
2323
...
2424
2525
// LINT
2626
if (condition) {
27-
result = value1;
27+
result = firstValue;
2828
} else {
29-
result = value1;
29+
result = firstValue;
3030
}
3131
3232
...
3333
34-
result = condition ? value1 : value1; // LINT
34+
result = condition ? firstValue : firstValue; // LINT
3535
```
3636

3737
Good:
3838

3939
```dart
40-
final value1 = 1;
41-
final value2 = 2;
40+
final firstValue = 1;
41+
final secondValue = 2;
4242
4343
...
4444
4545
if (condition) {
46-
result = value1;
46+
result = firstValue;
4747
} else {
48-
result = value2;
48+
result = secondValue;
4949
}
5050
5151
...
5252
53-
result = condition ? value1 : value2;
53+
result = condition ? firstValue : secondValue;
5454
```

0 commit comments

Comments
 (0)