Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Deprecate iterable_contains_unrelated_type and list_remove_unrelated_types #4360

Merged
merged 2 commits into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions example/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,13 @@ linter:
- implicit_call_tearoffs
- implicit_reopen
- invalid_case_patterns
- iterable_contains_unrelated_type
- join_return_with_assignment
- leading_newlines_in_multiline_strings
- library_annotations
- library_names
- library_prefixes
- library_private_types_in_public_api
- lines_longer_than_80_chars
- list_remove_unrelated_type
- literal_only_boolean_expressions
- matching_super_parameters
- missing_whitespace_between_adjacent_strings
Expand Down
14 changes: 10 additions & 4 deletions lib/src/rules/iterable_contains_unrelated_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ abstract class Mixin {}
class DerivedClass3 extends ClassBase implements Mixin {}
```

**DEPRECATED:** This rule is deprecated in favor of
`collection_methods_unrelated_type`.
The rule will be removed in a future Dart release.

''';

class IterableContainsUnrelatedType extends LintRule {
Expand All @@ -123,10 +127,12 @@ class IterableContainsUnrelatedType extends LintRule {

IterableContainsUnrelatedType()
: super(
name: 'iterable_contains_unrelated_type',
description: _desc,
details: _details,
group: Group.errors);
name: 'iterable_contains_unrelated_type',
description: _desc,
details: _details,
group: Group.errors,
state: State.deprecated(),
);

@override
LintCode get lintCode => code;
Expand Down
14 changes: 10 additions & 4 deletions lib/src/rules/list_remove_unrelated_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ abstract class Mixin {}
class DerivedClass3 extends ClassBase implements Mixin {}
```

**DEPRECATED:** This rule is deprecated in favor of
`collection_methods_unrelated_type`.
The rule will be removed in a future Dart release.

''';

class ListRemoveUnrelatedType extends LintRule {
Expand All @@ -123,10 +127,12 @@ class ListRemoveUnrelatedType extends LintRule {

ListRemoveUnrelatedType()
: super(
name: 'list_remove_unrelated_type',
description: _desc,
details: _details,
group: Group.errors);
name: 'list_remove_unrelated_type',
description: _desc,
details: _details,
group: Group.errors,
state: State.deprecated(),
);

@override
LintCode get lintCode => code;
Expand Down