diff --git a/docs/getting_started/command_line_interface.md b/docs/getting_started/command_line_interface.md index ecc431bf7b..adc984971e 100644 --- a/docs/getting_started/command_line_interface.md +++ b/docs/getting_started/command_line_interface.md @@ -87,6 +87,13 @@ However: There exist logical groups of flags that are shared between related subcommands. We discuss these below. +### Watch mode + +You can supply the `--watch` flag to `deno run` to enable the built in file +watcher. When Deno starts up with this flag it watches the entrypoint, and all +local files the entrypoint statically imports. Whenever one of these files is +changed on disk, the program will automatically be restarted. + ### Integrity flags Affect commands which can download resources to the cache: `deno cache`, diff --git a/docs/getting_started/typescript.md b/docs/getting_started/typescript.md index a72fd36895..6813206e00 100644 --- a/docs/getting_started/typescript.md +++ b/docs/getting_started/typescript.md @@ -16,9 +16,9 @@ import { queue } from "./collections.ts"; ### `--no-check` option -When using `deno run`, `deno test`, `deno cache`, `deno info`, or `deno bundle` -you can specify the `--no-check` flag to disable TypeScript type checking. This -can significantly reduce the time that program startup takes. This can be very +When using `deno run`, `deno test`, `deno cache`, or `deno bundle` you can +specify the `--no-check` flag to disable TypeScript type checking. This can +significantly reduce the time that program startup takes. This can be very useful when type checking is provided by your editor and you want startup time to be as fast as possible (for example when restarting the program automatically with a file watcher). @@ -31,9 +31,11 @@ To export a type in a different file use `export type { AnInterface } from "./mod.ts";`. To import a type use `import type { AnInterface } from "./mod.ts";`. You can check that you are using `import type` and `export type` where necessary by setting the `isolatedModules` -TypeScript compiler option to `true`. You can see an example `tsconfig.json` -with this option +TypeScript compiler option to `true`, and the `importsNotUsedAsValues` to +`error`. You can see an example `tsconfig.json` with this option [in the standard library](https://github.com/denoland/deno/blob/master/std/tsconfig_test.json). +These settings will be enabled by default in the future. They are already the +default in Deno 1.4 or above when using `--unstable`. Because there is no type information when using `--no-check`, `const enum` is not supported because it is type-directed. `--no-check` also does not support diff --git a/docs/testing.md b/docs/testing.md index bb27906701..db81ee3410 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -204,3 +204,29 @@ failure, you can specify the `--failfast` flag when running the suite. ```shell deno test --failfast ``` + +## Test coverage + +Deno will automatically determine test coverage for your code if you specify the +`--coverage` flag when starting `deno test`. Coverage is determined on a line by +line basis, and is acquired directly from the JavaScript runtime (V8). Because +of this, this coverage is very accurate. + +When all tests are done running a summary of coverage per file is printed to +stdout. In the future there will be support for `lcov` output too. + +``` +$ git clone git@github.com:denosaurs/deno_brotli.git && cd deno_brotli +$ deno test --coverage --unstable +Debugger listening on ws://127.0.0.1:9229/ws/5a593019-d185-478b-a928-ebc33e5834be +Check file:///home/deno/deno_brotli/.deno.test.ts +running 2 tests +test compress ... ok (26ms) +test decompress ... ok (13ms) + +test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (40ms) + +test coverage: +file:///home/deno/deno_brotli/mod.ts 100.000% +file:///home/deno/deno_brotli/wasm.js 100.000% +``` diff --git a/docs/tools/documentation_generator.md b/docs/tools/documentation_generator.md index 9971ed270d..fa8b09c9cf 100644 --- a/docs/tools/documentation_generator.md +++ b/docs/tools/documentation_generator.md @@ -1,9 +1,7 @@ ## Documentation Generator `deno doc` followed by a list of one or more source files will print the JSDoc -documentation for each of the module's **exported** members. Currently, only -exports in the style `export ` and `export ... from ...` are -supported. +documentation for each of the module's **exported** members. For example, given a file `add.ts` with the contents: @@ -29,5 +27,5 @@ function add(x: number, y: number): number Use the `--json` flag to output the documentation in JSON format. This JSON format is consumed by the -[deno doc website](https://github.com/denoland/doc_website) and used to generate -module documentation. +[deno doc website](https://github.com/denoland/doc_website) and is used to +generate module documentation. diff --git a/docs/tools/linter.md b/docs/tools/linter.md index f5af1543b3..62174a600d 100644 --- a/docs/tools/linter.md +++ b/docs/tools/linter.md @@ -51,9 +51,12 @@ For more detail, run `deno lint --help`. - `no-extra-boolean-cast` - `no-extra-non-null-assertion` - `no-extra-semi` +- `no-fallthrough` - `no-func-assign` -- `no-inner-declarations` +- `no-global-assign` +- `no-import-assign` - `no-inferrable-types` +- `no-inner-declarations` - `no-invalid-regexp` - `no-irregular-whitespace` - `no-misused-new` @@ -63,12 +66,14 @@ For more detail, run `deno lint --help`. - `no-obj-calls` - `no-octal` - `no-prototype-builtins` +- `no-redeclare` - `no-regex-spaces` - `no-self-assign` - `no-setter-return` - `no-shadow-restricted-names` - `no-this-alias` - `no-this-before-super` +- `no-undef` - `no-unreachable` - `no-unsafe-finally` - `no-unsafe-negation`