File tree 7 files changed +13
-35
lines changed
7 files changed +13
-35
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ linter:
39
39
# - combinators_ordering
40
40
# - close_sinks # https://github.com/dart-lang/linter/issues/268
41
41
- comment_references
42
+ - dangling_library_doc_comments
42
43
- directives_ordering
43
44
- discarded_futures
44
45
- join_return_with_assignment
@@ -71,6 +72,7 @@ linter:
71
72
- throw_in_finally
72
73
# - type_annotate_public_apis
73
74
- unawaited_futures # pedantic
75
+ - unnecessary_breaks
74
76
- unnecessary_final
75
77
- unnecessary_lambdas
76
78
- unnecessary_null_checks
Original file line number Diff line number Diff line change 3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
5
/// Common AST helpers.
6
+ library ;
7
+
6
8
import 'package:analyzer/dart/ast/ast.dart' ;
7
9
import 'package:analyzer/dart/ast/syntactic_entity.dart' ;
8
10
import 'package:analyzer/dart/ast/token.dart' ;
Original file line number Diff line number Diff line change @@ -140,25 +140,6 @@ class _Visitor extends SimpleAstVisitor<void> {
140
140
}
141
141
}
142
142
143
- TokenType _invertedTokenType (TokenType type) {
144
- switch (type) {
145
- case TokenType .LT_EQ :
146
- return TokenType .GT_EQ ;
147
-
148
- case TokenType .LT :
149
- return TokenType .GT ;
150
-
151
- case TokenType .GT :
152
- return TokenType .LT ;
153
-
154
- case TokenType .GT_EQ :
155
- return TokenType .LT_EQ ;
156
-
157
- default :
158
- return type;
159
- }
160
- }
161
-
162
143
/// Returns whether [expression] is an invocation of `Iterable.indexOf` or
163
144
/// `String.indexOf` , which is not assigned to a value.
164
145
bool _isUnassignedIndexOf (Expression expression) {
@@ -193,4 +174,12 @@ class _Visitor extends SimpleAstVisitor<void> {
193
174
194
175
return true ;
195
176
}
177
+
178
+ static TokenType _invertedTokenType (TokenType type) => switch (type) {
179
+ TokenType .LT_EQ => TokenType .GT_EQ ,
180
+ TokenType .LT => TokenType .GT ,
181
+ TokenType .GT => TokenType .LT ,
182
+ TokenType .GT_EQ => TokenType .LT_EQ ,
183
+ _ => type
184
+ };
196
185
}
Original file line number Diff line number Diff line change @@ -127,7 +127,6 @@ abstract class UnrelatedTypesProcessors extends SimpleAstVisitor<void> {
127
127
typeArgument.getDisplayString (withNullability: true ),
128
128
]);
129
129
}
130
- break ;
131
130
132
131
case ExpectedArgumentKind .assignableToCollection:
133
132
if (! typeSystem.isAssignableTo (argumentType, collectionType)) {
@@ -136,7 +135,6 @@ abstract class UnrelatedTypesProcessors extends SimpleAstVisitor<void> {
136
135
collectionType.getDisplayString (withNullability: true ),
137
136
]);
138
137
}
139
- break ;
140
138
141
139
case ExpectedArgumentKind .assignableToIterableOfTypeArgument:
142
140
var iterableType =
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ repository: https://github.com/dart-lang/linter
9
9
documentation : https://dart-lang.github.io/linter/lints
10
10
11
11
environment :
12
- sdk : ' >=2.17.0 < 3.0.0'
12
+ sdk : ^ 3.0.0-0
13
13
14
14
dependencies :
15
15
analyzer : ^5.10.0
Original file line number Diff line number Diff line change @@ -197,25 +197,20 @@ class LintScore {
197
197
case Detail .rule:
198
198
sb.write (
199
199
' [`$name `](https://dart-lang.github.io/linter/lints/$name .html) |' );
200
- break ;
201
200
case Detail .fix:
202
201
var status = unfixableLints.contains (name)
203
202
? skip
204
203
: (hasFix ? checkMark : consider);
205
204
sb.write (' $status |' );
206
- break ;
207
205
case Detail .bulk:
208
206
var status = unfixableLints.contains (name)
209
207
? skip
210
208
: (hasBulkFix ? checkMark : consider);
211
209
sb.write (' $status |' );
212
- break ;
213
210
case Detail .status:
214
211
sb.write ('${!state .isStable ? ' **${state .label }** ' : "" } |' );
215
- break ;
216
212
case Detail .bugs:
217
213
sb.write (' ${bugReferences .join (", " )} |' );
218
- break ;
219
214
}
220
215
}
221
216
return sb.toString ();
Original file line number Diff line number Diff line change @@ -151,29 +151,21 @@ class LintScore {
151
151
case Detail .rule:
152
152
sb.write (
153
153
' [$name ](https://dart-lang.github.io/linter/lints/$name .html) |' );
154
- break ;
155
154
case Detail .linter:
156
155
sb.write (' ${since !.sinceLinter } |' );
157
- break ;
158
156
case Detail .sdk:
159
157
sb.write (' ${since !.sinceDartSdk } |' );
160
- break ;
161
158
case Detail .fix:
162
159
sb.write ('${hasFix ? " $bulb " : "" } |' );
163
- break ;
164
160
case Detail .flutterUser:
165
161
sb.write ('${ruleSets .contains ('flutter' ) ? " $checkMark " : "" } |' );
166
- break ;
167
162
case Detail .flutterRepo:
168
163
sb.write (
169
164
'${ruleSets .contains ('flutter_repo' ) ? " $checkMark " : "" } |' );
170
- break ;
171
165
case Detail .status:
172
166
sb.write ('${!state .isStable ? ' **${state .label }** ' : "" } |' );
173
- break ;
174
167
case Detail .bugs:
175
168
sb.write (' ${bugReferences .join (", " )} |' );
176
- break ;
177
169
}
178
170
}
179
171
return sb.toString ();
You can’t perform that action at this time.
0 commit comments