mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
feat(fmt): sort type-only named import/exports last (#25690)
Closes #22583
This commit is contained in:
parent
915b73571c
commit
a14e9f55b4
11 changed files with 15 additions and 12 deletions
|
@ -64,7 +64,7 @@
|
||||||
"third_party"
|
"third_party"
|
||||||
],
|
],
|
||||||
"plugins": [
|
"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/json-0.19.3.wasm",
|
||||||
"https://plugins.dprint.dev/markdown-0.17.8.wasm",
|
"https://plugins.dprint.dev/markdown-0.17.8.wasm",
|
||||||
"https://plugins.dprint.dev/toml-0.6.2.wasm",
|
"https://plugins.dprint.dev/toml-0.6.2.wasm",
|
||||||
|
|
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -2518,9 +2518,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dprint-plugin-typescript"
|
name = "dprint-plugin-typescript"
|
||||||
version = "0.91.7"
|
version = "0.92.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "243879526ffc78aeb111719c3180f95820847c28eeeffb8d2585d1ec15a44fe4"
|
checksum = "7e454b93b06b61a6cf76b921906074616052a29a16dba8119947669121283fc3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"deno_ast",
|
"deno_ast",
|
||||||
|
|
|
@ -102,7 +102,7 @@ dotenvy = "0.15.7"
|
||||||
dprint-plugin-json = "=0.19.3"
|
dprint-plugin-json = "=0.19.3"
|
||||||
dprint-plugin-jupyter = "=0.1.3"
|
dprint-plugin-jupyter = "=0.1.3"
|
||||||
dprint-plugin-markdown = "=0.17.8"
|
dprint-plugin-markdown = "=0.17.8"
|
||||||
dprint-plugin-typescript = "=0.91.7"
|
dprint-plugin-typescript = "=0.92.0"
|
||||||
env_logger = "=0.10.0"
|
env_logger = "=0.10.0"
|
||||||
fancy-regex = "=0.10.0"
|
fancy-regex = "=0.10.0"
|
||||||
faster-hex.workspace = true
|
faster-hex.workspace = true
|
||||||
|
|
|
@ -311,6 +311,7 @@ fn format_markdown(
|
||||||
codeblock_config.line_width = line_width;
|
codeblock_config.line_width = line_width;
|
||||||
dprint_plugin_typescript::format_text(
|
dprint_plugin_typescript::format_text(
|
||||||
&fake_filename,
|
&fake_filename,
|
||||||
|
None,
|
||||||
text.to_string(),
|
text.to_string(),
|
||||||
&codeblock_config,
|
&codeblock_config,
|
||||||
)
|
)
|
||||||
|
@ -405,6 +406,7 @@ pub fn format_html(
|
||||||
typescript_config.line_width = hints.print_width as u32;
|
typescript_config.line_width = hints.print_width as u32;
|
||||||
dprint_plugin_typescript::format_text(
|
dprint_plugin_typescript::format_text(
|
||||||
&path,
|
&path,
|
||||||
|
None,
|
||||||
text.to_string(),
|
text.to_string(),
|
||||||
&typescript_config,
|
&typescript_config,
|
||||||
)
|
)
|
||||||
|
@ -498,6 +500,7 @@ pub fn format_file(
|
||||||
let config = get_resolved_typescript_config(fmt_options);
|
let config = get_resolved_typescript_config(fmt_options);
|
||||||
dprint_plugin_typescript::format_text(
|
dprint_plugin_typescript::format_text(
|
||||||
file_path,
|
file_path,
|
||||||
|
None,
|
||||||
file_text.to_string(),
|
file_text.to_string(),
|
||||||
&config,
|
&config,
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
// deno-lint-ignore-file prefer-primordials
|
// deno-lint-ignore-file prefer-primordials
|
||||||
|
|
||||||
import {
|
import {
|
||||||
type CallbackWithError,
|
|
||||||
makeCallback,
|
makeCallback,
|
||||||
|
type CallbackWithError,
|
||||||
} from "ext:deno_node/_fs/_fs_common.ts";
|
} from "ext:deno_node/_fs/_fs_common.ts";
|
||||||
import { fs } from "ext:deno_node/internal_binding/constants.ts";
|
import { fs } from "ext:deno_node/internal_binding/constants.ts";
|
||||||
import { codeMap } from "ext:deno_node/internal_binding/uv.ts";
|
import { codeMap } from "ext:deno_node/internal_binding/uv.ts";
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
// deno-lint-ignore-file prefer-primordials
|
// deno-lint-ignore-file prefer-primordials
|
||||||
|
|
||||||
import {
|
import {
|
||||||
type CallbackWithError,
|
|
||||||
makeCallback,
|
makeCallback,
|
||||||
|
type CallbackWithError,
|
||||||
} from "ext:deno_node/_fs/_fs_common.ts";
|
} from "ext:deno_node/_fs/_fs_common.ts";
|
||||||
import {
|
import {
|
||||||
getValidatedPath,
|
getValidatedPath,
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
// deno-lint-ignore-file prefer-primordials
|
// deno-lint-ignore-file prefer-primordials
|
||||||
|
|
||||||
import {
|
import {
|
||||||
type CallbackWithError,
|
|
||||||
makeCallback,
|
makeCallback,
|
||||||
|
type CallbackWithError,
|
||||||
} from "ext:deno_node/_fs/_fs_common.ts";
|
} from "ext:deno_node/_fs/_fs_common.ts";
|
||||||
import {
|
import {
|
||||||
getValidatedPath,
|
getValidatedPath,
|
||||||
|
|
|
@ -18,11 +18,11 @@ import {
|
||||||
ChildProcessOptions,
|
ChildProcessOptions,
|
||||||
normalizeSpawnArguments,
|
normalizeSpawnArguments,
|
||||||
setupChannel,
|
setupChannel,
|
||||||
type SpawnOptions,
|
|
||||||
spawnSync as _spawnSync,
|
spawnSync as _spawnSync,
|
||||||
|
stdioStringToArray,
|
||||||
|
type SpawnOptions,
|
||||||
type SpawnSyncOptions,
|
type SpawnSyncOptions,
|
||||||
type SpawnSyncResult,
|
type SpawnSyncResult,
|
||||||
stdioStringToArray,
|
|
||||||
} from "ext:deno_node/internal/child_process.ts";
|
} from "ext:deno_node/internal/child_process.ts";
|
||||||
import {
|
import {
|
||||||
validateAbortSignal,
|
validateAbortSignal,
|
||||||
|
|
|
@ -13,7 +13,7 @@ import {
|
||||||
} from "node:http";
|
} from "node:http";
|
||||||
import { Agent as HttpAgent } from "node:_http_agent";
|
import { Agent as HttpAgent } from "node:_http_agent";
|
||||||
import { createHttpClient } from "ext:deno_fetch/22_http_client.js";
|
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 { validateObject } from "ext:deno_node/internal/validators.mjs";
|
||||||
import { kEmptyObject } from "ext:deno_node/internal/util.mjs";
|
import { kEmptyObject } from "ext:deno_node/internal/util.mjs";
|
||||||
import { Buffer } from "node:buffer";
|
import { Buffer } from "node:buffer";
|
||||||
|
|
2
tests/testdata/repl/import_type.ts
vendored
2
tests/testdata/repl/import_type.ts
vendored
|
@ -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();
|
const b: B = create();
|
||||||
|
|
||||||
|
|
2
tests/testdata/run/import_type.ts
vendored
2
tests/testdata/run/import_type.ts
vendored
|
@ -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();
|
const b: B = create();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue