Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update old linter site links #3186

Merged
merged 2 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion working/1610 - override/proposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 3 additions & 3 deletions working/1661 - unawaited futures/proposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Author: [email protected]<br>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.

Expand Down Expand Up @@ -92,7 +92,7 @@ Future<int> 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.
>
Expand Down Expand Up @@ -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 `<expressionStatement>`,
* *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.)*

Expand Down