-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to and fix latest lints #1335
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
include: package:lints/recommended.yaml | ||
linter: | ||
rules: | ||
- avoid_dynamic_calls | ||
- directives_ordering | ||
- unawaited_futures | ||
include: package:dart_flutter_team_lints/analysis_options.yaml | ||
|
||
analyzer: | ||
errors: | ||
comment_references: ignore | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LOTS of failures here! |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,6 +106,7 @@ mixin CommentWriter { | |
// just override the script tag's line. | ||
if (token.previous!.type == TokenType.SCRIPT_TAG) previousLine = tokenLine; | ||
|
||
// ignore: prefer_const_constructors | ||
kevmoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
var comments = CommentSequence._([], []); | ||
for (Token? comment = token.precedingComments; | ||
comment != null; | ||
|
@@ -312,7 +313,7 @@ class CommentSequence extends ListBase<SourceComment> { | |
SourceComment operator [](int index) => _comments[index]; | ||
|
||
@override | ||
operator []=(int index, SourceComment value) => | ||
void operator []=(int index, SourceComment value) => | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This return type is pointless. Index setters are like setters: they can never return a value anyway. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generally agree, so maybe the lint needs to be updated for this case! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe the lint is doing the right thing. I enabled always_declare_return_types and tested it on: class Foo {
get getter => 1;
set setter(int value) => 1;
method() => 1;
operator [](int index) => 1;
operator []=(int index, int value) => 1;
} I get lint warnings on |
||
throw UnsupportedError('Comment sequence can\'t be modified.'); | ||
|
||
void _add(int linesBefore, SourceComment comment) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all of these are in
dart_flutter_team_lints