summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2021-06-06 18:42:12 +0200
committerGitHub <noreply@github.com>2021-06-06 18:42:12 +0200
commit3b220c64f615a4e18346e8a1c07ad7b1aae9fcc6 (patch)
tree9329ed9e4d9881c1ac166aef65ea2821fc121761 /cli
parenta66f327250d9df77816e80e7d411b232f8b08b11 (diff)
chore: upgrade crates (#10867)
* deno_doc - 0.5.0 * deno_lint - 0.6.0 * dprint-plugin-typescript - 0.46.0 * dprint-plugin-markdown - 0.8.0 * dprint-plugin-json - 0.12.0 * swc_bundler - 0.37.4 * swc_ecmascript - 0.36.0
Diffstat (limited to 'cli')
-rw-r--r--cli/Cargo.toml16
-rw-r--r--cli/ast.rs3
-rw-r--r--cli/tools/fmt.rs7
3 files changed, 16 insertions, 10 deletions
diff --git a/cli/Cargo.toml b/cli/Cargo.toml
index c669a7047..67c7401b2 100644
--- a/cli/Cargo.toml
+++ b/cli/Cargo.toml
@@ -42,8 +42,8 @@ winres = "0.1.11"
[dependencies]
deno_core = { path = "../core", version = "0.88.1" }
-deno_doc = "0.4.0"
-deno_lint = "0.5.0"
+deno_doc = "0.5.0"
+deno_lint = "0.6.0"
deno_runtime = { path = "../runtime", version = "0.15.1" }
atty = "0.2.14"
@@ -52,9 +52,9 @@ byteorder = "1.4.3"
clap = "2.33.3"
data-url = "0.1.0"
dissimilar = "1.0.2"
-dprint-plugin-json = "0.10.2"
-dprint-plugin-markdown = "0.7.1"
-dprint-plugin-typescript = "0.45.0"
+dprint-plugin-json = "0.12.0"
+dprint-plugin-markdown = "0.8.0"
+dprint-plugin-typescript = "0.46.0"
encoding_rs = "0.8.28"
env_logger = "0.8.3"
fancy-regex = "0.5.0"
@@ -78,9 +78,9 @@ semver-parser = "0.10.2"
serde = { version = "1.0.125", features = ["derive"] }
shell-escape = "0.1.5"
sourcemap = "6.0.1"
-swc_bundler = "0.34.0"
-swc_common = { version = "0.10.18", features = ["sourcemap"] }
-swc_ecmascript = { version = "0.33.0", features = ["codegen", "dep_graph", "parser", "proposal", "react", "transforms", "typescript", "visit"] }
+swc_bundler = "0.37.4"
+swc_common = { version = "0.10.20", features = ["sourcemap"] }
+swc_ecmascript = { version = "0.36.0", features = ["codegen", "dep_graph", "parser", "proposal", "react", "transforms", "typescript", "visit"] }
tempfile = "3.2.0"
termcolor = "1.1.2"
text-size = "1.1.0"
diff --git a/cli/ast.rs b/cli/ast.rs
index 636dc1881..f5e8802e6 100644
--- a/cli/ast.rs
+++ b/cli/ast.rs
@@ -273,6 +273,9 @@ fn strip_config_from_emit_options(
}
},
use_define_for_class_fields: true,
+ // TODO(bartlomieju): this could be changed to `false` to provide `export {}`
+ // in Typescript files without manual changes
+ no_empty_export: true,
}
}
diff --git a/cli/tools/fmt.rs b/cli/tools/fmt.rs
index 869403f07..ac9af0292 100644
--- a/cli/tools/fmt.rs
+++ b/cli/tools/fmt.rs
@@ -101,7 +101,7 @@ fn format_markdown(
dprint_plugin_markdown::format_text(
&file_text,
&md_config,
- Box::new(move |tag, text, line_width| {
+ move |tag, text, line_width| {
let tag = tag.to_lowercase();
if matches!(
tag.as_str(),
@@ -140,8 +140,9 @@ fn format_markdown(
} else {
Ok(text.to_string())
}
- }),
+ },
)
+ .map_err(|e| e.to_string())
}
/// Formats JSON and JSONC using the rules provided by .deno()
@@ -150,6 +151,7 @@ fn format_markdown(
fn format_json(file_text: &str) -> Result<String, String> {
let json_config = get_json_config();
dprint_plugin_json::format_text(&file_text, &json_config)
+ .map_err(|e| e.to_string())
}
/// Formats a single TS, TSX, JS, JSX, JSONC, JSON, or MD file.
@@ -165,6 +167,7 @@ pub fn format_file(
format_json(&file_text)
} else {
dprint_plugin_typescript::format_text(&file_path, &file_text, &config)
+ .map_err(|e| e.to_string())
}
}