diff --git a/analysis_options.yaml b/analysis_options.yaml index 6d32d92..ff53a8b 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,9 +1,8 @@ # Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. -include: package:pedantic/analysis_options.1.9.0.yaml +include: package:lints/recommended.yaml + analyzer: - errors: - annotate_overrides: ignore - prefer_single_quotes: ignore - use_function_type_syntax_for_parameters: ignore \ No newline at end of file + strong-mode: + implicit-casts: false diff --git a/lib/override.dart b/lib/override.dart index bb54cc0..14042b1 100644 --- a/lib/override.dart +++ b/lib/override.dart @@ -19,7 +19,8 @@ class OperatingSystem { /// from known platform specific libraries, /// but can be overridden using functionality from the /// `osid_override.dart` library. - static OperatingSystem get current => Zone.current[#_os] ?? platformOS; + static OperatingSystem get current => + Zone.current[#_os] as OperatingSystem? ?? platformOS; /// A string representing the operating system or platform. final String id; @@ -94,6 +95,7 @@ extension OperatingSystemGetters on OperatingSystem { /// /// This override affects the `operatingSystem` and `version` /// exported by `package:osid/osid.dart`. -R overrideOperatingSystem(OperatingSystem operatingSystem, R body()) { +R overrideOperatingSystem( + OperatingSystem operatingSystem, R Function() body) { return runZoned(body, zoneValues: {#_os: operatingSystem}); } diff --git a/pubspec.yaml b/pubspec.yaml index fa12eb4..bfc2959 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,6 +4,7 @@ description: Platform independent OS detection. homepage: https://github.com/dart-lang/os_detect environment: sdk: '>=2.12.0 <3.0.0' + dev_dependencies: - pedantic: ^1.11.0 + lints: ^1.0.0 test: ^1.16.8