From 00f898aea7e99c0c5f3dfd85e46aceb896a32359 Mon Sep 17 00:00:00 2001 From: Jochum van der Ploeg Date: Mon, 25 Nov 2024 16:35:07 +0100 Subject: [PATCH] feat: remove `avoid_null_checks_in_equality_operators` (#124) * feat: remove `avoid_null_checks_in_equality_operators` * feat: remove `avoid_null_checks_in_equality_operators` * feat: remove `avoid_null_checks_in_equality_operators` --- README.md | 8 ++++++-- lib/analysis_options.7.0.0.yaml | 1 - tool/linter_rules/exclusion_reasons.json | 10 +++++++--- tool/linter_rules/lib/src/linter_rules_reasons.dart | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 81cc3d0..a6515a3 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,9 @@ Below is a list of rules that are not enabled by default together with the reaso | [`avoid_annotating_with_dynamic`](https://dart.dev/tools/linter-rules/avoid_annotating_with_dynamic) | Not specified | | [`avoid_catches_without_on_clauses`](https://dart.dev/tools/linter-rules/avoid_catches_without_on_clauses) | [Has unresolved false positives](/~https://github.com/dart-lang/linter/issues/3023) | | [`avoid_classes_with_only_static_members`](https://dart.dev/tools/linter-rules/avoid_classes_with_only_static_members) | Not specified | +| [`avoid_futureor_void`](https://dart.dev/tools/linter-rules/avoid_futureor_void) | Not specified | | [`avoid_implementing_value_types`](https://dart.dev/tools/linter-rules/avoid_implementing_value_types) | Not specified | +| [`avoid_null_checks_in_equality_operators`](https://dart.dev/tools/linter-rules/avoid_null_checks_in_equality_operators) | Has been deprecated and [will be removed](/~https://github.com/dart-lang/sdk/issues/59514) | | [`avoid_types_on_closure_parameters`](https://dart.dev/tools/linter-rules/avoid_types_on_closure_parameters) | Not specified | | [`close_sinks`](https://dart.dev/tools/linter-rules/close_sinks) | [Has unresolved false positives](/~https://github.com/dart-lang/linter/issues/1381) | | [`deprecated_member_use_from_same_package`](https://dart.dev/tools/linter-rules/deprecated_member_use_from_same_package) | Not specified | @@ -111,6 +113,8 @@ Below is a list of rules that are not enabled by default together with the reaso | [`library_names`](https://dart.dev/tools/linter-rules/library_names) | [Superseded by `unnecessary_library_name`](/~https://github.com/dart-lang/lints/issues/172) | | [`matching_super_parameters`](https://dart.dev/tools/linter-rules/matching_super_parameters) | Not specified | | [`no_literal_bool_comparisons`](https://dart.dev/tools/linter-rules/no_literal_bool_comparisons) | Not specified | +| [`omit_obvious_local_variable_types`](https://dart.dev/tools/linter-rules/omit_obvious_local_variable_types) | Not specified | +| [`package_api_docs`](https://dart.dev/tools/linter-rules/package_api_docs) | Has been deprecated and [will be removed](/~https://github.com/dart-lang/linter/issues/5107) | | [`package_prefixed_library_names`](https://dart.dev/tools/linter-rules/package_prefixed_library_names) | [Broken; superseded by `unnecessary_library_name`](/~https://github.com/dart-lang/lints/issues/172) | | [`prefer_double_quotes`](https://dart.dev/tools/linter-rules/prefer_double_quotes) | Incompatible with [prefer_single_quotes](https://dart.dev/tools/linter-rules/prefer_single_quotes) | | [`prefer_expression_function_bodies`](https://dart.dev/tools/linter-rules/prefer_expression_function_bodies) | Not specified | @@ -119,13 +123,13 @@ Below is a list of rules that are not enabled by default together with the reaso | [`prefer_mixin`](https://dart.dev/tools/linter-rules/prefer_mixin) | Not specified | | [`prefer_relative_imports`](https://dart.dev/tools/linter-rules/prefer_relative_imports) | Incompatible with [always_use_package_imports](https://dart.dev/tools/linter-rules/always_use_package_imports) | | [`prefer_void_to_null`](https://dart.dev/tools/linter-rules/prefer_void_to_null) | [Has unresolved false positives](/~https://github.com/dart-lang/linter/issues/4758) | +| [`specify_nonobvious_local_variable_types`](https://dart.dev/tools/linter-rules/specify_nonobvious_local_variable_types) | Not specified | | [`unintended_html_in_doc_comment`](https://dart.dev/tools/linter-rules/unintended_html_in_doc_comment) | [Pending recommendation](/~https://github.com/dart-lang/lints/issues/192) | | [`unnecessary_final`](https://dart.dev/tools/linter-rules/unnecessary_final) | Incompatible with [prefer_final_locals](https://dart.dev/tools/linter-rules/prefer_final_locals) | | [`unnecessary_null_aware_operator_on_extension_on_nullable`](https://dart.dev/tools/linter-rules/unnecessary_null_aware_operator_on_extension_on_nullable) | Not specified | | [`unreachable_from_main`](https://dart.dev/tools/linter-rules/unreachable_from_main) | Not specified | -| [`unsafe_html`](https://dart.dev/tools/linter-rules/unsafe_html) | Not specified | | [`use_decorated_box`](https://dart.dev/tools/linter-rules/use_decorated_box) | [Has unresolved malfunctions](/~https://github.com/dart-lang/linter/issues/3286) | -| [`package_api_docs`](https://dart.dev/tools/linter-rules/package_api_docs) | Has been deprecated and [will be removed](/~https://github.com/dart-lang/linter/issues/5107) | +| [`use_truncating_division`](https://dart.dev/tools/linter-rules/use_truncating_division) | Not specified | diff --git a/lib/analysis_options.7.0.0.yaml b/lib/analysis_options.7.0.0.yaml index 6ab1611..798903d 100644 --- a/lib/analysis_options.7.0.0.yaml +++ b/lib/analysis_options.7.0.0.yaml @@ -36,7 +36,6 @@ linter: - avoid_init_to_null - avoid_js_rounded_ints - avoid_multiple_declarations_per_line - - avoid_null_checks_in_equality_operators - avoid_positional_boolean_parameters - avoid_print - avoid_private_typedef_functions diff --git a/tool/linter_rules/exclusion_reasons.json b/tool/linter_rules/exclusion_reasons.json index 0cfaeba..741d066 100644 --- a/tool/linter_rules/exclusion_reasons.json +++ b/tool/linter_rules/exclusion_reasons.json @@ -5,7 +5,9 @@ "avoid_annotating_with_dynamic": "Not specified", "avoid_catches_without_on_clauses": "[Has unresolved false positives](/~https://github.com/dart-lang/linter/issues/3023)", "avoid_classes_with_only_static_members": "Not specified", + "avoid_futureor_void": "Not specified", "avoid_implementing_value_types": "Not specified", + "avoid_null_checks_in_equality_operators": "Has been deprecated and [will be removed](/~https://github.com/dart-lang/sdk/issues/59514)", "avoid_types_on_closure_parameters": "Not specified", "close_sinks": "[Has unresolved false positives](/~https://github.com/dart-lang/linter/issues/1381)", "deprecated_member_use_from_same_package": "Not specified", @@ -17,6 +19,8 @@ "library_names": "[Superseded by `unnecessary_library_name`](/~https://github.com/dart-lang/lints/issues/172)", "matching_super_parameters": "Not specified", "no_literal_bool_comparisons": "Not specified", + "omit_obvious_local_variable_types": "Not specified", + "package_api_docs": "Has been deprecated and [will be removed](/~https://github.com/dart-lang/linter/issues/5107)", "package_prefixed_library_names": "[Broken; superseded by `unnecessary_library_name`](/~https://github.com/dart-lang/lints/issues/172)", "prefer_double_quotes": "Incompatible with [prefer_single_quotes](https://dart.dev/tools/linter-rules/prefer_single_quotes)", "prefer_expression_function_bodies": "Not specified", @@ -25,11 +29,11 @@ "prefer_mixin": "Not specified", "prefer_relative_imports": "Incompatible with [always_use_package_imports](https://dart.dev/tools/linter-rules/always_use_package_imports)", "prefer_void_to_null": "[Has unresolved false positives](/~https://github.com/dart-lang/linter/issues/4758)", + "specify_nonobvious_local_variable_types": "Not specified", "unintended_html_in_doc_comment": "[Pending recommendation](/~https://github.com/dart-lang/lints/issues/192)", "unnecessary_final": "Incompatible with [prefer_final_locals](https://dart.dev/tools/linter-rules/prefer_final_locals)", "unnecessary_null_aware_operator_on_extension_on_nullable": "Not specified", "unreachable_from_main": "Not specified", - "unsafe_html": "Not specified", "use_decorated_box": "[Has unresolved malfunctions](/~https://github.com/dart-lang/linter/issues/3286)", - "package_api_docs": "Has been deprecated and [will be removed](/~https://github.com/dart-lang/linter/issues/5107)" -} + "use_truncating_division": "Not specified" +} \ No newline at end of file diff --git a/tool/linter_rules/lib/src/linter_rules_reasons.dart b/tool/linter_rules/lib/src/linter_rules_reasons.dart index 24d049c..ad25500 100644 --- a/tool/linter_rules/lib/src/linter_rules_reasons.dart +++ b/tool/linter_rules/lib/src/linter_rules_reasons.dart @@ -27,6 +27,6 @@ Future readExclusionReasons() async { /// Writes all the reasons for disabling a rule. Future writeExclusionReasons(LinterRulesReasons reasons) async { final file = File(_reasonsFilePath); - final json = jsonEncode(reasons); + final json = const JsonEncoder.withIndent(' ').convert(reasons); await file.writeAsString(json); }