Add dependency on pedantic; fix default parameter values (#80)
diff --git a/analysis_options.yaml b/analysis_options.yaml
index d8d47b4..b6e76e8 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -1,17 +1,14 @@
+include: package:pedantic/analysis_options.yaml
linter:
rules:
# Errors
- - avoid_empty_else
- control_flow_in_finally
- empty_statements
- test_types_in_equals
- throw_in_finally
- - valid_regexps
# Style
- annotate_overrides
- - avoid_init_to_null
- - avoid_return_types_on_setters
- await_only_futures
- camel_case_types
- comment_references
@@ -20,7 +17,5 @@
- hash_and_equals
- library_prefixes
- non_constant_identifier_names
- - prefer_is_not_empty
- slash_for_doc_comments
- type_init_formals
- - unrelated_type_equality_checks
diff --git a/lib/src/observable_list.dart b/lib/src/observable_list.dart
index d91bb68..b7bd916 100644
--- a/lib/src/observable_list.dart
+++ b/lib/src/observable_list.dart
@@ -299,7 +299,7 @@
void _notifyListChange(
int index, {
List<E> removed,
- int addedCount: 0,
+ int addedCount = 0,
}) {
if (!hasListObservers) return;
if (_listRecords == null) {
diff --git a/lib/src/records/list_change_record.dart b/lib/src/records/list_change_record.dart
index 321a949..beb7645 100644
--- a/lib/src/records/list_change_record.dart
+++ b/lib/src/records/list_change_record.dart
@@ -28,7 +28,7 @@
List<E> object,
int index, {
List<E> removed,
- int addedCount: 0,
+ int addedCount = 0,
}) {
return new ListChangeRecord._(
object, index, removed ?? new UnmodifiableListView([]), addedCount);
diff --git a/lib/src/to_observable.dart b/lib/src/to_observable.dart
index c1ddc96..d331913 100644
--- a/lib/src/to_observable.dart
+++ b/lib/src/to_observable.dart
@@ -27,7 +27,7 @@
/// If a conversion is peformed, mutations are only observed to the result of
/// this function. Changing the original collection will not affect it.
// TODO(jmesserly): ObservableSet?
-toObservable(dynamic value, {bool deep: true}) =>
+toObservable(dynamic value, {bool deep = true}) =>
deep ? _toObservableDeep(value) : _toObservableShallow(value);
dynamic _toObservableShallow(dynamic value) {
diff --git a/pubspec.yaml b/pubspec.yaml
index 2bd5882..14b0cc8 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -15,4 +15,5 @@
build_test: ^0.10.0
build_web_compilers: '>=0.3.1 <2.0.0'
dart_style: ^1.0.9
+ pedantic: '^1.4.0'
test: ^1.3.0
diff --git a/test/observable_list_test.dart b/test/observable_list_test.dart
index 634d9e8..fee070d 100644
--- a/test/observable_list_test.dart
+++ b/test/observable_list_test.dart
@@ -344,5 +344,5 @@
PropertyChangeRecord<int> _lengthChange(int oldValue, int newValue) =>
new PropertyChangeRecord<int>(list, #length, oldValue, newValue);
-_change(int index, {List removed: const [], int addedCount: 0}) =>
+_change(int index, {List removed = const [], int addedCount = 0}) =>
new ListChangeRecord(list, index, removed: removed, addedCount: addedCount);