-
Notifications
You must be signed in to change notification settings - Fork 639
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
feat(tools): add import path check in docs #2820
Conversation
Nice! I'm not a maintainer, but a few concerns:
|
@iuioiua Thanks for the great suggestions!
|
@iuioiua I came up with some changes based on your comments. WDYT? |
This looks like something that will be nice to have. My only concerns are:
|
I think the solution is to use a proper ast tree walker. That would also be great to establish for future tools. The typescript module works for creating and walking ast trees, but there is also deno_ast, which is a rust mod but could (and imo should) be made runnable in deno scripts, like deno_doc is. So the task could be done like so: |
Looking better! However, I'm still wondering whether |
get rid of the less trustworthy and overcomplicated RegExp-based approach
@timreichen I implemented the AST-based approach using the typescript module. I think it's good for a first iteration until denoland/deno_ast#120 gets resolved. Later we can upgrade to the Rust-based, more performant AST generation subsystem. @cjihrig I added some tests so we have a better proof than just my words for that it's working. 😀 @iuioiua The counter is only used to display a message on exit which informs the user about that something happened, but no error raised in mora handy way than just exiting with 0 or a non-zero exit code. Just like |
In this case, seeing a change in the number of files justifies the existence of the variable, IMO. Well explained. |
Would it perhaps be better to use |
Great suggestion, makes it a bit less messy, applied. Thanks! |
@timreichen FYI: I also made an experiment which is using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add tool to check import paths in JSDoc comments and readme files across std to help standardize them as suggested in #2772. Enforcing that all imports in examples are from
https://deno.land/std@$STD_VERSION/*