very_good_analysis icon indicating copy to clipboard operation
very_good_analysis copied to clipboard

Update Lints

Open lishaduck opened this issue 1 year ago • 3 comments

Hi, it's me again!

Is your feature request related to a problem? Please describe. Update lints for Dart 3.5 (part of #108)

Describe the solution you'd like Add:

  • [ ] unintended_html_in_doc_comment (wait a release to check for false positives per https://github.com/dart-lang/lints/issues/192#issuecomment-2269658177?),
  • [ ] invalid_runtime_check_with_js_interop_types (lints is waiting for the next major, but the Dart team agrees that this is stable dart-lang/lints#188),
  • [x] unnecessary_library_name (Now recommended: dart-lang/lints#181),
  • [ ] document_ignores (Not experimental, I've found it useful in other ecosystems),
  • [ ] avoid_catches_without_on_clauses (Noted false positives have been fixed),
  • [x] type_literal_in_constant_pattern (Now recommended: dart-lang/lints#150).

Also, remove

  • [ ] unnecessary_await_in_return (It's be mentioned a few times as likely to be deprecated in favor of dart-lang/language#870),
  • [ ] avoid_null_checks_in_equality_operators (dart-lang/lints#200),
  • [x] library_names (dart-lang/lints#183)
  • [x] package_prefixed_library_names (dart-lang/lints#172), and
  • [x] prefer_void_to_null (dart-lang/lints#154; I've run into these false-positives).

Describe alternatives you've considered Again, put them in manually.

Additional context I'll PR this, if desired. Not really context, but 🤷‍♂️

lishaduck avatar Aug 10 '24 16:08 lishaduck

Oh, and the reason for prefer_final_parameters is that it's incompatible with avoid_final_parameters.

lishaduck avatar Aug 11 '24 23:08 lishaduck

Hi @lishaduck thanks for suggesting these new additions. I haven't had a time to have a deep dive into the false positives and read through the issues. The team will probably jump into these soon.

If you would like to contribute we're open for Pull Requests. From the ones you listed unnecessary_library_name seems like a reasonable addition since it is now recommend, are you interested in drafting a PR for it? It will be nice if we also update the recommendation table with it (see the linter rules tool).


Oh, and the reason for prefer_final_parameters is that it's incompatible with avoid_final_parameters.

Thanks for pointing this out! Feel free to open a Pull Request updating the reason and the team can jump into reviewing it to get it merged 🙌

alestiago avatar Aug 14 '24 14:08 alestiago

Oh, and type_literal_in_constant_pattern is in recommended now.


I'm looking through the lints repo to find as many exclusion reasons as possible, so I've also updated the list of lints to remove.

lishaduck avatar Aug 18 '24 20:08 lishaduck

Opened dart-lang/core#799, dart-lang/lints#122 and dart-lang/lints#123 to add the mentioned lint rules. I would like to add document_ignores as well but I'll need t o check in with our devs at VGV to see if they see the added value as well.

Also opened dart-lang/lints#124 to remove avoid_null_checks_in_equality_operators

wolfenrain avatar Nov 11 '24 11:11 wolfenrain

Just reviewed this with the team. We have all the suggestions implemented except for unnecessary_await_in_return which we want to hold on for now as the Dart team has not deprecated it yet. Were going to open up a new ticket to track that for the future and will tag this ticket in the process.

tomarra avatar Dec 10 '24 14:12 tomarra