diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-09-17 18:26:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-17 18:26:23 +0100 |
commit | a14e9f55b4efc39689e1cc76b44bc6c1be51efa5 (patch) | |
tree | 0a62a88e21eb6647157fc1f948008793b67bf0e9 | |
parent | 915b73571c40601b7f79fa4ee0f3035982e23b7f (diff) |
feat(fmt): sort type-only named import/exports last (#25690)
Closes #22583
-rw-r--r-- | .dprint.json | 2 | ||||
-rw-r--r-- | Cargo.lock | 4 | ||||
-rw-r--r-- | cli/Cargo.toml | 2 | ||||
-rw-r--r-- | cli/tools/fmt.rs | 3 | ||||
-rw-r--r-- | ext/node/polyfills/_fs/_fs_access.ts | 2 | ||||
-rw-r--r-- | ext/node/polyfills/_fs/_fs_chown.ts | 2 | ||||
-rw-r--r-- | ext/node/polyfills/_fs/_fs_lchown.ts | 2 | ||||
-rw-r--r-- | ext/node/polyfills/child_process.ts | 4 | ||||
-rw-r--r-- | ext/node/polyfills/https.ts | 2 | ||||
-rw-r--r-- | tests/testdata/repl/import_type.ts | 2 | ||||
-rw-r--r-- | tests/testdata/run/import_type.ts | 2 |
11 files changed, 15 insertions, 12 deletions
diff --git a/.dprint.json b/.dprint.json index 77ab01e02..193db6feb 100644 --- a/.dprint.json +++ b/.dprint.json @@ -64,7 +64,7 @@ "third_party" ], "plugins": [ - "https://plugins.dprint.dev/typescript-0.91.7.wasm", + "https://plugins.dprint.dev/typescript-0.92.0.wasm", "https://plugins.dprint.dev/json-0.19.3.wasm", "https://plugins.dprint.dev/markdown-0.17.8.wasm", "https://plugins.dprint.dev/toml-0.6.2.wasm", diff --git a/Cargo.lock b/Cargo.lock index 13f757f0e..b35269daa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2518,9 +2518,9 @@ dependencies = [ [[package]] name = "dprint-plugin-typescript" -version = "0.91.7" +version = "0.92.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243879526ffc78aeb111719c3180f95820847c28eeeffb8d2585d1ec15a44fe4" +checksum = "7e454b93b06b61a6cf76b921906074616052a29a16dba8119947669121283fc3" dependencies = [ "anyhow", "deno_ast", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index dda5a7a78..7dcd6456d 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -102,7 +102,7 @@ dotenvy = "0.15.7" dprint-plugin-json = "=0.19.3" dprint-plugin-jupyter = "=0.1.3" dprint-plugin-markdown = "=0.17.8" -dprint-plugin-typescript = "=0.91.7" +dprint-plugin-typescript = "=0.92.0" env_logger = "=0.10.0" fancy-regex = "=0.10.0" faster-hex.workspace = true diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs index 2b8beda37..17ddf6c65 100644 --- a/cli/tools/fmt.rs +++ b/cli/tools/fmt.rs @@ -311,6 +311,7 @@ fn format_markdown( codeblock_config.line_width = line_width; dprint_plugin_typescript::format_text( &fake_filename, + None, text.to_string(), &codeblock_config, ) @@ -405,6 +406,7 @@ pub fn format_html( typescript_config.line_width = hints.print_width as u32; dprint_plugin_typescript::format_text( &path, + None, text.to_string(), &typescript_config, ) @@ -498,6 +500,7 @@ pub fn format_file( let config = get_resolved_typescript_config(fmt_options); dprint_plugin_typescript::format_text( file_path, + None, file_text.to_string(), &config, ) diff --git a/ext/node/polyfills/_fs/_fs_access.ts b/ext/node/polyfills/_fs/_fs_access.ts index b501bcbca..1a9041e30 100644 --- a/ext/node/polyfills/_fs/_fs_access.ts +++ b/ext/node/polyfills/_fs/_fs_access.ts @@ -4,8 +4,8 @@ // deno-lint-ignore-file prefer-primordials import { - type CallbackWithError, makeCallback, + type CallbackWithError, } from "ext:deno_node/_fs/_fs_common.ts"; import { fs } from "ext:deno_node/internal_binding/constants.ts"; import { codeMap } from "ext:deno_node/internal_binding/uv.ts"; diff --git a/ext/node/polyfills/_fs/_fs_chown.ts b/ext/node/polyfills/_fs/_fs_chown.ts index 56364109d..3270095bf 100644 --- a/ext/node/polyfills/_fs/_fs_chown.ts +++ b/ext/node/polyfills/_fs/_fs_chown.ts @@ -4,8 +4,8 @@ // deno-lint-ignore-file prefer-primordials import { - type CallbackWithError, makeCallback, + type CallbackWithError, } from "ext:deno_node/_fs/_fs_common.ts"; import { getValidatedPath, diff --git a/ext/node/polyfills/_fs/_fs_lchown.ts b/ext/node/polyfills/_fs/_fs_lchown.ts index 8611c8021..50d777b53 100644 --- a/ext/node/polyfills/_fs/_fs_lchown.ts +++ b/ext/node/polyfills/_fs/_fs_lchown.ts @@ -4,8 +4,8 @@ // deno-lint-ignore-file prefer-primordials import { - type CallbackWithError, makeCallback, + type CallbackWithError, } from "ext:deno_node/_fs/_fs_common.ts"; import { getValidatedPath, diff --git a/ext/node/polyfills/child_process.ts b/ext/node/polyfills/child_process.ts index f77a430c2..017318878 100644 --- a/ext/node/polyfills/child_process.ts +++ b/ext/node/polyfills/child_process.ts @@ -18,11 +18,11 @@ import { ChildProcessOptions, normalizeSpawnArguments, setupChannel, - type SpawnOptions, spawnSync as _spawnSync, + stdioStringToArray, + type SpawnOptions, type SpawnSyncOptions, type SpawnSyncResult, - stdioStringToArray, } from "ext:deno_node/internal/child_process.ts"; import { validateAbortSignal, diff --git a/ext/node/polyfills/https.ts b/ext/node/polyfills/https.ts index f60c5e471..c95db6aa2 100644 --- a/ext/node/polyfills/https.ts +++ b/ext/node/polyfills/https.ts @@ -13,7 +13,7 @@ import { } from "node:http"; import { Agent as HttpAgent } from "node:_http_agent"; import { createHttpClient } from "ext:deno_fetch/22_http_client.js"; -import { type ServerHandler, ServerImpl as HttpServer } from "node:http"; +import { ServerImpl as HttpServer, type ServerHandler } from "node:http"; import { validateObject } from "ext:deno_node/internal/validators.mjs"; import { kEmptyObject } from "ext:deno_node/internal/util.mjs"; import { Buffer } from "node:buffer"; diff --git a/tests/testdata/repl/import_type.ts b/tests/testdata/repl/import_type.ts index 851ebad86..0bee21747 100644 --- a/tests/testdata/repl/import_type.ts +++ b/tests/testdata/repl/import_type.ts @@ -1,4 +1,4 @@ -import { type B, create } from "./subdir/export_types.ts"; +import { create, type B } from "./subdir/export_types.ts"; const b: B = create(); diff --git a/tests/testdata/run/import_type.ts b/tests/testdata/run/import_type.ts index 22c639cbc..65e140cda 100644 --- a/tests/testdata/run/import_type.ts +++ b/tests/testdata/run/import_type.ts @@ -1,4 +1,4 @@ -import { type B, create } from "../subdir/export_types.ts"; +import { create, type B } from "../subdir/export_types.ts"; const b: B = create(); |