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

Commit db94f2b

Browse files
authored
Deprecate prefer_equal_for_default_values (#3855)
* Deprecate prefer_equal_for_default_values * Update all.yaml and expand on deprecation
1 parent 1933b2a commit db94f2b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

example/all.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ linter:
123123
- prefer_constructors_over_static_methods
124124
- prefer_contains
125125
- prefer_double_quotes
126-
- prefer_equal_for_default_values
127126
- prefer_expression_function_bodies
128127
- prefer_final_fields
129128
- prefer_final_in_for_each

lib/src/rules/prefer_equal_for_default_values.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ import '../analyzer.dart';
1111
const _desc = r'Use `=` to separate a named parameter from its default value.';
1212

1313
const _details = r'''
14+
**DEPRECATED:** In Dart 2.19,
15+
the Dart analyzer reports the old `:` syntax as a warning
16+
and will report it as an error in Dart 3.0.
17+
As a result, this rule is unmaintained
18+
and will be removed in a future Linter release.
19+
1420
From the [style guide](https://dart.dev/guides/language/effective-dart/usage):
1521
1622
**DO** use `=` to separate a named parameter from its default value.
@@ -24,7 +30,6 @@ m({a: 1})
2430
```dart
2531
m({a = 1})
2632
```
27-
2833
''';
2934

3035
class PreferEqualForDefaultValues extends LintRule {
@@ -37,6 +42,7 @@ class PreferEqualForDefaultValues extends LintRule {
3742
name: 'prefer_equal_for_default_values',
3843
description: _desc,
3944
details: _details,
45+
maturity: Maturity.deprecated,
4046
group: Group.style);
4147

4248
@override

0 commit comments

Comments
 (0)