diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cf1f64..5ebe8ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ Assignment to `Equality` with a nullable type is still allowed because of covariance. The `equals` and `hash` methods continue to accept nullable arguments. - +* Enable the `avoid_dynamic_calls` lint. ## 1.15.0 diff --git a/analysis_options.yaml b/analysis_options.yaml index d12202a..a7e3292 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,6 +1,9 @@ include: package:lints/recommended.yaml + linter: rules: + - avoid_dynamic_calls + # Errors - test_types_in_equals - throw_in_finally diff --git a/lib/src/equality.dart b/lib/src/equality.dart index 8f2d7d8..a0db983 100644 --- a/lib/src/equality.dart +++ b/lib/src/equality.dart @@ -212,7 +212,7 @@ abstract class _UnorderedEquality> bool equals(T? elements1, T? elements2) { if (identical(elements1, elements2)) return true; if (elements1 == null || elements2 == null) return false; - var counts = HashMap( + var counts = HashMap( equals: _elementEquality.equals, hashCode: _elementEquality.hash, isValidKey: _elementEquality.isValidKey); diff --git a/test/analysis_options.yaml b/test/analysis_options.yaml new file mode 100644 index 0000000..3d47f94 --- /dev/null +++ b/test/analysis_options.yaml @@ -0,0 +1,6 @@ +include: ../analysis_options.yaml + +# Turn off the avoid_dynamic_calls lint for the test/ directory. +analyzer: + errors: + avoid_dynamic_calls: ignore