summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/Cargo.toml12
-rw-r--r--cli/ast.rs29
-rw-r--r--cli/tests/bundle/fixture13.out4
-rw-r--r--cli/tests/integration_tests.rs4
-rw-r--r--cli/tests/lint/expected_from_stdin_json.out8
-rw-r--r--cli/tests/lint/expected_json.out8
-rw-r--r--cli/tests/lint/file2.ts4
-rw-r--r--cli/tests/unit/buffer_test.ts2
-rw-r--r--cli/tests/unit/console_test.ts4
-rw-r--r--cli/tests/unit/dispatch_bin_test.ts1
-rw-r--r--cli/tests/unit/fetch_test.ts4
-rw-r--r--cli/tests/unit/filereader_test.ts2
-rw-r--r--cli/tests/unit/files_test.ts5
-rw-r--r--cli/tests/unit/globals_test.ts1
-rw-r--r--cli/tests/unit/headers_test.ts18
-rw-r--r--cli/tests/unit/http_test.ts4
-rw-r--r--cli/tests/unit/net_test.ts4
-rw-r--r--cli/tests/unit/test_util.ts1
-rw-r--r--cli/tests/unit/text_encoding_test.ts4
-rw-r--r--cli/tests/unit/timers_test.ts1
20 files changed, 63 insertions, 57 deletions
diff --git a/cli/Cargo.toml b/cli/Cargo.toml
index 689bf5888..41ab118c0 100644
--- a/cli/Cargo.toml
+++ b/cli/Cargo.toml
@@ -35,8 +35,8 @@ winres = "0.1.11"
[dependencies]
deno_core = { path = "../core", version = "0.83.0" }
-deno_doc = "0.1.23"
-deno_lint = "0.2.20"
+deno_doc = "0.2.1"
+deno_lint = "0.3.0"
deno_runtime = { path = "../runtime", version = "0.10.1" }
atty = "0.2.14"
@@ -46,7 +46,7 @@ clap = "2.33.3"
dissimilar = "1.0.2"
dprint-plugin-json = "0.10.1"
dprint-plugin-markdown = "0.6.2"
-dprint-plugin-typescript = "0.41.0"
+dprint-plugin-typescript = "0.44.0"
encoding_rs = "0.8.28"
env_logger = "0.8.3"
fancy-regex = "0.5.0"
@@ -69,9 +69,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.25.1"
-swc_common = { version = "0.10.14", features = ["sourcemap"] }
-swc_ecmascript = { version = "0.24.1", features = ["codegen", "dep_graph", "parser", "proposal", "react", "transforms", "typescript", "visit"] }
+swc_bundler = "0.32.0"
+swc_common = { version = "0.10.15", features = ["sourcemap"] }
+swc_ecmascript = { version = "0.31.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 bbd4df74d..83d0e16e9 100644
--- a/cli/ast.rs
+++ b/cli/ast.rs
@@ -254,20 +254,21 @@ impl From<tsc_config::TsConfig> for EmitOptions {
fn strip_config_from_emit_options(
options: &EmitOptions,
) -> typescript::strip::Config {
- let mut config = typescript::strip::Config::default();
- config.import_not_used_as_values = match options.imports_not_used_as_values {
- ImportsNotUsedAsValues::Remove => {
- typescript::strip::ImportNotUsedAsValues::Remove
- }
- ImportsNotUsedAsValues::Preserve => {
- typescript::strip::ImportNotUsedAsValues::Preserve
- }
- // `Error` only affects the type-checking stage. Fall back to `Remove` here.
- ImportsNotUsedAsValues::Error => {
- typescript::strip::ImportNotUsedAsValues::Remove
- }
- };
- config
+ typescript::strip::Config {
+ import_not_used_as_values: match options.imports_not_used_as_values {
+ ImportsNotUsedAsValues::Remove => {
+ typescript::strip::ImportsNotUsedAsValues::Remove
+ }
+ ImportsNotUsedAsValues::Preserve => {
+ typescript::strip::ImportsNotUsedAsValues::Preserve
+ }
+ // `Error` only affects the type-checking stage. Fall back to `Remove` here.
+ ImportsNotUsedAsValues::Error => {
+ typescript::strip::ImportsNotUsedAsValues::Remove
+ }
+ },
+ ..Default::default()
+ }
}
/// A logical structure to hold the value of a parsed module for further
diff --git a/cli/tests/bundle/fixture13.out b/cli/tests/bundle/fixture13.out
index 1c7a8c991..2c5115280 100644
--- a/cli/tests/bundle/fixture13.out
+++ b/cli/tests/bundle/fixture13.out
@@ -9,9 +9,11 @@ function d() {
return Object.assign(promise, methods);
}
class A {
- s = d();
a() {
this.s.resolve();
}
+ constructor(){
+ this.s = d();
+ }
}
new A();
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index dbebd11f1..310cb3289 100644
--- a/cli/tests/integration_tests.rs
+++ b/cli/tests/integration_tests.rs
@@ -4024,14 +4024,14 @@ console.log("finish");
itest!(stdin {
args: "lint --unstable -",
- input: Some("let a: any;"),
+ input: Some("let _a: any;"),
output: "lint/expected_from_stdin.out",
exit_code: 1,
});
itest!(stdin_json {
args: "lint --unstable --json -",
- input: Some("let a: any;"),
+ input: Some("let _a: any;"),
output: "lint/expected_from_stdin_json.out",
exit_code: 1,
});
diff --git a/cli/tests/lint/expected_from_stdin_json.out b/cli/tests/lint/expected_from_stdin_json.out
index 262d40b30..7ea40e957 100644
--- a/cli/tests/lint/expected_from_stdin_json.out
+++ b/cli/tests/lint/expected_from_stdin_json.out
@@ -4,13 +4,13 @@
"range": {
"start": {
"line": 1,
- "col": 7,
- "bytePos": 7
+ "col": 8,
+ "bytePos": 8
},
"end": {
"line": 1,
- "col": 10,
- "bytePos": 10
+ "col": 11,
+ "bytePos": 11
}
},
"filename": "_stdin.ts",
diff --git a/cli/tests/lint/expected_json.out b/cli/tests/lint/expected_json.out
index f29d311f5..dbeb8039b 100644
--- a/cli/tests/lint/expected_json.out
+++ b/cli/tests/lint/expected_json.out
@@ -40,13 +40,13 @@
"range": {
"start": {
"line": 3,
- "col": 12,
- "bytePos": 56
+ "col": 13,
+ "bytePos": 57
},
"end": {
"line": 3,
- "col": 14,
- "bytePos": 58
+ "col": 15,
+ "bytePos": 59
}
},
"filename": "[WILDCARD]file2.ts",
diff --git a/cli/tests/lint/file2.ts b/cli/tests/lint/file2.ts
index a2be5c5e0..73c612c35 100644
--- a/cli/tests/lint/file2.ts
+++ b/cli/tests/lint/file2.ts
@@ -1,6 +1,6 @@
try {
await Deno.open("./some/file.txt");
-} catch (e) {}
+} catch (_e) {}
// deno-lint-ignore no-explicit-any
-function foo(): any {}
+function _foo(): any {}
diff --git a/cli/tests/unit/buffer_test.ts b/cli/tests/unit/buffer_test.ts
index ed3698bc1..57476e0f3 100644
--- a/cli/tests/unit/buffer_test.ts
+++ b/cli/tests/unit/buffer_test.ts
@@ -1,5 +1,7 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+// deno-lint-ignore-file no-deprecated-deno-api
+
// This code has been ported almost directly from Go's src/bytes/buffer_test.go
// Copyright 2009 The Go Authors. All rights reserved. BSD license.
// https://github.com/golang/go/blob/master/LICENSE
diff --git a/cli/tests/unit/console_test.ts b/cli/tests/unit/console_test.ts
index 402f448bc..a407df9a1 100644
--- a/cli/tests/unit/console_test.ts
+++ b/cli/tests/unit/console_test.ts
@@ -853,7 +853,7 @@ unitTest(async function consoleTestStringifyPromises(): Promise<void> {
rej(Error("Whoops"));
});
await rejectedPromise;
- } catch (err) {
+ } catch (_err) {
// pass
}
const strLines = stringify(rejectedPromise).split("\n");
@@ -1478,7 +1478,7 @@ unitTest(function consoleLogShouldNotThrowError(): void {
try {
console.log(new Error("foo"));
result = 1;
- } catch (e) {
+ } catch (_e) {
result = 2;
}
assertEquals(result, 1);
diff --git a/cli/tests/unit/dispatch_bin_test.ts b/cli/tests/unit/dispatch_bin_test.ts
index 54a379bc0..01f29d0bc 100644
--- a/cli/tests/unit/dispatch_bin_test.ts
+++ b/cli/tests/unit/dispatch_bin_test.ts
@@ -15,7 +15,6 @@ unitTest(async function sendAsyncStackTrace() {
});
declare global {
- // deno-lint-ignore no-namespace
namespace Deno {
// deno-lint-ignore no-explicit-any
var core: any; // eslint-disable-line no-var
diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts
index 6ece3c835..0fb9da8f4 100644
--- a/cli/tests/unit/fetch_test.ts
+++ b/cli/tests/unit/fetch_test.ts
@@ -35,7 +35,7 @@ function findClosedPortInRange(
const listener = Deno.listen({ port });
listener.close();
return port;
- } catch (e) {
+ } catch (_e) {
port++;
}
}
@@ -792,7 +792,7 @@ unitTest(
fail(
"Response.text() didn't throw on a filtered response without a body (type error)",
);
- } catch (e) {
+ } catch (_e) {
return;
}
},
diff --git a/cli/tests/unit/filereader_test.ts b/cli/tests/unit/filereader_test.ts
index 9bc8cda62..eb1f11475 100644
--- a/cli/tests/unit/filereader_test.ts
+++ b/cli/tests/unit/filereader_test.ts
@@ -228,7 +228,7 @@ unitTest(
fr.addEventListener("loadend", () => {
out += "1";
});
- fr.onloadend = (ev): void => {
+ fr.onloadend = (_ev): void => {
out += "2";
};
fr.addEventListener("loadend", () => {
diff --git a/cli/tests/unit/files_test.ts b/cli/tests/unit/files_test.ts
index 152068004..51ca1c579 100644
--- a/cli/tests/unit/files_test.ts
+++ b/cli/tests/unit/files_test.ts
@@ -1,4 +1,7 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
+
+// deno-lint-ignore-file no-deprecated-deno-api
+
import {
assert,
assertEquals,
@@ -477,7 +480,7 @@ unitTest(
try {
const buf = new Uint8Array(20);
await file.read(buf);
- } catch (e) {
+ } catch (_e) {
thrown = true;
} finally {
assert(thrown, "'w' mode shouldn't allow to read file");
diff --git a/cli/tests/unit/globals_test.ts b/cli/tests/unit/globals_test.ts
index ce43fddf1..7603457b9 100644
--- a/cli/tests/unit/globals_test.ts
+++ b/cli/tests/unit/globals_test.ts
@@ -71,7 +71,6 @@ unitTest(function webAssemblyExists(): void {
});
declare global {
- // deno-lint-ignore no-namespace
namespace Deno {
// deno-lint-ignore no-explicit-any
var core: any;
diff --git a/cli/tests/unit/headers_test.ts b/cli/tests/unit/headers_test.ts
index 7f19cec1b..aa8834052 100644
--- a/cli/tests/unit/headers_test.ts
+++ b/cli/tests/unit/headers_test.ts
@@ -196,48 +196,48 @@ unitTest(function headerIllegalReject(): void {
let errorCount = 0;
try {
new Headers({ "He y": "ok" });
- } catch (e) {
+ } catch (_e) {
errorCount++;
}
try {
new Headers({ "Hé-y": "ok" });
- } catch (e) {
+ } catch (_e) {
errorCount++;
}
try {
new Headers({ "He-y": "ăk" });
- } catch (e) {
+ } catch (_e) {
errorCount++;
}
const headers = new Headers();
try {
headers.append("Hé-y", "ok");
- } catch (e) {
+ } catch (_e) {
errorCount++;
}
try {
headers.delete("Hé-y");
- } catch (e) {
+ } catch (_e) {
errorCount++;
}
try {
headers.get("Hé-y");
- } catch (e) {
+ } catch (_e) {
errorCount++;
}
try {
headers.has("Hé-y");
- } catch (e) {
+ } catch (_e) {
errorCount++;
}
try {
headers.set("Hé-y", "ok");
- } catch (e) {
+ } catch (_e) {
errorCount++;
}
try {
headers.set("", "ok");
- } catch (e) {
+ } catch (_e) {
errorCount++;
}
assertEquals(errorCount, 9);
diff --git a/cli/tests/unit/http_test.ts b/cli/tests/unit/http_test.ts
index 77af953e9..94c7ac887 100644
--- a/cli/tests/unit/http_test.ts
+++ b/cli/tests/unit/http_test.ts
@@ -5,8 +5,6 @@ import {
assertThrowsAsync,
unitTest,
} from "./test_util.ts";
-import { BufReader, BufWriter } from "../../../test_util/std/io/bufio.ts";
-import { TextProtoReader } from "../../../test_util/std/textproto/mod.ts";
unitTest({ perms: { net: true } }, async function httpServerBasic() {
const promise = (async () => {
@@ -178,7 +176,7 @@ unitTest(
const httpConn = Deno.serveHttp(conn);
const evt = await httpConn.nextRequest();
assert(evt);
- const { request, respondWith } = evt;
+ const { respondWith } = evt;
await respondWith(new Response("Hello World"));
// TODO(ry) If we don't call httpConn.nextRequest() here we get "error sending
diff --git a/cli/tests/unit/net_test.ts b/cli/tests/unit/net_test.ts
index 99af959cc..725bb9684 100644
--- a/cli/tests/unit/net_test.ts
+++ b/cli/tests/unit/net_test.ts
@@ -298,7 +298,7 @@ unitTest(
const sendLen = await socket.send(sendBuf, socket.addr);
assertEquals(sendLen, 3);
- const [recvBuf, recvAddr] = await recvPromise;
+ const [recvBuf, _recvAddr] = await recvPromise;
assertEquals(recvBuf.length, 3);
assertEquals(1, recvBuf[0]);
assertEquals(2, recvBuf[1]);
@@ -375,7 +375,7 @@ unitTest(
const sendLen = await socket.send(sendBuf, socket.addr);
assertEquals(sendLen, 3);
- const [recvBuf, recvAddr] = await recvPromise;
+ const [recvBuf, _recvAddr] = await recvPromise;
assertEquals(recvBuf.length, 3);
assertEquals(1, recvBuf[0]);
assertEquals(2, recvBuf[1]);
diff --git a/cli/tests/unit/test_util.ts b/cli/tests/unit/test_util.ts
index e6adc6583..39866c3fc 100644
--- a/cli/tests/unit/test_util.ts
+++ b/cli/tests/unit/test_util.ts
@@ -228,6 +228,7 @@ export async function reportToConn(
): Promise<void> {
const line = serializeTestMessage(message);
const encodedMsg = encoder.encode(line + (message.end == null ? "\n" : ""));
+ // deno-lint-ignore no-deprecated-deno-api
await Deno.writeAll(conn, encodedMsg);
if (message.end != null) {
conn.closeWrite();
diff --git a/cli/tests/unit/text_encoding_test.ts b/cli/tests/unit/text_encoding_test.ts
index c7c07f937..7a15c9376 100644
--- a/cli/tests/unit/text_encoding_test.ts
+++ b/cli/tests/unit/text_encoding_test.ts
@@ -34,7 +34,7 @@ unitTest(function atobThrows(): void {
let threw = false;
try {
atob("aGVsbG8gd29ybGQ==");
- } catch (e) {
+ } catch (_e) {
threw = true;
}
assert(threw);
@@ -44,7 +44,7 @@ unitTest(function atobThrows2(): void {
let threw = false;
try {
atob("aGVsbG8gd29ybGQ===");
- } catch (e) {
+ } catch (_e) {
threw = true;
}
assert(threw);
diff --git a/cli/tests/unit/timers_test.ts b/cli/tests/unit/timers_test.ts
index 7276b3e35..11698b3c3 100644
--- a/cli/tests/unit/timers_test.ts
+++ b/cli/tests/unit/timers_test.ts
@@ -122,6 +122,7 @@ unitTest(async function timeoutCancelInvalidSilentFail(): Promise<void> {
// Expect no panic
const promise = deferred();
let count = 0;
+ // deno-lint-ignore no-unused-vars
const id = setTimeout((): void => {
count++;
// Should have no effect