Ideally we should have fixes (or assists) associated w/ all the lint rules (that can naturally be fixed automatically).
For context, this scorecard tells us where we currently stand.
| name | linter | dart sdk | fix | pedantic | stagehand | flutter user | flutter repo | status | bug refs |
| :--- | :--- | :--- | :---: | :---:| :---: | :---: | :---: | :---: | :--- |
| always_declare_return_types | 0.1.4 | 2.0.0 | | | | | โ
| | |
| always_put_control_body_on_new_line | 0.1.31 | 2.0.0 | | | | | โ
| | |
| always_put_required_named_parameters_first | 0.1.33 | 2.0.0 | | | | | | | |
| always_require_non_null_named_parameters | 0.1.31 | 2.0.0 | ๐ก | | | | โ
| | |
| always_specify_types | 0.1.4 | 2.0.0 | | | | | โ
| | |
| annotate_overrides | 0.1.11 | 2.0.0 | ๐ก | | | | โ
| | |
| avoid_annotating_with_dynamic | 0.1.31 | 2.0.0 | ๐ก | | | | | | #1162 |
| avoid_as | 0.1.5 | 2.0.0 | | | | | โ
| | |
| avoid_bool_literals_in_conditional_expressions | 0.1.46 | 2.0.0 | | | | | | | |
| avoid_catches_without_on_clauses | 0.1.31 | 2.0.0 | | | | | | | |
| avoid_catching_errors | 0.1.31 | 2.0.0 | | | | | | | |
| avoid_classes_with_only_static_members | 0.1.31 | 2.0.0 | | | | | โ
| | |
| avoid_double_and_int_checks | 0.1.47 | 2.0.0 | | | | | | | |
| avoid_empty_else | 0.1.8 | 2.0.0 | ๐ก | โ
| | โ
| โ
| | |
| avoid_field_initializers_in_const_classes | 0.1.48 | 2.0.0 | | | | | โ
| | |
| avoid_function_literals_in_foreach_calls | 0.1.30 | 2.0.0 | | | | | โ
| | |
| avoid_implementing_value_types | 0.1.62 | 2.1.0-dev.5.0 | | | | | | | |
| avoid_init_to_null | 0.1.11 | 2.0.0 | ๐ก | โ
| | โ
| โ
| | |
| avoid_js_rounded_ints | 0.1.48 | 2.0.0 | | | | | | | |
| avoid_null_checks_in_equality_operators | 0.1.31 | 2.0.0 | | | | | โ
| | |
| avoid_positional_boolean_parameters | 0.1.31 | 2.0.0 | | | | | | | |
| avoid_private_typedef_functions | 0.1.46 | 2.0.0 | | | | | | | |
| avoid_relative_lib_imports | 0.1.44 | 2.0.0 | | โ
| | | โ
| | |
| avoid_renaming_method_parameters | 0.1.45 | 2.0.0 | | | | | โ
| | |
| avoid_return_types_on_setters | 0.1.11 | 2.0.0 | ๐ก | โ
| | โ
| โ
| | |
| avoid_returning_null | 0.1.31 | 2.0.0 | | | | | | | |
| avoid_returning_null_for_future | 0.1.72 | 2.1.1-dev.0.0 | | | | | | | |
| avoid_returning_null_for_void | 0.1.69 | 2.1.0-dev.8.0 | | | | | โ
| | |
| avoid_returning_this | 0.1.31 | 2.0.0 | | | | | | | |
| avoid_setters_without_getters | 0.1.31 | 2.0.0 | | | | | | | |
| avoid_shadowing_type_parameters | 0.1.72 | 2.1.1-dev.0.0 | | | | | | | |
| avoid_single_cascade_in_expression_statements | 0.1.46 | 2.0.0 | | | | | | | |
| avoid_slow_async_io | 0.1.30 | 2.0.0 | | | | | โ
| | |
| avoid_types_as_parameter_names | 0.1.45 | 2.0.0 | | โ
| | | โ
| | |
| avoid_types_on_closure_parameters | 0.1.31 | 2.0.0 | ๐ก | | | | | | #1099 |
| avoid_unused_constructor_parameters | 0.1.36 | 2.0.0 | | | | | โ
| | |
| avoid_void_async | 0.1.60 | 2.1.0-dev.3.0 | | | | | โ
| | |
| await_only_futures | 0.1.16 | 2.0.0 | ๐ก | | | โ
| โ
| | |
| camel_case_types | 0.1.1 | 2.0.0 | | | | โ
| โ
| | |
| cancel_subscriptions | 0.1.20 | 2.0.0 | | | โ
| โ
| โ
| | |
| cascade_invocations | 0.1.29 | 2.0.0 | | | | | | | #1023, #806, #787 |
| close_sinks | 0.1.19 | 2.0.0 | | | | โ
| | | |
| comment_references | 0.1.17 | 2.0.0 | | | | | | | |
| constant_identifier_names | 0.1.1 | 2.0.0 | | | | | | | |
| control_flow_in_finally | 0.1.16 | 2.0.0 | | | | โ
| โ
| | |
| curly_braces_in_flow_control_structures | 0.1.57 | 2.0.0 | | | | | | | |
| directives_ordering | 0.1.30 | 2.0.0 | | | | | โ
| | |
| empty_catches | 0.1.22 | 2.0.0 | ๐ก | | | | โ
| | |
| empty_constructor_bodies | 0.1.1 | 2.0.0 | ๐ก | | | โ
| โ
| | |
| empty_statements | 0.1.21 | 2.0.0 | ๐ก | | | โ
| โ
| | |
| file_names | 0.1.54 | 2.0.0 | | | | | | | |
| flutter_style_todos | 0.1.61 | 2.1.0-dev.5.0 | | | | | โ
| | |
| hash_and_equals | 0.1.11 | 2.0.0 | | | โ
| โ
| โ
| | |
| implementation_imports | 0.1.4 | 2.0.0 | | | | โ
| โ
| | #1175 |
| invariant_booleans | 0.1.25 | 2.0.0 | | | | | | experimental | #1321, #914, #811, #720, #674 |
| iterable_contains_unrelated_type | 0.1.17 | 2.0.0 | | | โ
| | โ
| | #1003 |
| join_return_with_assignment | 0.1.31 | 2.0.0 | | | | | | | |
| library_names | 0.1.1 | 2.0.0 | | | | โ
| โ
| | |
| library_prefixes | 0.1.1 | 2.0.0 | | | | | โ
| | |
| lines_longer_than_80_chars | 0.1.56 | 2.0.0 | | | | | | | |
| list_remove_unrelated_type | 0.1.22 | 2.0.0 | | | โ
| | โ
| | |
| literal_only_boolean_expressions | 0.1.25 | 2.0.0 | | | | | | | |
| no_adjacent_strings_in_list | 0.1.30 | 2.0.0 | | | | | โ
| | |
| no_duplicate_case_values | 0.1.30 | 2.0.0 | | โ
| | | โ
| | |
| non_constant_identifier_names | 0.1.1 | 2.0.0 | ๐ก | | | โ
| โ
| | |
| null_closures | 0.1.56 | 2.0.0 | | โ
| | | | | |
| omit_local_variable_types | 0.1.30 | 2.0.0 | | | | | | | #1006 |
| one_member_abstracts | 0.1.1 | 2.0.0 | | | | | | | #990 |
| only_throw_errors | 0.1.21 | 2.0.0 | | | | | | | |
| overridden_fields | 0.1.18 | 2.0.0 | | | | | โ
| | |
| package_api_docs | 0.1.1 | 2.0.0 | | | | โ
| โ
| | #213 |
| package_names | 0.1.31 | 2.0.0 | | | | โ
| โ
| | |
| package_prefixed_library_names | 0.1.1 | 2.0.0 | | | | โ
| โ
| | |
| parameter_assignments | 0.1.27 | 2.0.0 | | | | | | | |
| prefer_adjacent_string_concatenation | 0.1.30 | 2.0.0 | | | | | โ
| | #1191 |
| prefer_asserts_in_initializer_lists | 0.1.33 | 2.0.0 | | | | | โ
| | |
| prefer_bool_in_asserts | 0.1.36 | 2.0.0 | | | | | | deprecated | |
| prefer_collection_literals | 0.1.30 | 2.0.0 | ๐ก | | | | โ
| | |
| prefer_conditional_assignment | 0.1.31 | 2.0.0 | ๐ก | | | | โ
| | |
| prefer_const_constructors | 0.1.30 | 2.0.0 | | | | | โ
| | |
| prefer_const_constructors_in_immutables | 0.1.33 | 2.0.0 | | | | | โ
| | |
| prefer_const_declarations | 0.1.43 | 2.0.0 | ๐ก | | | | โ
| | |
| prefer_const_literals_to_create_immutables | 0.1.43 | 2.0.0 | | | | | โ
| | |
| prefer_constructors_over_static_methods | 0.1.31 | 2.0.0 | | | | | | | |
| prefer_contains | 0.1.30 | 2.0.0 | | โ
| | | โ
| | |
| prefer_equal_for_default_values | 0.1.46 | 2.0.0 | | โ
| | | โ
| | |
| prefer_expression_function_bodies | 0.1.30 | 2.0.0 | | | | | | | |
| prefer_final_fields | 0.1.27 | 2.0.0 | ๐ก | | | | โ
| | |
| prefer_final_in_for_each | 0.1.78 | null | | | | | | | |
| prefer_final_locals | 0.1.27 | 2.0.0 | ๐ก | | | | โ
| | |
| prefer_foreach | 0.1.31 | 2.0.0 | | | | | โ
| | |
| prefer_function_declarations_over_variables | 0.1.30 | 2.0.0 | | | | | | | |
| prefer_generic_function_type_aliases | 0.1.47 | 2.0.0 | | | | | โ
| | |
| prefer_initializing_formals | 0.1.30 | 2.0.0 | | | | | โ
| | |
| prefer_int_literals | 0.1.71 | 2.1.0 | | | | | | | |
| prefer_interpolation_to_compose_strings | 0.1.30 | 2.0.0 | | | | | | | |
| prefer_is_empty | 0.1.30 | 2.0.0 | | โ
| | | โ
| | |
| prefer_is_not_empty | 0.1.5 | 2.0.0 | ๐ก | โ
| | โ
| โ
| | #1232 |
| prefer_iterable_whereType | 0.1.47 | 2.0.0 | | | | | โ
| | |
| prefer_mixin | 0.1.62 | 2.1.0-dev.5.0 | | | | | | | |
| prefer_single_quotes | 0.1.33 | 2.0.0 | | | | | โ
| | |
| prefer_typing_uninitialized_variables | 0.1.36 | 2.0.0 | | | | | โ
| | |
| prefer_void_to_null | 0.1.59 | 2.1.0-dev.1.0 | | | | | โ
| | |
| public_member_api_docs | 0.1.11 | 2.0.0 | | | | | | | |
| recursive_getters | 0.1.30 | 2.0.0 | | โ
| | | โ
| | |
| slash_for_doc_comments | 0.1.1 | 2.0.0 | | | | โ
| โ
| | |
| sort_constructors_first | 0.1.11 | 2.0.0 | | | | | โ
| | |
| sort_pub_dependencies | 0.1.63 | 2.1.0-dev.6.0 | | | | | โ
| | |
| sort_unnamed_constructors_first | 0.1.11 | 2.0.0 | | | | | โ
| | |
| super_goes_last | 0.1.1 | 2.0.0 | | | | โ
| โ
| | |
| test_types_in_equals | 0.1.16 | 2.0.0 | | | โ
| โ
| โ
| | #443 |
| throw_in_finally | 0.1.16 | 2.0.0 | | | | โ
| โ
| | |
| type_annotate_public_apis | 0.1.5 | 2.0.0 | | | | | | | #1121 |
| type_init_formals | 0.1.1 | 2.0.0 | ๐ก | | | โ
| โ
| | |
| unawaited_futures | 0.1.19 | 2.0.0 | | โ
| | | | | #1007, #836, #534, #419 |
| unnecessary_await_in_return | 0.1.73 | 2.1.1-dev.0.0 | | | | | | | |
| unnecessary_brace_in_string_interps | 0.1.30 | 2.0.0 | | | | โ
| โ
| | |
| unnecessary_const | 0.1.54 | 2.0.0 | | | | | โ
| | |
| unnecessary_getters_setters | 0.1.1 | 2.0.0 | | | | โ
| โ
| | #275 |
| unnecessary_lambdas | 0.1.30 | 2.0.0 | ๐ก | | | | | | |
| unnecessary_new | 0.1.54 | 2.0.0 | | | | | โ
| | |
| unnecessary_null_aware_assignments | 0.1.30 | 2.0.0 | | | | | โ
| | |
| unnecessary_null_in_if_null_operators | 0.1.30 | 2.0.0 | | | | | โ
| | |
| unnecessary_overrides | 0.1.31 | 2.0.0 | | | | | โ
| | |
| unnecessary_parenthesis | 0.1.44 | 2.0.0 | | | | | โ
| | |
| unnecessary_statements | 0.1.36 | 2.0.0 | | | | โ
| โ
| | |
| unnecessary_this | 0.1.30 | 2.0.0 | ๐ก | | | | โ
| | |
| unrelated_type_equality_checks | 0.1.16 | 2.0.0 | | โ
| โ
| โ
| โ
| | |
| use_function_type_syntax_for_parameters | 0.1.72 | 2.1.1-dev.0.0 | | | | | | | |
| use_rethrow_when_possible | 0.1.31 | 2.0.0 | | โ
| | | โ
| | |
| use_setters_to_change_properties | 0.1.31 | 2.0.0 | | | | | | | |
| use_string_buffers | 0.1.31 | 2.0.0 | | | | | | | #777 |
| use_to_and_as_if_applicable | 0.1.31 | 2.0.0 | | | | | | | |
| valid_regexps | 0.1.22 | 2.0.0 | | โ
| โ
| โ
| โ
| | |
| void_checks | 0.1.49 | 2.0.0 | | | | | | | |
This is great! Perhaps we should have a shorter list of quick fixes we intend to address sooner? We could start with the lints from package:pedantic, remove lints where quick fixes don't make sense, and possibly add one or two high value lints.
Please tell me you have a script to update that table. ๐
Please please please prefer_single_quotes
slash_for_doc_comments? prefer_generic_function_type_aliases?
Things already done by dartfmt --fix are lower pri for me :-)
On Fri, Jan 18, 2019 at 2:09 PM Devon Carew notifications@github.com
wrote:
slash_for_doc_comments? prefer_generic_function_type_aliases?
โ
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/dart-lang/linter/issues/1374#issuecomment-455703893,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABCim4ActxdQYfjNZznfZSUE8dF2czaks5vEkYFgaJpZM4aItKC
.
Sorry, I don't quite get the light bulb image. Does that mean a quickfix exists for that lint?
I'm totally in favor of adding fixes where possible, but there are cases where a fix doesn't make sense, such as avoid_types_as_parameter_names. It will be interesting to see how many have reasonable fixes.
Also, we often choose to implement such "fixes" as quick assists, because then they're available to users even if they haven't enabled the lint. The scorecard doesn't take that into account (and I don't know how to compute that; there's no indication anywhere in the code that the assist is appropriate for the lint).
Please please please prefer_single_quotes
slash_for_doc_comments? prefer_generic_function_type_aliases?
Great examples! We have assists for all of those.
Please tell me you have a script to update that table.
๐ https://github.com/dart-lang/linter/blob/master/tool/scorecard.dart
I don't quite get the light bulb image. Does that mean a quickfix exists for that lint?
Sorry, yeah. May just as well have been a checkmark but assists are often displayed with lightbulbs in IDEs so I was trying to be cute.
I'm totally in favor of adding fixes where possible, but there are cases where a fix doesn't make sense
Right. That's what I was trying to say with the "that can naturally be fixed automatically" qualifier above. Can you think of a better way to say that?
However we describe it, I'd like to capture the information somewhere so we can exclude lints that aren't fixable from consideration. Ideas for where that should live most welcome!
Also, we often choose to implement such "fixes" as quick assists, because then they're available to users even if they haven't enabled the lint. The scorecard doesn't take that into account (and I don't know how to compute that; there's no indication anywhere in the code that the assist is appropriate for the lint).
Yes, right (as in prefer_single_quotes). We should capture this somewhere and use it to inform the scorecard. (EDIT: tracking here: #1375.)
I'd prefer to see #719 (and probably #1097) be addressed first.
Addressing #1097 would address #719, but I don't believe we have the resources to address either one this quarter, and I wouldn't want this to wait until we did. (And it won't be any harder to move 20 fixes to a plugin than to move 10.)
That said, the right way (imo) to address this issue is to
showing support for _prefer_final_in_for_each_
Most helpful comment
Please please please
prefer_single_quotes