Skip to content

Commit 456a369

Browse files
authored
remove super_goes_last (dart-archive/linter#4017)
1 parent 5ce7e10 commit 456a369

File tree

4 files changed

+1
-94
lines changed

4 files changed

+1
-94
lines changed

lib/src/rules/super_goes_last.dart

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
import 'package:analyzer/dart/ast/ast.dart';
6-
import 'package:analyzer/dart/ast/visitor.dart';
7-
85
import '../analyzer.dart';
96

107
const _desc =
@@ -42,13 +39,6 @@ View(Style style, List children)
4239
: _children = children,
4340
super(style) {
4441
```
45-
46-
**DEPRECATED:** In Dart 2, it is a compile-time error if a superinitializer
47-
appears in an initializer list at any other position than at the end so this
48-
rule is made redundant by the Dart analyzer's basic checks and is no longer
49-
necessary.
50-
51-
The rule will be removed in a future Linter release.
5242
''';
5343

5444
class SuperGoesLast extends LintRule {
@@ -63,34 +53,9 @@ class SuperGoesLast extends LintRule {
6353
name: 'super_goes_last',
6454
description: _desc,
6555
details: _details,
66-
state: State.deprecated(),
56+
state: State.removed(since: dart3),
6757
group: Group.style);
6858

6959
@override
7060
LintCode get lintCode => code;
71-
72-
@override
73-
void registerNodeProcessors(
74-
NodeLintRegistry registry, LinterContext context) {
75-
var visitor = _Visitor(this);
76-
registry.addConstructorDeclaration(this, visitor);
77-
}
78-
}
79-
80-
class _Visitor extends SimpleAstVisitor<void> {
81-
final LintRule rule;
82-
83-
_Visitor(this.rule);
84-
85-
@override
86-
void visitConstructorDeclaration(ConstructorDeclaration node) {
87-
var last = node.initializers.length - 1;
88-
89-
for (var i = 0; i <= last; ++i) {
90-
var init = node.initializers[i];
91-
if (init is SuperConstructorInvocation && i != last) {
92-
rule.reportLint(init);
93-
}
94-
}
95-
}
9661
}

test/rules/all.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ import 'recursive_getters_test.dart' as recursive_getters;
7979
import 'sort_constructors_first_test.dart' as sort_constructors_first;
8080
import 'sort_unnamed_constructors_first_test.dart'
8181
as sort_unnamed_constructors_first;
82-
import 'super_goes_last_test.dart' as super_goes_last;
8382
import 'tighten_type_of_initializing_formals_test.dart'
8483
as tighten_type_of_initializing_formals;
8584
import 'type_init_formals_test.dart' as type_init_formals;
@@ -157,7 +156,6 @@ void main() {
157156
recursive_getters.main();
158157
sort_constructors_first.main();
159158
sort_unnamed_constructors_first.main();
160-
super_goes_last.main();
161159
tighten_type_of_initializing_formals.main();
162160
type_init_formals.main();
163161
unawaited_futures.main();

test/rules/super_goes_last_test.dart

Lines changed: 0 additions & 39 deletions
This file was deleted.

test_data/rules/super_goes_last.dart

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)