You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found it misleading that the usage docs state that you can call ts-auto-guard on a source file without either specifying --export-all or the requirements for comments to indicate which are exported. It would be clearer for the docs to give the --export-all usage first, then clarify that it can be controlled on a case-by-case basis via comments.
Also, nowhere does it state that the interfaces must be exported. Internal interfaces are a valid use case, but of course the export is required due to the nature of the generated guard implementation. I don't think that can be resolved without inserting the guards into the original source which creates its own issue, so a usage not explicitly stating that only exported interfaces will be processed would be helpful.
The text was updated successfully, but these errors were encountered:
Hi there, sorry for the slow reply. Start of the year etc.
It would be clearer for the docs to give the --export-all usage first, then clarify that it can be controlled on a case-by-case basis via comments.
Honestly I'd rather not bring this to the forefront as it's better practice to use the explicit annotation IMO.
Also, nowhere does it state that the interfaces must be exported. Internal interfaces are a valid use case, but of course the export is required due to the nature of the generated guard implementation.
Yes, right now it's only in a comment in the example code. PR welcome.
I don't think that can be resolved without inserting the guards into the original source which creates its own issue, so a usage not explicitly stating that only exported interfaces will be processed would be helpful.
You ought to be adding the guard annotations to the original source, of, if that's not desirable, create a new source file that imports and exports them:
An improvement that could be made here is to check every single declaration at document root for the annotation and log a warning/error if it's not exported.
In any case there are surely improvements that could be made to the doc. A PR to prevent confusion in future would be more than welcome.
I found it misleading that the usage docs state that you can call ts-auto-guard on a source file without either specifying
--export-all
or the requirements for comments to indicate which are exported. It would be clearer for the docs to give the--export-all
usage first, then clarify that it can be controlled on a case-by-case basis via comments.Also, nowhere does it state that the interfaces must be
export
ed. Internal interfaces are a valid use case, but of course theexport
is required due to the nature of the generated guard implementation. I don't think that can be resolved without inserting the guards into the original source which creates its own issue, so a usage not explicitly stating that onlyexport
ed interfaces will be processed would be helpful.The text was updated successfully, but these errors were encountered: