summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/complex_permissions_test.py6
-rw-r--r--tools/complex_permissions_test.ts30
-rw-r--r--tools/deno_http_proxy.ts2
-rwxr-xr-xtools/lint.py6
-rw-r--r--tools/node_tcp_promise.js4
-rw-r--r--tools/permission_prompt_test.ts14
6 files changed, 28 insertions, 34 deletions
diff --git a/tools/complex_permissions_test.py b/tools/complex_permissions_test.py
index 32385649b..cc35577de 100755
--- a/tools/complex_permissions_test.py
+++ b/tools/complex_permissions_test.py
@@ -106,7 +106,7 @@ class TestWritePermissions(BaseReadWritePermissionsTest,
class TestNetFetchPermissions(BaseComplexPermissionTest):
- test_type = "net_fetch"
+ test_type = "netFetch"
def test_allow_localhost_4545(self):
code, _stdout, stderr = self._run_deno(
@@ -143,7 +143,7 @@ class TestNetFetchPermissions(BaseComplexPermissionTest):
class TestNetDialPermissions(BaseComplexPermissionTest):
- test_type = "net_dial"
+ test_type = "netDial"
def test_allow_localhost_ip_4555(self):
code, _stdout, stderr = self._run_deno(
@@ -177,7 +177,7 @@ class TestNetDialPermissions(BaseComplexPermissionTest):
class TestNetListenPermissions(BaseComplexPermissionTest):
- test_type = "net_listen"
+ test_type = "netListen"
def test_allow_localhost_4555(self):
code, _stdout, stderr = self._run_deno(
diff --git a/tools/complex_permissions_test.ts b/tools/complex_permissions_test.ts
index b0e13b6e5..dd65a0e33 100644
--- a/tools/complex_permissions_test.ts
+++ b/tools/complex_permissions_test.ts
@@ -1,28 +1,26 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-const { args, readFileSync, writeFileSync, exit, dial } = Deno;
+const { args, readFileSync, writeFileSync, exit } = Deno;
const name = args[1];
const test: (args: string[]) => void = {
- read: (files: string[]): void => {
- files.forEach((file): any => readFileSync(file));
+ read(files: string[]): void {
+ files.forEach(file => readFileSync(file));
},
- write: (files: string[]): void => {
- files.forEach(
- (file): any => writeFileSync(file, new Uint8Array(), { append: true })
+ write(files: string[]): void {
+ files.forEach(file =>
+ writeFileSync(file, new Uint8Array(0), { append: true })
);
},
- net_fetch: (hosts: string[]): void => {
- hosts.forEach((host): any => fetch(host));
+ netFetch(hosts: string[]): void {
+ hosts.forEach(host => fetch(host));
},
- net_listen: (hosts: string[]): void => {
- hosts.forEach(
- (host): any => {
- const listener = Deno.listen("tcp", host);
- listener.close();
- }
- );
+ netListen(hosts: string[]): void {
+ hosts.forEach(host => {
+ const listener = Deno.listen("tcp", host);
+ listener.close();
+ });
},
- net_dial: async (hosts: string[]): Promise<void> => {
+ async netDial(hosts: string[]): Promise<void> {
for (const host of hosts) {
const listener = await Deno.dial("tcp", host);
listener.close();
diff --git a/tools/deno_http_proxy.ts b/tools/deno_http_proxy.ts
index 0b775ad07..d7a5dda2d 100644
--- a/tools/deno_http_proxy.ts
+++ b/tools/deno_http_proxy.ts
@@ -15,7 +15,7 @@ async function main(): Promise<void> {
}
}
-async function proxyRequest(req: ServerRequest) {
+async function proxyRequest(req: ServerRequest): Promise<void> {
const url = `http://${originAddr}${req.url}`;
const resp = await fetch(url, {
method: req.method,
diff --git a/tools/lint.py b/tools/lint.py
index 61c6c59ce..e71d5d0ef 100755
--- a/tools/lint.py
+++ b/tools/lint.py
@@ -38,12 +38,8 @@ def eslint():
print "eslint"
script = os.path.join(third_party_path, "node_modules", "eslint", "bin",
"eslint")
- # TODO: Files in 'deno_typescript', 'tools' and 'website' directories are
- # currently not linted, but they should.
- source_files = git_ls_files(
- root_path,
- ["*.js", "*.ts", ":!:deno_typescript/", ":!:tools/", ":!:website/"])
# Find all *directories* in the main repo that contain .ts/.js files.
+ source_files = git_ls_files(root_path, ["*.js", "*.ts"])
source_dirs = set([os.path.dirname(f) for f in source_files])
# Within the source dirs, eslint does its own globbing, taking into account
# the exclusion rules listed in '.eslintignore'.
diff --git a/tools/node_tcp_promise.js b/tools/node_tcp_promise.js
index c8fc54aba..c6de120b1 100644
--- a/tools/node_tcp_promise.js
+++ b/tools/node_tcp_promise.js
@@ -9,7 +9,7 @@ const response = Buffer.from(
);
async function write(socket, buffer) {
- let p = new Promise((resolve, reject) => {
+ const p = new Promise((resolve, _) => {
socket.write(buffer, resolve);
});
return p;
@@ -19,7 +19,7 @@ Server(async socket => {
socket.on("error", _ => {
socket.destroy();
});
- for await (const data of socket) {
+ for await (const _ of socket) {
write(socket, response);
}
}).listen(port);
diff --git a/tools/permission_prompt_test.ts b/tools/permission_prompt_test.ts
index a4c9e4362..617f8b0fc 100644
--- a/tools/permission_prompt_test.ts
+++ b/tools/permission_prompt_test.ts
@@ -5,7 +5,7 @@ const firstCheckFailedMessage = "First check failed";
const name = args[1];
const test = {
- needsRead: async () => {
+ async needsRead(): Promise<void> {
try {
readFileSync("package.json");
} catch (e) {
@@ -13,7 +13,7 @@ const test = {
}
readFileSync("package.json");
},
- needsWrite: () => {
+ needsWrite(): void {
try {
makeTempDirSync();
} catch (e) {
@@ -21,7 +21,7 @@ const test = {
}
makeTempDirSync();
},
- needsEnv: () => {
+ needsEnv(): void {
try {
env().home;
} catch (e) {
@@ -29,7 +29,7 @@ const test = {
}
env().home;
},
- needsNet: () => {
+ needsNet(): void {
try {
listen("tcp", "127.0.0.1:4540");
} catch (e) {
@@ -37,9 +37,9 @@ const test = {
}
listen("tcp", "127.0.0.1:4541");
},
- needsRun: () => {
+ needsRun(): void {
try {
- const process = run({
+ run({
args: [
"python",
"-c",
@@ -49,7 +49,7 @@ const test = {
} catch (e) {
console.log(firstCheckFailedMessage);
}
- const process = run({
+ run({
args: [
"python",
"-c",