Skip to content

Commit

Permalink
build: update dlint to v0.2.10 (denoland#8284)
Browse files Browse the repository at this point in the history
Update prebuilt "dlint" binary to v0.2.10 and fix diagnostics
for "require-await" rule.

Co-authored-by: Bartek Iwańczuk <[email protected]>
  • Loading branch information
magurotuna and bartlomieju committed Nov 14, 2020
1 parent 3d65e57 commit 9029003
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cli/tests/async_error.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
console.log("hello");
// eslint-disable-next-line require-await
// deno-lint-ignore require-await
const foo = async (): Promise<never> => {
console.log("before error");
throw Error("error");
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/subdir/worker_types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-next-line require-await
// deno-lint-ignore require-await
self.onmessage = async (_msg: MessageEvent) => {
self.postMessage("hello");
};
1 change: 0 additions & 1 deletion cli/tests/top_level_for_await.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line require-await
async function* asyncGenerator(): AsyncIterableIterator<number> {
let i = 0;
while (i < 3) {
Expand Down
4 changes: 4 additions & 0 deletions op_crates/fetch/11_streams.js
Original file line number Diff line number Diff line change
Expand Up @@ -1071,14 +1071,17 @@
throw new TypeError("method is not callable");
}
if (algoArgCount === 0) {
// deno-lint-ignore require-await
return async () => call(method, underlyingObject, extraArgs);
} else {
// deno-lint-ignore require-await
return async (arg) => {
const fullArgs = [arg, ...extraArgs];
return call(method, underlyingObject, fullArgs);
};
}
}
// deno-lint-ignore require-await
return async () => undefined;
}

Expand Down Expand Up @@ -2490,6 +2493,7 @@
if (typeof transformMethod !== "function") {
throw new TypeError("tranformer.transform must be callable.");
}
// deno-lint-ignore require-await
transformAlgorithm = async (chunk) =>
call(transformMethod, transformer, [chunk, controller]);
}
Expand Down
3 changes: 0 additions & 3 deletions std/async/mux_async_iterator_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@
import { assertEquals, assertThrowsAsync } from "../testing/asserts.ts";
import { MuxAsyncIterator } from "./mux_async_iterator.ts";

// eslint-disable-next-line require-await
async function* gen123(): AsyncIterableIterator<number> {
yield 1;
yield 2;
yield 3;
}

// eslint-disable-next-line require-await
async function* gen456(): AsyncIterableIterator<number> {
yield 4;
yield 5;
yield 6;
}

// eslint-disable-next-line require-await
async function* genThrows(): AsyncIterableIterator<number> {
yield 7;
throw new Error("something went wrong");
Expand Down
1 change: 0 additions & 1 deletion std/io/bufio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,6 @@ export async function* readStringDelim(
}

/** Read strings line-by-line from a Reader. */
// eslint-disable-next-line require-await
export async function* readLines(
reader: Reader,
): AsyncIterableIterator<string> {
Expand Down
10 changes: 5 additions & 5 deletions std/node/_util/_util_callbackify_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Deno.test(
const testQueue = new TestQueue();

for (const value of values) {
// eslint-disable-next-line require-await
// deno-lint-ignore require-await
const asyncFn = async (): Promise<typeof value> => {
return value;
};
Expand Down Expand Up @@ -136,7 +136,7 @@ Deno.test(
const testQueue = new TestQueue();

for (const value of values) {
// eslint-disable-next-line require-await
// deno-lint-ignore require-await
const asyncFn = async (): Promise<never> => {
return Promise.reject(value);
};
Expand Down Expand Up @@ -245,7 +245,7 @@ Deno.test("callbackify passes arguments to the original", async () => {
const testQueue = new TestQueue();

for (const value of values) {
// eslint-disable-next-line require-await
// deno-lint-ignore require-await
const asyncFn = async (arg: typeof value): Promise<typeof value> => {
assertStrictEquals(arg, value);
return arg;
Expand Down Expand Up @@ -314,7 +314,7 @@ Deno.test("callbackify preserves the `this` binding", async () => {
});

const objectWithAsyncFunction = {
// eslint-disable-next-line require-await
// deno-lint-ignore require-await
async fn(this: unknown, arg: typeof value): Promise<typeof value> {
assertStrictEquals(this, objectWithAsyncFunction);
return arg;
Expand Down Expand Up @@ -360,7 +360,7 @@ Deno.test("callbackify throws with non-function inputs", () => {
Deno.test(
"callbackify returns a function that throws if the last argument is not a function",
() => {
// eslint-disable-next-line require-await
// deno-lint-ignore require-await
async function asyncFn(): Promise<number> {
return 42;
}
Expand Down
2 changes: 1 addition & 1 deletion third_party
4 changes: 2 additions & 2 deletions tools/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function getFilesFromGit(baseDir, cmd) {
return files;
}

async function gitLsFiles(baseDir, patterns) {
function gitLsFiles(baseDir, patterns) {
baseDir = Deno.realPathSync(baseDir);
const cmd = [
"git",
Expand All @@ -50,7 +50,7 @@ async function gitLsFiles(baseDir, patterns) {
}

/** List all files staged for commit */
async function gitStaged(baseDir, patterns) {
function gitStaged(baseDir, patterns) {
baseDir = Deno.realPathSync(baseDir);
const cmd = [
"git",
Expand Down

0 comments on commit 9029003

Please sign in to comment.