-
Notifications
You must be signed in to change notification settings - Fork 172
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: add require-jsdoc rule #972
Conversation
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.
@ah-yu it looks good so far, but I believe we need to do it for more than just functions? Also, I think perhaps this should also look at public members of classes/interfaces?
src/rules/require_jsdoc.rs
Outdated
} | ||
} | ||
|
||
fn check_jsdoc_exsit<'c>( |
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.
typo: check_jsdoc_exists
added interfaces/classes jsdoc comment checks. |
@ah-yu the PR looked okay, what's the reason to close it? |
@dsherret please review, should we add more feature before landing? |
@bartlomieju Sorry for late response, I was kind of busy those days so I closed this PR. And I'd like to finish it. |
Hi @ah-yu, is there any way we could progress this PR? This change could be valuable for modules that'd like to enforce documentation. |
It would be definitely great to have something like rust |
Adds a new `--lint` flag to `deno doc` that surfaces three kinds of diagnostics: 1. Diagnostic for non-exported type referenced in an exported type. * Why? People often forget to export types from a module in TypeScript. To supress this diagnostic, add an `@internal` jsdoc tag to the internal type. 1. Diagnostic for missing return type or missing property type on a **public** type. * Why? Otherwise `deno doc` will not display good documentation. Adding explicit types also helps with type checking performance. 1. Diagnostic for missing jsdoc on a **public** type. * Why? Everything should be documented. This diagnostic can be supressed by adding a jsdoc comment description. If the lint passes, `deno doc` generates documentation as usual. For example, checking for deno doc diagnostics on the CI: ```shellsession $ deno doc --lint mod.ts second_entrypoint.ts > /dev/null ``` This feature is incredibly useful for library authors. ## Why not include this in `deno lint`? 1. The command needs the documenation output in order to figure out the diagnostics. 1. `deno lint` doesn't understand where the entrypoints are. That's critical for the diagnostics to be useful. 1. It's much more performant to do this while generating documentation. 1. There is precedence in rustdoc (ex. `#![warn(missing_docs)]`). ## Why not `--check`? It is confusing with `deno run --check`, since that means to run type checking (and confusing with `deno check --docs`). ## Output Future Improvement The output is not ideal atm, but it's fine for a first pass. We will improve it in the future. Closes denoland/deno_lint#972 Closes denoland/deno_lint#970 Closes #19356
Thanks, but we ended up going with a much more powerful linting system as part of |
ref #970