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].

lib/src/embedded/importer/file.dart

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

55
import '../../importer.dart';
6-
import '../compilation_dispatcher.dart';
76
import '../embedded_sass.pb.dart' hide SourceSpan;
87
import 'base.dart';
98

@@ -19,8 +18,7 @@ final class FileImporter extends ImporterBase {
1918
/// The host-provided ID of the importer to invoke.
2019
final int _importerId;
2120

22-
FileImporter(CompilationDispatcher dispatcher, this._importerId)
23-
: super(dispatcher);
21+
FileImporter(super.dispatcher, this._importerId);
2422

2523
Uri? canonicalize(Uri url) {
2624
if (url.scheme == 'file') return _filesystemImporter.canonicalize(url);

lib/src/embedded/importer/host.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import '../../exception.dart';
66
import '../../importer.dart';
77
import '../../importer/utils.dart';
88
import '../../util/span.dart';
9-
import '../compilation_dispatcher.dart';
109
import '../embedded_sass.pb.dart' hide SourceSpan;
1110
import '../utils.dart';
1211
import 'base.dart';
@@ -20,10 +19,9 @@ final class HostImporter extends ImporterBase {
2019
/// [canonicalize].
2120
final Set<String> _nonCanonicalSchemes;
2221

23-
HostImporter(CompilationDispatcher dispatcher, this._importerId,
24-
Iterable<String> nonCanonicalSchemes)
25-
: _nonCanonicalSchemes = Set.unmodifiable(nonCanonicalSchemes),
26-
super(dispatcher) {
22+
HostImporter(
23+
super.dispatcher, this._importerId, Iterable<String> nonCanonicalSchemes)
24+
: _nonCanonicalSchemes = Set.unmodifiable(nonCanonicalSchemes) {
2725
for (var scheme in _nonCanonicalSchemes) {
2826
if (isValidUrlScheme(scheme)) continue;
2927
throw SassException(

lib/src/exception.dart

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ class SassException extends SourceSpanException {
2828
/// compilation, before it failed.
2929
final Set<Uri> loadedUrls;
3030

31-
SassException(String message, FileSpan span, [Iterable<Uri>? loadedUrls])
31+
SassException(super.message, FileSpan super.span, [Iterable<Uri>? loadedUrls])
3232
: loadedUrls =
33-
loadedUrls == null ? const {} : Set.unmodifiable(loadedUrls),
34-
super(message, span);
33+
loadedUrls == null ? const {} : Set.unmodifiable(loadedUrls);
3534

3635
/// Converts this to a [MultiSpanSassException] with the additional [span] and
3736
/// [label].
@@ -224,9 +223,7 @@ class SassFormatException extends SassException
224223
SassFormatException withLoadedUrls(Iterable<Uri> loadedUrls) =>
225224
SassFormatException(message, span, loadedUrls);
226225

227-
SassFormatException(String message, FileSpan span,
228-
[Iterable<Uri>? loadedUrls])
229-
: super(message, span, loadedUrls);
226+
SassFormatException(super.message, super.span, [super.loadedUrls]);
230227
}
231228

232229
/// A [SassFormatException] that's also a [MultiSpanFormatException].
@@ -248,10 +245,9 @@ class MultiSpanSassFormatException extends MultiSpanSassException
248245
MultiSpanSassFormatException(
249246
message, span, primaryLabel, secondarySpans, loadedUrls);
250247

251-
MultiSpanSassFormatException(String message, FileSpan span,
252-
String primaryLabel, Map<FileSpan, String> secondarySpans,
253-
[Iterable<Uri>? loadedUrls])
254-
: super(message, span, primaryLabel, secondarySpans, loadedUrls);
248+
MultiSpanSassFormatException(
249+
super.message, super.span, super.primaryLabel, super.secondarySpans,
250+
[super.loadedUrls]);
255251
}
256252

257253
/// An exception thrown by SassScript.
@@ -287,9 +283,8 @@ class MultiSpanSassScriptException extends SassScriptException {
287283
final Map<FileSpan, String> secondarySpans;
288284

289285
MultiSpanSassScriptException(
290-
String message, this.primaryLabel, Map<FileSpan, String> secondarySpans)
291-
: secondarySpans = Map.unmodifiable(secondarySpans),
292-
super(message);
286+
super.message, this.primaryLabel, Map<FileSpan, String> secondarySpans)
287+
: secondarySpans = Map.unmodifiable(secondarySpans);
293288

294289
/// Converts this to a [SassException] with the given primary [span].
295290
MultiSpanSassException withSpan(FileSpan span) =>

lib/src/extend/functions.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/// aren't instance methods on other objects because their APIs aren't a good
1010
/// fit—usually because they deal with raw component lists rather than selector
1111
/// classes, to reduce allocations.
12+
library;
1213

1314
import 'dart:collection';
1415

lib/src/parse/at_root_query.dart

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,12 @@
55
import 'package:charcode/charcode.dart';
66

77
import '../ast/sass.dart';
8-
import '../interpolation_map.dart';
9-
import '../logger.dart';
108
import 'parser.dart';
119

1210
/// A parser for `@at-root` queries.
1311
class AtRootQueryParser extends Parser {
14-
AtRootQueryParser(String contents,
15-
{Object? url, Logger? logger, InterpolationMap? interpolationMap})
16-
: super(contents,
17-
url: url, logger: logger, interpolationMap: interpolationMap);
12+
AtRootQueryParser(super.contents,
13+
{super.url, super.logger, super.interpolationMap});
1814

1915
AtRootQuery parse() {
2016
return wrapSpanFormatException(() {

lib/src/parse/css.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import 'package:string_scanner/string_scanner.dart';
77

88
import '../ast/sass.dart';
99
import '../functions.dart';
10-
import '../logger.dart';
1110
import 'scss.dart';
1211

1312
/// The set of all function names disallowed in plain CSS.
@@ -31,8 +30,7 @@ final _disallowedFunctionNames =
3130
class CssParser extends ScssParser {
3231
bool get plainCss => true;
3332

34-
CssParser(String contents, {Object? url, Logger? logger})
35-
: super(contents, url: url, logger: logger);
33+
CssParser(super.contents, {super.url, super.logger});
3634

3735
void silentComment() {
3836
var start = scanner.state;

lib/src/parse/keyframe_selector.dart

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@
44

55
import 'package:charcode/charcode.dart';
66

7-
import '../interpolation_map.dart';
8-
import '../logger.dart';
97
import '../util/character.dart';
108
import 'parser.dart';
119

1210
/// A parser for `@keyframes` block selectors.
1311
class KeyframeSelectorParser extends Parser {
14-
KeyframeSelectorParser(String contents,
15-
{Object? url, Logger? logger, InterpolationMap? interpolationMap})
16-
: super(contents,
17-
url: url, logger: logger, interpolationMap: interpolationMap);
12+
KeyframeSelectorParser(super.contents,
13+
{super.url, super.logger, super.interpolationMap});
1814

1915
List<String> parse() {
2016
return wrapSpanFormatException(() {

lib/src/parse/media_query.dart

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,13 @@
55
import 'package:charcode/charcode.dart';
66

77
import '../ast/css.dart';
8-
import '../interpolation_map.dart';
9-
import '../logger.dart';
108
import '../utils.dart';
119
import 'parser.dart';
1210

1311
/// A parser for `@media` queries.
1412
class MediaQueryParser extends Parser {
15-
MediaQueryParser(String contents,
16-
{Object? url, Logger? logger, InterpolationMap? interpolationMap})
17-
: super(contents,
18-
url: url, logger: logger, interpolationMap: interpolationMap);
13+
MediaQueryParser(super.contents,
14+
{super.url, super.logger, super.interpolationMap});
1915

2016
List<CssMediaQuery> parse() {
2117
return wrapSpanFormatException(() {

lib/src/parse/sass.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import 'package:string_scanner/string_scanner.dart';
77

88
import '../ast/sass.dart';
99
import '../interpolation_buffer.dart';
10-
import '../logger.dart';
1110
import '../util/character.dart';
1211
import '../value.dart';
1312
import 'stylesheet.dart';
@@ -38,8 +37,7 @@ class SassParser extends StylesheetParser {
3837

3938
bool get indented => true;
4039

41-
SassParser(String contents, {Object? url, Logger? logger})
42-
: super(contents, url: url, logger: logger);
40+
SassParser(super.contents, {super.url, super.logger});
4341

4442
Interpolation styleRuleSelector() {
4543
var start = scanner.state;

lib/src/parse/scss.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ class ScssParser extends StylesheetParser {
1616
bool get indented => false;
1717
int get currentIndentation => 0;
1818

19-
ScssParser(String contents, {Object? url, Logger? logger})
20-
: super(contents, url: url, logger: logger);
19+
ScssParser(super.contents, {super.url, super.logger});
2120

2221
Interpolation styleRuleSelector() => almostAnyValue();
2322

0 commit comments

Comments
 (0)