mirror of
https://github.com/denoland/deno.git
synced 2024-11-30 16:40:57 -05:00
d1ef561dbf
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 https://github.com/denoland/deno_lint/pull/972 Closes https://github.com/denoland/deno_lint/issues/970 Closes https://github.com/denoland/deno/issues/19356 |
||
---|---|---|
.. | ||
bench_tests.rs | ||
bundle_tests.rs | ||
cache_tests.rs | ||
cert_tests.rs | ||
check_tests.rs | ||
compile_tests.rs | ||
coverage_tests.rs | ||
doc_tests.rs | ||
eval_tests.rs | ||
flags_tests.rs | ||
fmt_tests.rs | ||
info_tests.rs | ||
init_tests.rs | ||
inspector_tests.rs | ||
install_tests.rs | ||
js_unit_tests.rs | ||
jsr_tests.rs | ||
lint_tests.rs | ||
lsp_tests.rs | ||
mod.rs | ||
node_compat_tests.rs | ||
node_unit_tests.rs | ||
npm_tests.rs | ||
repl_tests.rs | ||
run_tests.rs | ||
shared_library_tests.rs | ||
task_tests.rs | ||
test_tests.rs | ||
upgrade_tests.rs | ||
vendor_tests.rs | ||
watcher_tests.rs | ||
worker_tests.rs |