linter 1.19.2

Change-Id: Ied72b70663dee8cb91ebc18204464baa2a9644b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
This commit is contained in:
pq 2022-03-08 23:34:54 +00:00 committed by Commit Bot
parent 81143e16c4
commit 75e03d7875
5 changed files with 23 additions and 5 deletions

View file

@ -183,8 +183,20 @@ in 2018, as it doesn't work with any Dart 2.x release.
#### Linter
Updated the Linter to `1.18.0`, which includes changes that
Updated the Linter to `1.19.2`, which includes changes that
- adds new lint: `use_super_initializers`.
- adds new lint: `use_enums`.
- adds new lint: `use_colored_box`.
- improves performance for `sort_constructors`.
- improves docs for `always_use_package_imports`,
`avoid_print`, and `avoid_relative_lib_imports` .
- updates `avoid_void_async` to skip `main` functions.
- updates `prefer_final_parameters` to not super on super params.
- updates lints for enhanced-enums and super-initializer language
features.
- updates `unnecessary_late` to report on variable names.
- marks `null_check_on_nullable_type_parameter` stable.
- extends `camel_case_types` to cover enums.
- fixes `no_leading_underscores_for_local_identifiers` to not
mis-flag field formal parameters with default values.

2
DEPS
View file

@ -124,7 +124,7 @@ vars = {
"intl_tag": "0.17.0-nullsafety",
"jinja2_rev": "2222b31554f03e62600cd7e383376a7c187967a1",
"json_rpc_2_rev": "7e00f893440a72de0637970325e4ea44bd1e8c8e",
"linter_tag": "1.18.0",
"linter_tag": "1.19.2",
"lints_tag": "f9670df2a66e0ec12eb51554e70c1cbf56c8f5d0",
"logging_rev": "dfbe88b890c3b4f7bc06da5a7b3b43e9e263b688",
"markupsafe_rev": "8f45f5cfa0009d2a70589bcda0349b8cb2b72783",

View file

@ -24,7 +24,7 @@ class RemoveUnnecessaryLate extends CorrectionProducer {
@override
Future<void> compute(ChangeBuilder builder) async {
final declaration = node;
final declaration = node.parent;
if (declaration is! VariableDeclaration) {
return;
}

View file

@ -1814,8 +1814,12 @@ LintCode.unsafe_html_constructor:
status: needsEvaluation
LintCode.use_build_context_synchronously:
status: needsEvaluation
LintCode.use_colored_box:
status: needsEvaluation
LintCode.use_decorated_box:
status: needsEvaluation
LintCode.use_enums:
status: needsFix
LintCode.use_full_hex_values_for_flutter_colors:
status: hasFix
LintCode.use_function_type_syntax_for_parameters:
@ -1838,6 +1842,8 @@ LintCode.use_setters_to_change_properties:
status: needsEvaluation
LintCode.use_string_buffers:
status: needsEvaluation
LintCode.use_super_initializers:
status: needsFix
LintCode.use_test_throws_matchers:
status: needsEvaluation
LintCode.use_to_and_as_if_applicable:

View file

@ -71,7 +71,7 @@ late String s1 = '', s2 = '';
'''
String s1 = '', s2 = '';
''',
errorFilter: (error) => error.toString().contains('test.dart(21..27)'),
errorFilter: (error) => error.toString().contains('test.dart(21..22)'),
);
}
@ -83,7 +83,7 @@ late String s1 = '', s2 = '';
'''
String s1 = '', s2 = '';
''',
errorFilter: (error) => error.toString().contains('test.dart(12..18)'),
errorFilter: (error) => error.toString().contains('test.dart(12..13)'),
);
}