From 4b063a0aaa3ae0c1b813ea392fb05dfddc9e1cb5 Mon Sep 17 00:00:00 2001 From: Parker Lougheed Date: Sat, 1 Jul 2023 20:31:00 -0500 Subject: [PATCH] Update old linter site links --- working/1610 - override/proposal.md | 2 +- working/1661 - unawaited futures/proposal.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/working/1610 - override/proposal.md b/working/1610 - override/proposal.md index 478f3924c8..0dd7d9465b 100644 --- a/working/1610 - override/proposal.md +++ b/working/1610 - override/proposal.md @@ -2,7 +2,7 @@ ## Background and motivation -Dart currently has an [`@override`](https://api.dart.dev/stable/2.10.4/dart-core/override-constant.html) annotation declared in the `dart:core` library. It is used to mark that an instance method is intended to override a super-interface declaration. The analyzer warns if an annotated member declaration has no super-interface declaration with the same name. If the [annotate_overrides](https://dart-lang.github.io/linter/lints/annotate_overrides.html) lint is enabled, the analyzer also warns if a non-annotated member has a super-interface declaration with the same name. +Dart currently has an [`@override`](https://api.dart.dev/stable/2.10.4/dart-core/override-constant.html) annotation declared in the `dart:core` library. It is used to mark that an instance method is intended to override a super-interface declaration. The analyzer warns if an annotated member declaration has no super-interface declaration with the same name. If the [annotate_overrides](https://dart.dev/lints/annotate_overrides) lint is enabled, the analyzer also warns if a non-annotated member has a super-interface declaration with the same name. The purpose of the annotation is to catch errors where a method name is mistyped or a super-interface member changes name. The lint is there to encourage users to use the annotation. diff --git a/working/1661 - unawaited futures/proposal.md b/working/1661 - unawaited futures/proposal.md index 6ff3acabec..9f02453f1b 100644 --- a/working/1661 - unawaited futures/proposal.md +++ b/working/1661 - unawaited futures/proposal.md @@ -2,7 +2,7 @@ Author: lrn@google.com
Version: 0.2 -The Dart SDK now provides `package:lints` with recommended lints for new projects. This includes the [`unawaited_futures`](https://dart-lang.github.io/linter/lints/unawaited_futures.html) lint. The lint warns if a `Future` value is not awaited, and is seemingly discarded, inside an `async` or `async*` function. Basically, it tries to avoid that you mistakenly forget to await a future which should have been awaited. +The Dart SDK now provides `package:lints` with recommended lints for new projects. This includes the [`unawaited_futures`](https://dart.dev/lints/unawaited_futures) lint. The lint warns if a `Future` value is not awaited, and is seemingly discarded, inside an `async` or `async*` function. Basically, it tries to avoid that you mistakenly forget to await a future which should have been awaited. The lint is unique in that it has a large number of false positives (33K+ in internal Google code), but that the errors that it avoids are so valuable that it's worth adding extra code at every false positive. Currently all false positives call a method from `package:pedantic` as `unawaited(futureExpression)`. The function ignores its argument and returns `void`, which is sufficient to disable the lint. @@ -92,7 +92,7 @@ Future foo() async { ### Await only futures -Another recommended lint is [`await_only_futures`](https://dart-lang.github.io/linter/lints/await_only_futures.html), which causes a warning if you `await` an expression with a type which doesn't suggest that it could be a future. +Another recommended lint is [`await_only_futures`](https://dart.dev/lints/await_only_futures), which causes a warning if you `await` an expression with a type which doesn't suggest that it could be a future. > **AVOID** using await on anything which is not a future. > @@ -141,7 +141,7 @@ Finally, we make it a compile-time error if an expression *e* has a static type * *e* is the expression of an ``, * *e* is an initializer expression or increment expression of a C-style `for` loop (`for (here;…;here, here) …`). -* *e* occurs in a position which expects `void`. *(This would also trigger the [`void_checks`](https://dart-lang.github.io/linter/lints/void_checks.html) lint.)* +* *e* occurs in a position which expects `void`. *(This would also trigger the [`void_checks`](https://dart.dev/lints/void_checks) lint.)* and we recommend using either `await` or `unawaited` to avoid such an error. *(We can extend that to any expression "in tail position" of those expressions as well.)*