dart-lang / linter

Linter for Dart.
https://dart.dev/tools/linter-rules
BSD 3-Clause "New" or "Revised" License
628 stars 170 forks source link

[enhanced-parts] Linter Support #5024

Open pq opened 2 months ago

pq commented 2 months ago

A meta-issue to discuss and track work on linter support for enhanced-parts.

Existing Lints

Some existing lints will need tests (minimally) and possibly enhanced implementations.

General Part Support

There are a number of outstanding issues with our support for parts. In support of this feature (and in anticipation) of greater adoption of parts, we might consider prioritizing some fixes.

bwilkerson commented 2 months ago

See also https://github.com/dart-lang/sdk/issues/56213, and note that the experiment name used here is different from the name used in the SDK issues.

pq commented 1 month ago

I'm making my way through the lints and thinking in general that they should "just work". If any exceptions jump out at anyone, I'd be grateful for the input!

/cc @eernstg @bwilkerson @lrhn

srawlins commented 1 month ago
eernstg commented 1 month ago

A couple of other things came to mind:

lrhn commented 1 month ago

For dangling_library_doc_comments, it only seem to apply to the library file, so no change should be necessary. I don't expect doc-comments on part of directives to behave differently from today. I don't know what they do today, but I'd expect them to be either ignored or concatenated with the library documentation from the library file. (Testing: Seems to be ignored.)

All the ones that refer to URIs or imports should definitely not bail out early on seeing part of. Then they should behave the same for the imports and URIs they find.

library_annotations shouldn't need changing. It can find a part of directive today, so nothing changed there. Any issues are pre-existing.