Skip to content

Commit 13830a5

Browse files
authored
Fix new recommended lints (#2139)
1 parent cd3b0cc commit 13830a5

24 files changed

+46
-98
lines changed

lib/src/ast/sass/statement/function_rule.dart

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@ import 'package:source_span/source_span.dart';
66

77
import '../../../util/span.dart';
88
import '../../../visitor/interface/statement.dart';
9-
import '../argument_declaration.dart';
109
import '../declaration.dart';
11-
import '../statement.dart';
1210
import 'callable_declaration.dart';
13-
import 'silent_comment.dart';
1411

1512
/// A function declaration.
1613
///
@@ -21,10 +18,8 @@ final class FunctionRule extends CallableDeclaration
2118
implements SassDeclaration {
2219
FileSpan get nameSpan => span.withoutInitialAtRule().initialIdentifier();
2320

24-
FunctionRule(String name, ArgumentDeclaration arguments,
25-
Iterable<Statement> children, FileSpan span,
26-
{SilentComment? comment})
27-
: super(name, arguments, children, span, comment: comment);
21+
FunctionRule(super.name, super.arguments, super.children, super.span,
22+
{super.comment});
2823

2924
T accept<T>(StatementVisitor<T> visitor) => visitor.visitFunctionRule(this);
3025

lib/src/ast/sass/statement/if_rule.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ final class IfClause extends IfRuleClause {
9494
///
9595
/// {@category AST}
9696
final class ElseClause extends IfRuleClause {
97-
ElseClause(Iterable<Statement> children) : super(children);
97+
ElseClause(super.children);
9898

9999
String toString() => "@else {${children.join(' ')}}";
100100
}

lib/src/ast/sass/statement/mixin_rule.dart

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ import 'package:source_span/source_span.dart';
77
import '../../../util/span.dart';
88
import '../../../visitor/interface/statement.dart';
99
import '../../../visitor/statement_search.dart';
10-
import '../argument_declaration.dart';
1110
import '../declaration.dart';
12-
import '../statement.dart';
1311
import 'callable_declaration.dart';
1412
import 'content_rule.dart';
15-
import 'silent_comment.dart';
1613

1714
/// A mixin declaration.
1815
///
@@ -31,10 +28,8 @@ final class MixinRule extends CallableDeclaration implements SassDeclaration {
3128
return startSpan.initialIdentifier();
3229
}
3330

34-
MixinRule(String name, ArgumentDeclaration arguments,
35-
Iterable<Statement> children, FileSpan span,
36-
{SilentComment? comment})
37-
: super(name, arguments, children, span, comment: comment);
31+
MixinRule(super.name, super.arguments, super.children, super.span,
32+
{super.comment});
3833

3934
T accept<T>(StatementVisitor<T> visitor) => visitor.visitMixinRule(this);
4035

lib/src/ast/selector/complex.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,10 @@ final class ComplexSelector extends Selector {
7070
}
7171

7272
ComplexSelector(Iterable<CssValue<Combinator>> leadingCombinators,
73-
Iterable<ComplexSelectorComponent> components, FileSpan span,
73+
Iterable<ComplexSelectorComponent> components, super.span,
7474
{this.lineBreak = false})
7575
: leadingCombinators = List.unmodifiable(leadingCombinators),
76-
components = List.unmodifiable(components),
77-
super(span) {
76+
components = List.unmodifiable(components) {
7877
if (this.leadingCombinators.isEmpty && this.components.isEmpty) {
7978
throw ArgumentError(
8079
"leadingCombinators and components may not both be empty.");

lib/src/ast/selector/compound.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// https://opensource.org/licenses/MIT.
44

55
import 'package:meta/meta.dart';
6-
import 'package:source_span/source_span.dart';
76

87
import '../../extend/functions.dart';
98
import '../../logger.dart';
@@ -43,9 +42,8 @@ final class CompoundSelector extends Selector {
4342
SimpleSelector? get singleSimple =>
4443
components.length == 1 ? components.first : null;
4544

46-
CompoundSelector(Iterable<SimpleSelector> components, FileSpan span)
47-
: components = List.unmodifiable(components),
48-
super(span) {
45+
CompoundSelector(Iterable<SimpleSelector> components, super.span)
46+
: components = List.unmodifiable(components) {
4947
if (this.components.isEmpty) {
5048
throw ArgumentError("components may not be empty.");
5149
}

lib/src/ast/selector/list.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// https://opensource.org/licenses/MIT.
44

55
import 'package:meta/meta.dart';
6-
import 'package:source_span/source_span.dart';
76

87
import '../../exception.dart';
98
import '../../extend/functions.dart';
@@ -49,9 +48,8 @@ final class SelectorList extends Selector {
4948
}), ListSeparator.comma);
5049
}
5150

52-
SelectorList(Iterable<ComplexSelector> components, FileSpan span)
53-
: components = List.unmodifiable(components),
54-
super(span) {
51+
SelectorList(Iterable<ComplexSelector> components, super.span)
52+
: components = List.unmodifiable(components) {
5553
if (this.components.isEmpty) {
5654
throw ArgumentError("components may not be empty.");
5755
}

lib/src/ast/selector/parent.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// https://opensource.org/licenses/MIT.
44

55
import 'package:meta/meta.dart';
6-
import 'package:source_span/source_span.dart';
76

87
import '../../visitor/interface/selector.dart';
98
import '../selector.dart';
@@ -22,7 +21,7 @@ final class ParentSelector extends SimpleSelector {
2221
/// indicating that the parent selector will not be modified.
2322
final String? suffix;
2423

25-
ParentSelector(FileSpan span, {this.suffix}) : super(span);
24+
ParentSelector(super.span, {this.suffix});
2625

2726
T accept<T>(SelectorVisitor<T> visitor) => visitor.visitParentSelector(this);
2827

lib/src/ast/selector/simple.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// https://opensource.org/licenses/MIT.
44

55
import 'package:meta/meta.dart';
6-
import 'package:source_span/source_span.dart';
76

87
import '../../exception.dart';
98
import '../../logger.dart';
@@ -35,7 +34,7 @@ abstract base class SimpleSelector extends Selector {
3534
/// sequence will contain 1000 simple selectors.
3635
int get specificity => 1000;
3736

38-
SimpleSelector(FileSpan span) : super(span);
37+
SimpleSelector(super.span);
3938

4039
/// Parses a simple selector from [contents].
4140
///

lib/src/ast/selector/universal.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// https://opensource.org/licenses/MIT.
44

55
import 'package:meta/meta.dart';
6-
import 'package:source_span/source_span.dart';
76

87
import '../../extend/functions.dart';
98
import '../../visitor/interface/selector.dart';
@@ -23,7 +22,7 @@ final class UniversalSelector extends SimpleSelector {
2322

2423
int get specificity => 0;
2524

26-
UniversalSelector(FileSpan span, {this.namespace}) : super(span);
25+
UniversalSelector(super.span, {this.namespace});
2726

2827
T accept<T>(SelectorVisitor<T> visitor) =>
2928
visitor.visitUniversalSelector(this);

lib/src/configuration.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ final class ExplicitConfiguration extends Configuration {
119119

120120
/// Creates a base [ExplicitConfiguration] with a [values] map and a
121121
/// [nodeWithSpan].
122-
ExplicitConfiguration(Map<String, ConfiguredValue> values, this.nodeWithSpan)
123-
: super.implicit(values);
122+
ExplicitConfiguration(super.values, this.nodeWithSpan) : super.implicit();
124123

125124
/// Creates an [ExplicitConfiguration] with a [values] map, a [nodeWithSpan]
126125
/// and if this is a copy a reference to the [_originalConfiguration].

0 commit comments

Comments
 (0)