Browse Source

feat(neon,neon_notes,neon_lints): enable stricter rules

Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
pull/701/head
Nikolas Rimikis 1 year ago
parent
commit
6cd3e870ac
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 2
      packages/neon/neon/lib/src/settings/models/storage.dart
  2. 2
      packages/neon/neon/lib/src/utils/global.dart
  3. 2
      packages/neon/neon/lib/src/utils/push_utils.dart
  4. 2
      packages/neon/neon_notes/lib/utils/category_color.dart
  5. 4
      packages/neon_lints/lib/dart.yaml
  6. 2
      packages/neon_lints/lint_maker.yaml

2
packages/neon/neon/lib/src/settings/models/storage.dart

@ -38,6 +38,8 @@ enum StorageKeys implements Storable {
@internal @internal
final class NeonStorage { final class NeonStorage {
const NeonStorage._();
/// Shared preferences instance. /// Shared preferences instance.
/// ///
/// Use [database] to access it. /// Use [database] to access it.

2
packages/neon/neon/lib/src/utils/global.dart

@ -3,6 +3,8 @@ import 'package:neon/src/models/push_notification.dart';
@internal @internal
class Global { class Global {
const Global._();
static Function(String accountID)? onPushNotificationReceived; static Function(String accountID)? onPushNotificationReceived;
static Function(PushNotification notification)? onPushNotificationClicked; static Function(PushNotification notification)? onPushNotificationClicked;
} }

2
packages/neon/neon/lib/src/utils/push_utils.dart

@ -21,6 +21,8 @@ import 'package:nextcloud/nextcloud.dart';
@internal @internal
@immutable @immutable
class PushUtils { class PushUtils {
const PushUtils._();
static Future<RSAKeypair> loadRSAKeypair() async { static Future<RSAKeypair> loadRSAKeypair() async {
const storage = AppStorage(StorageKeys.notifications); const storage = AppStorage(StorageKeys.notifications);
const keyDevicePrivateKey = 'device-private-key'; const keyDevicePrivateKey = 'device-private-key';

2
packages/neon/neon_notes/lib/utils/category_color.dart

@ -1,6 +1,8 @@
part of '../neon_notes.dart'; part of '../neon_notes.dart';
class NotesCategoryColor { class NotesCategoryColor {
const NotesCategoryColor._();
static final Map<String, Color> _colors = {}; static final Map<String, Color> _colors = {};
static Color compute(final String category) { static Color compute(final String category) {

4
packages/neon_lints/lib/dart.yaml

@ -18,8 +18,8 @@ linter:
avoid_annotating_with_dynamic: false avoid_annotating_with_dynamic: false
avoid_bool_literals_in_conditional_expressions: true avoid_bool_literals_in_conditional_expressions: true
avoid_catches_without_on_clauses: false avoid_catches_without_on_clauses: false
avoid_catching_errors: false avoid_catching_errors: true
avoid_classes_with_only_static_members: false avoid_classes_with_only_static_members: true
avoid_double_and_int_checks: true avoid_double_and_int_checks: true
avoid_dynamic_calls: true avoid_dynamic_calls: true
avoid_empty_else: true avoid_empty_else: true

2
packages/neon_lints/lint_maker.yaml

@ -6,8 +6,6 @@ dart:
- avoid_annotating_with_dynamic - avoid_annotating_with_dynamic
- avoid_as - avoid_as
- avoid_catches_without_on_clauses - avoid_catches_without_on_clauses
- avoid_catching_errors
- avoid_classes_with_only_static_members
- avoid_final_parameters - avoid_final_parameters
- avoid_print - avoid_print
- diagnostic_describe_all_properties - diagnostic_describe_all_properties

Loading…
Cancel
Save