1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00
denoland-deno/cli/tests/testdata/doc
David Sherret d1ef561dbf
feat: deno doc --lint (#21032)
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
2023-10-31 18:19:42 -04:00
..
module chore: move test files to testdata directory (#11601) 2021-08-11 10:20:47 -04:00
060_deno_doc_displays_all_overloads_in_details_view.ts refactor: move out test files from root testdata directory into sub directories (#15949) 2022-09-19 10:32:21 -04:00
060_deno_doc_displays_all_overloads_in_details_view.ts.out refactor: update to deno_doc 0.71 (#21023) 2023-10-31 09:19:43 +05:30
deno_doc.ts refactor: move out test files from root testdata directory into sub directories (#15949) 2022-09-19 10:32:21 -04:00
deno_doc2.ts feat(doc): support multiple file entry (#21018) 2023-10-30 23:58:57 +01:00
deno_doc_builtin.out refactor: move out test files from root testdata directory into sub directories (#15949) 2022-09-19 10:32:21 -04:00
import_map.json chore: move test files to testdata directory (#11601) 2021-08-11 10:20:47 -04:00
invalid_url.out chore: move test files to testdata directory (#11601) 2021-08-11 10:20:47 -04:00
referenced_private_types.out refactor: update to deno_doc 0.71 (#21023) 2023-10-31 09:19:43 +05:30
referenced_private_types.ts feat(doc): display non-exported types referenced in exported types (#20990) 2023-10-26 21:27:50 -04:00
referenced_private_types_fixed.out feat: deno doc --lint (#21032) 2023-10-31 18:19:42 -04:00
referenced_private_types_fixed.ts feat: deno doc --lint (#21032) 2023-10-31 18:19:42 -04:00
referenced_private_types_lint.out feat: deno doc --lint (#21032) 2023-10-31 18:19:42 -04:00
types_header.out refactor: update to deno_doc 0.71 (#21023) 2023-10-31 09:19:43 +05:30
types_header.ts chore: move test files to testdata directory (#11601) 2021-08-11 10:20:47 -04:00
types_hint.out refactor: update to deno_doc 0.71 (#21023) 2023-10-31 09:19:43 +05:30
types_hint.ts chore: move test files to testdata directory (#11601) 2021-08-11 10:20:47 -04:00
types_ref.js chore: move test files to testdata directory (#11601) 2021-08-11 10:20:47 -04:00
types_ref.out refactor: update to deno_doc 0.71 (#21023) 2023-10-31 09:19:43 +05:30
use_import_map.js chore: move test files to testdata directory (#11601) 2021-08-11 10:20:47 -04:00
use_import_map.out refactor: update to deno_doc 0.71 (#21023) 2023-10-31 09:19:43 +05:30