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

Add more linter rules #47

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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: 2 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ analyzer:
- custom_lint
linter:
rules:
- avoid_dynamic_calls
- avoid_void_async
- comment_references
- directives_ordering
- prefer_relative_imports
- sort_pub_dependencies
2 changes: 2 additions & 0 deletions lib/services/api/api_client.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: avoid_dynamic_calls

import 'package:dio/dio.dart';

import '../../features/auth/models/login.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/services/api/mock/mocked_api_client_repository.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ignore_for_file: avoid_dynamic_calls

part of 'mocked_api_client.dart';

typedef _ResponseData = Map<String, Object?>;
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/hooks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ typedef AsyncTask = ({
bool hasError,
});

/// Creates a hook that provides a [snapshot] of the current asynchronous task passed
/// to [pending] and a [hasError] value.
/// Creates a hook that provides an [AsyncSnapshot] of the pending asynchronous
/// task and an error flag.
AsyncTask useAsyncTask() {
final pending = useState<Future<void>?>(null);
final snapshot = useFuture(pending.value);
Expand Down