summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/Cargo.toml10
-rw-r--r--cli/lint.rs10
-rw-r--r--cli/tests/bundle/fixture11.out4
-rw-r--r--cli/tests/lint/expected_from_stdin_json.out2
-rw-r--r--cli/tests/lint/expected_json.out4
-rw-r--r--cli/tests/lint/expected_quiet.out2
6 files changed, 20 insertions, 12 deletions
diff --git a/cli/Cargo.toml b/cli/Cargo.toml
index 6b1859647..074ff1607 100644
--- a/cli/Cargo.toml
+++ b/cli/Cargo.toml
@@ -30,8 +30,8 @@ winapi = "0.3.9"
[dependencies]
deno_core = { path = "../core", version = "0.65.0" }
-deno_doc = "0.1.13"
-deno_lint = "0.2.5"
+deno_doc = "0.1.14"
+deno_lint = "0.2.7"
deno_web = { path = "../op_crates/web", version = "0.16.0" }
deno_fetch = { path = "../op_crates/fetch", version = "0.8.0" }
@@ -43,7 +43,7 @@ clap = "2.33.3"
dissimilar = "1.0.2"
dlopen = "0.1.8"
encoding_rs = "0.8.24"
-dprint-plugin-typescript = "0.32.6"
+dprint-plugin-typescript = "0.32.7"
filetime = "0.2.12"
http = "0.2.1"
indexmap = "1.6.0"
@@ -61,9 +61,9 @@ rustyline-derive = "0.3.1"
serde = { version = "1.0.116", features = ["derive"] }
sys-info = "0.7.0"
sourcemap = "6.0.1"
-swc_bundler = "=0.12.0"
+swc_bundler = "=0.14.1"
swc_common = { version = "=0.10.4", features = ["sourcemap"] }
-swc_ecmascript = { version = "=0.11.1", features = ["codegen", "dep_graph", "parser", "react", "transforms", "visit"] }
+swc_ecmascript = { version = "=0.13.1", features = ["codegen", "dep_graph", "parser", "react", "transforms", "visit"] }
tempfile = "3.1.0"
termcolor = "1.1.0"
tokio = { version = "0.2.22", features = ["full"] }
diff --git a/cli/lint.rs b/cli/lint.rs
index b7ab7baa4..255089053 100644
--- a/cli/lint.rs
+++ b/cli/lint.rs
@@ -15,6 +15,7 @@ use crate::media_type::MediaType;
use deno_core::error::{generic_error, AnyError, JsStackFrame};
use deno_core::serde_json;
use deno_lint::diagnostic::LintDiagnostic;
+use deno_lint::linter::FileType;
use deno_lint::linter::Linter;
use deno_lint::linter::LinterBuilder;
use deno_lint::rules;
@@ -139,7 +140,8 @@ fn lint_file(
let lint_rules = rules::get_recommended_rules();
let mut linter = create_linter(syntax, lint_rules);
- let file_diagnostics = linter.lint(file_name, source_code.clone())?;
+ let file_diagnostics =
+ linter.lint(file_name, source_code.clone(), FileType::Module)?;
Ok((file_diagnostics, source_code))
}
@@ -165,7 +167,11 @@ fn lint_stdin(json: bool) -> Result<(), AnyError> {
let mut has_error = false;
let pseudo_file_name = "_stdin.ts";
match linter
- .lint(pseudo_file_name.to_string(), source.clone())
+ .lint(
+ pseudo_file_name.to_string(),
+ source.clone(),
+ FileType::Module,
+ )
.map_err(|e| e.into())
{
Ok(diagnostics) => {
diff --git a/cli/tests/bundle/fixture11.out b/cli/tests/bundle/fixture11.out
index 2d1c966a1..526693ef2 100644
--- a/cli/tests/bundle/fixture11.out
+++ b/cli/tests/bundle/fixture11.out
@@ -6,9 +6,9 @@ var O;
O1[O1["A"] = 0] = "A";
O1[O1["B"] = 1] = "B";
O1[O1["C"] = 2] = "C";
-})((void 0) || (O = {
+})(O || (O = {
}));
-const O1 = void 0;
+const O1 = O;
export { O1 as O };
class A {
#a;
diff --git a/cli/tests/lint/expected_from_stdin_json.out b/cli/tests/lint/expected_from_stdin_json.out
index 611b95d08..262d40b30 100644
--- a/cli/tests/lint/expected_from_stdin_json.out
+++ b/cli/tests/lint/expected_from_stdin_json.out
@@ -16,7 +16,7 @@
"filename": "_stdin.ts",
"message": "`any` type is not allowed",
"code": "no-explicit-any",
- "hint": null
+ "hint": [WILDCARD]
}
],
"errors": []
diff --git a/cli/tests/lint/expected_json.out b/cli/tests/lint/expected_json.out
index 20dd47d8c..f29d311f5 100644
--- a/cli/tests/lint/expected_json.out
+++ b/cli/tests/lint/expected_json.out
@@ -34,7 +34,7 @@
"filename": "[WILDCARD]file1.js",
"message": "Empty block statement",
"code": "no-empty",
- "hint": null
+ "hint": [WILDCARD]
},
{
"range": {
@@ -52,7 +52,7 @@
"filename": "[WILDCARD]file2.ts",
"message": "Empty block statement",
"code": "no-empty",
- "hint": null
+ "hint": [WILDCARD]
}
],
"errors": [
diff --git a/cli/tests/lint/expected_quiet.out b/cli/tests/lint/expected_quiet.out
index 21fd92be3..d7c9d7bb9 100644
--- a/cli/tests/lint/expected_quiet.out
+++ b/cli/tests/lint/expected_quiet.out
@@ -10,3 +10,5 @@ while (false) {}
^^
at [WILDCARD]file1.js:2:14
+ hint: [WILDCARD]
+