diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e6f26fbb40..6bf63c920b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/DEPS b/DEPS index bf5df69141b..da980494587 100644 --- a/DEPS +++ b/DEPS @@ -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", diff --git a/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_late.dart b/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_late.dart index 08c09db18a5..01f447a7f29 100644 --- a/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_late.dart +++ b/pkg/analysis_server/lib/src/services/correction/dart/remove_unnecessary_late.dart @@ -24,7 +24,7 @@ class RemoveUnnecessaryLate extends CorrectionProducer { @override Future compute(ChangeBuilder builder) async { - final declaration = node; + final declaration = node.parent; if (declaration is! VariableDeclaration) { return; } diff --git a/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml b/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml index fa7be237fbf..f818710cff6 100644 --- a/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml +++ b/pkg/analysis_server/lib/src/services/correction/error_fix_status.yaml @@ -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: diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_late_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_late_test.dart index 171d1932729..abaa6f3ab6f 100644 --- a/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_late_test.dart +++ b/pkg/analysis_server/test/src/services/correction/fix/remove_unnecessary_late_test.dart @@ -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)'), ); }