From aeb6acc5388f5e0759390422af98b3c1c7ecf385 Mon Sep 17 00:00:00 2001 From: Peter Bwire Date: Tue, 14 May 2024 11:08:13 +0300 Subject: [PATCH] upgrade to use flutter lint instead of lints --- analysis_options.yaml | 31 +------------------------------ example/xid_example.dart | 4 +++- pubspec.yaml | 2 +- test/xid_test.dart | 4 ++-- 4 files changed, 7 insertions(+), 34 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index dee8927..a3be6b8 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,30 +1 @@ -# This file configures the static analysis results for your project (errors, -# warnings, and lints). -# -# This enables the 'recommended' set of lints from `package:lints`. -# This set helps identify many issues that may lead to problems when running -# or consuming Dart code, and enforces writing Dart using a single, idiomatic -# style and format. -# -# If you want a smaller set of lints you can change this to specify -# 'package:lints/core.yaml'. These are just the most critical lints -# (the recommended set includes the core lints). -# The core lints are also what is used by pub.dev for scoring packages. - -include: package:lints/recommended.yaml - -# Uncomment the following section to specify additional rules. - -# linter: -# rules: -# - camel_case_types - -# analyzer: -# exclude: -# - path/to/excluded/files/** - -# For more information about the core and recommended set of lints, see -# https://dart.dev/go/core-lints - -# For additional information about configuring this file, see -# https://dart.dev/guides/language/analysis-options +include: package:flutter_lints/flutter.yaml \ No newline at end of file diff --git a/example/xid_example.dart b/example/xid_example.dart index 3b53f8c..b1a6be0 100644 --- a/example/xid_example.dart +++ b/example/xid_example.dart @@ -1,6 +1,8 @@ +import 'dart:developer'; + import 'package:xid/xid.dart'; void main() { var xid = Xid(); - print('generated id: $xid'); + log('generated id: $xid'); } diff --git a/pubspec.yaml b/pubspec.yaml index 4928096..113472d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -9,6 +9,6 @@ environment: sdk: ^2.14.4 dev_dependencies: - lints: ^4.0.0 + flutter_lints: ^4.0.0 test: ^1.16.0 diff --git a/test/xid_test.dart b/test/xid_test.dart index 1467571..5997c8b 100644 --- a/test/xid_test.dart +++ b/test/xid_test.dart @@ -20,7 +20,7 @@ void main() { 0x2d, 0xc9 ]; - final idString = "9m4e2mr0ui3e8a215n4g"; + const idString = "9m4e2mr0ui3e8a215n4g"; test('Encoding works well', () { expect(base32encode(idBytes), idString.toUpperCase()); expect(Xid.fromString(idString).toBytes(), idBytes); @@ -42,7 +42,7 @@ void main() { 0x2d, 0xc9 ]; - final decodeIdString = "9m4e2mr0ui3e8a215n4g"; + const decodeIdString = "9m4e2mr0ui3e8a215n4g"; test('Decoding works well', () { expect(base32decode(decodeIdString), decodeIdBytes);