diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2020-07-14 15:24:17 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-14 15:24:17 -0400 |
| commit | cde4dbb35132848ffece59ef9cfaccff32347124 (patch) | |
| tree | cc7830968c6decde704c8cfb83c9185193dc698f /docs | |
| parent | 9eca71caa1674c31f9cc5d4e86c03f10b59e0a00 (diff) | |
Use dprint for internal formatting (#6682)
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/contributing/style_guide.md | 21 | ||||
| -rw-r--r-- | docs/getting_started/webassembly.md | 4 | ||||
| -rw-r--r-- | docs/introduction.md | 5 | ||||
| -rw-r--r-- | docs/linking_to_external_code/reloading_modules.md | 1 | ||||
| -rw-r--r-- | docs/runtime/compiler_apis.md | 8 | ||||
| -rw-r--r-- | docs/testing/assertions.md | 6 | ||||
| -rw-r--r-- | docs/tools.md | 5 | ||||
| -rw-r--r-- | docs/tools/formatter.md | 4 | ||||
| -rw-r--r-- | docs/tools/script_installer.md | 2 |
9 files changed, 22 insertions, 34 deletions
diff --git a/docs/contributing/style_guide.md b/docs/contributing/style_guide.md index 6c0e73b50..a54f29281 100644 --- a/docs/contributing/style_guide.md +++ b/docs/contributing/style_guide.md @@ -85,28 +85,23 @@ When designing function interfaces, stick to the following rules. there is only one, and it seems inconceivable that we would add more optional parameters in the future. -<!-- prettier-ignore-start --> -<!-- see https://github.com/prettier/prettier/issues/3679 --> - 3. The 'options' argument is the only argument that is a regular 'Object'. Other arguments can be objects, but they must be distinguishable from a 'plain' Object runtime, by having either: - - a distinguishing prototype (e.g. `Array`, `Map`, `Date`, `class MyThing`) - - a well-known symbol property (e.g. an iterable with `Symbol.iterator`). + - a distinguishing prototype (e.g. `Array`, `Map`, `Date`, `class MyThing`) + - a well-known symbol property (e.g. an iterable with `Symbol.iterator`). This allows the API to evolve in a backwards compatible way, even when the position of the options object changes. -<!-- prettier-ignore-end --> - ```ts // BAD: optional parameters not part of options object. (#2) export function resolve( hostname: string, family?: "ipv4" | "ipv6", - timeout?: number + timeout?: number, ): IPAddress[] {} // GOOD. @@ -116,7 +111,7 @@ export interface ResolveOptions { } export function resolve( hostname: string, - options: ResolveOptions = {} + options: ResolveOptions = {}, ): IPAddress[] {} ``` @@ -135,7 +130,7 @@ export interface RunShellOptions { } export function runShellWithEnv( cmdline: string, - options: RunShellOptions + options: RunShellOptions, ): string {} ``` @@ -145,7 +140,7 @@ export function renameSync( oldname: string, newname: string, replaceExisting?: boolean, - followLinks?: boolean + followLinks?: boolean, ) {} // GOOD. @@ -156,7 +151,7 @@ interface RenameOptions { export function renameSync( oldname: string, newname: string, - options: RenameOptions = {} + options: RenameOptions = {}, ) {} ``` @@ -167,7 +162,7 @@ export function pwrite( buffer: TypedArray, offset: number, length: number, - position: number + position: number, ) {} // BETTER. diff --git a/docs/getting_started/webassembly.md b/docs/getting_started/webassembly.md index ba8a52f7c..613be2fcd 100644 --- a/docs/getting_started/webassembly.md +++ b/docs/getting_started/webassembly.md @@ -2,7 +2,8 @@ Deno can execute [WebAssembly](https://webassembly.org/) binaries. -<!-- prettier-ignore-start --> +<!-- dprint-ignore --> + ```js const wasmCode = new Uint8Array([ 0, 97, 115, 109, 1, 0, 0, 0, 1, 133, 128, 128, 128, 0, 1, 96, 0, 1, 127, @@ -16,4 +17,3 @@ const wasmModule = new WebAssembly.Module(wasmCode); const wasmInstance = new WebAssembly.Instance(wasmModule); console.log(wasmInstance.exports.main().toString()); ``` -<!-- prettier-ignore-end --> diff --git a/docs/introduction.md b/docs/introduction.md index cdc8c6cb5..738305885 100644 --- a/docs/introduction.md +++ b/docs/introduction.md @@ -14,8 +14,9 @@ It's built on V8, Rust, and Tokio. - Has built-in utilities like a dependency inspector (`deno info`) and a code formatter (`deno fmt`). - Has - [a set of reviewed (audited) standard modules](https://github.com/denoland/deno/tree/master/std) - that are guaranteed to work with Deno. + [a set of reviewed (audited) standard + modules](https://github.com/denoland/deno/tree/master/std) that are guaranteed + to work with Deno. - Scripts can be bundled into a single JavaScript file. ## Philosophy diff --git a/docs/linking_to_external_code/reloading_modules.md b/docs/linking_to_external_code/reloading_modules.md index 01300a5c3..136107a63 100644 --- a/docs/linking_to_external_code/reloading_modules.md +++ b/docs/linking_to_external_code/reloading_modules.md @@ -10,7 +10,6 @@ usage is described below: ```ts deno cache --reload my_module.ts - ``` ### To reload specific modules diff --git a/docs/runtime/compiler_apis.md b/docs/runtime/compiler_apis.md index c2d234836..31d0af2d1 100644 --- a/docs/runtime/compiler_apis.md +++ b/docs/runtime/compiler_apis.md @@ -48,7 +48,7 @@ could do on the command line. So you could do something like this: ```ts const [diagnostics, emitMap] = await Deno.compile( - "https://deno.land/std/examples/welcome.ts" + "https://deno.land/std/examples/welcome.ts", ); ``` @@ -95,7 +95,7 @@ could do on the command line. So you could do something like this: ```ts const [diagnostics, emit] = await Deno.bundle( - "https://deno.land/std/http/server.ts" + "https://deno.land/std/http/server.ts", ); ``` @@ -151,7 +151,7 @@ const [errors, emitted] = await Deno.compile( }, { lib: ["dom", "esnext"], - } + }, ); ``` @@ -191,7 +191,7 @@ const [errors, emitted] = await Deno.compile( }, { lib: ["dom", "esnext", "deno.ns"], - } + }, ); ``` diff --git a/docs/testing/assertions.md b/docs/testing/assertions.md index 93b73da96..b8874a0e9 100644 --- a/docs/testing/assertions.md +++ b/docs/testing/assertions.md @@ -150,7 +150,7 @@ Deno.test("Test Assert Throws", () => { throw new Error("Panic!"); }, Error, - "Panic!" + "Panic!", ); }); ``` @@ -168,7 +168,7 @@ Deno.test("Test Assert Throws Async", () => { }); }, Error, - "Panic! Threw Error" + "Panic! Threw Error", ); assertThrowsAsync( @@ -176,7 +176,7 @@ Deno.test("Test Assert Throws Async", () => { return Promise.reject(new Error("Panic! Reject Error")); }, Error, - "Panic! Reject Error" + "Panic! Reject Error", ); }); ``` diff --git a/docs/tools.md b/docs/tools.md index 5307a6a89..76f54e6bc 100644 --- a/docs/tools.md +++ b/docs/tools.md @@ -3,9 +3,6 @@ Deno provides some built in tooling that is useful when working with JavaScript and TypeScript: -<!-- prettier-ignore-start --> -<!-- prettier incorrectly moves the coming soon links to new lines --> - - [bundler (`deno bundle`)](./tools/bundler.md) - [debugger (`--inspect, --inspect-brk`)](./tools/debugger.md) - [dependency inspector (`deno info`)](./tools/dependency_inspector.md) @@ -13,5 +10,3 @@ and TypeScript: - [formatter (`deno fmt`)](./tools/formatter.md) - [test runner (`deno test`)](./testing.md) - [linter (`deno lint`)](./tools/linter.md) - -<!-- prettier-ignore-end --> diff --git a/docs/tools/formatter.md b/docs/tools/formatter.md index 16a5a9ab4..aedb6bdc9 100644 --- a/docs/tools/formatter.md +++ b/docs/tools/formatter.md @@ -16,8 +16,6 @@ cat file.ts | deno fmt - Ignore formatting code by preceding it with a `// deno-fmt-ignore` comment: -<!-- prettier-ignore-start --> - ```ts // deno-fmt-ignore export const identity = [ @@ -27,7 +25,5 @@ export const identity = [ ]; ``` -<!-- prettier-ignore-end --> - Or ignore an entire file by adding a `// deno-fmt-ignore-file` comment at the top of the file. diff --git a/docs/tools/script_installer.md b/docs/tools/script_installer.md index 5f388fc6d..68db10d61 100644 --- a/docs/tools/script_installer.md +++ b/docs/tools/script_installer.md @@ -66,6 +66,8 @@ idiom to specify the entry point in an executable script. Example: +<!-- dprint-ignore --> + ```ts // https://example.com/awesome/cli.ts async function myAwesomeCli(): Promise<void> { |
