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

`public_member_api_docs ` should also highlight library statements. #4962

Open sigurdm opened 4 months ago

sigurdm commented 4 months ago

See https://github.com/dart-lang/pana/issues/1355 for a bit of discussion

image
jonasfj commented 4 months ago

This should only apply to library statements in public libraries. Meaning, it doesn't have to apply to files in:

Basically, only files in lib/ excluding lib/src/.


It's also entirely reasonable that we should complain about missing library statement. Because all libraries will have a documentation page, even if they don't have a library statement.

srawlins commented 4 months ago

As this would be a massively breaking, impossible-to-land change, I think this will take the shape of a new lint rule 😄

bwilkerson commented 4 months ago

I agree, a new lint is probably the best path forward, maybe something like public_library_api_docs. I'm not sure I'd restrict it to public libraries that have a library directive, though. Seems like all public libraries should have docs?