summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2019-03-05 11:53:35 +1100
committerRyan Dahl <ry@tinyclouds.org>2019-03-04 19:53:35 -0500
commit17663c12326dd1053f89a3bd741807f139973dae (patch)
tree4588e84042b0155e11d7f5442ae38a6007922585 /examples
parent9f33cd28963a72d8fea0b1e99bb61ca9bec21a94 (diff)
Add eslint for linting (denoland/deno_std#235)
Original: https://github.com/denoland/deno_std/commit/c0390ade3de4d825423c9f0f5e1aa56ffd509942
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/gist.ts4
-rw-r--r--examples/ws.ts4
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/gist.ts b/examples/gist.ts
index 8ce68a946..f64f69226 100755
--- a/examples/gist.ts
+++ b/examples/gist.ts
@@ -9,7 +9,7 @@ function pathBase(p: string): string {
return parts[parts.length - 1];
}
-async function main() {
+async function main(): Promise<void> {
const token = env()["GIST_TOKEN"];
if (!token) {
console.error("GIST_TOKEN environmental variable not set.");
@@ -46,7 +46,7 @@ async function main() {
headers: [
["Content-Type", "application/json"],
["User-Agent", "Deno-Gist"],
- ["Authorization", "token " + token]
+ ["Authorization", `token ${token}`]
],
body
});
diff --git a/examples/ws.ts b/examples/ws.ts
index bc2a7bd0b..f25a15687 100644
--- a/examples/ws.ts
+++ b/examples/ws.ts
@@ -6,7 +6,7 @@ import {
isWebSocketPingEvent
} from "https://deno.land/x/ws/mod.ts";
-async function main() {
+async function main(): Promise<void> {
console.log("websocket server is running on 0.0.0.0:8080");
for await (const req of serve("0.0.0.0:8080")) {
if (req.url === "/ws") {
@@ -22,7 +22,7 @@ async function main() {
// binary message
console.log("ws:Binary", ev);
} else if (isWebSocketPingEvent(ev)) {
- const [_, body] = ev;
+ const [, body] = ev;
// ping
console.log("ws:Ping", body);
} else if (isWebSocketCloseEvent(ev)) {