-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New lint for doc imports #59741
Comments
There is some room for judgement here, and doc imports are a feature that probably needs some additional support, but we should have a holistic design that takes enhanced-parts into account. |
Just to reference it here properly, I've opened #59759 to make the quick fixes for |
@srawlins talked about these points at dart-lang/dartdoc#3935 (comment):
I'm also suggesting:
|
Sorry, I focused too much on the suggestion that this be done via lints. In my mind "lint" has a very specific meaning: a diagnostic that is disabled by default. I'm not convinced that that's the right UX. We generally use a lint when there's some ambiguity or a chance for false positives, and in this case there isn't. However, the need for additional diagnostics to improve the UX around normal and dc imports is undisputed. That said, I think we need to do some UX design work around imports in light of enhanced parts, and I think it would be more efficient if that design also accounted for the UX related to doc imports. In other words, I'd like to have a plan for what UX we want to support given both changes to the language and then plan steps to get there, rather than taking steps that seem good in isolation but that might not be optimal in the long run. |
About that, I was wondering where would auto-complete and quick-fixes add imports now. Currently, I believe they would add it all to the main file, but if we have a three-level part library ( Is there an issue to discuss anything related to that? |
Yes, that's one of the UX questions that needs to be considered. No, I don't think we have an issue to discuss it. I find it hard to do design in a thread (issue, email, chat, etc.) because I can't remove the noise once we start making concrete decisions, and I can't tell which aspects of the design are still incomplete. I do want to hear from the community, but a doc feels like a much better forum for proposing and refining designs. I suppose we can start in an issue, but I'll want to move the discussion at some point. |
After a small discussion on both #59724 and #59723 I feel like we could have a lint that suggests converting a normal import into a doc import if it is not being used anywhere else besides doc comments. Maybe to remove a doc import if it is already imported normally too? Something like
organize_doc_imports
(if it does the second part if not,prefer_doc_imports
is probably better) or something (name suggestions are appreciated).@bwilkerson wrote on #59722 (comment):
I'm unsure if this is "a new language feature" and if this is important enough to be considered (and I'm not from the language team hahaha) but I'm fine with waiting.
The text was updated successfully, but these errors were encountered: