mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
build: update dlint to v0.2.10 (#8284)
Update prebuilt "dlint" binary to v0.2.10 and fix diagnostics for "require-await" rule. Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
parent
3d65e57d7c
commit
9029003046
9 changed files with 14 additions and 15 deletions
|
@ -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");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// eslint-disable-next-line require-await
|
||||
// deno-lint-ignore require-await
|
||||
self.onmessage = async (_msg: MessageEvent) => {
|
||||
self.postMessage("hello");
|
||||
};
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// eslint-disable-next-line require-await
|
||||
async function* asyncGenerator(): AsyncIterableIterator<number> {
|
||||
let i = 0;
|
||||
while (i < 3) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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]);
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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> {
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
@ -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);
|
||||
};
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 9aff0d56e9920c26f8b2eca8714f7e9474fd65c2
|
||||
Subproject commit a35cf5d737327db2b2611d74b0b010b28d59e522
|
|
@ -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",
|
||||
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue