mirror of
https://github.com/denoland/std.git
synced 2024-11-22 04:59:05 +00:00
chore: enable no-sync-fn-in-async-fn
lint rule (#4471)
* chore: enable `no-sync-fn-in-async-fn` lint rule * revert for serveTls test
This commit is contained in:
parent
d63e97c735
commit
4da7440c62
@ -40,7 +40,8 @@
|
||||
"lint": {
|
||||
"rules": {
|
||||
"include": [
|
||||
"camelcase"
|
||||
"camelcase",
|
||||
"no-sync-fn-in-async-fn"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ Deno.test("ensureLink() rejects if link does not exist", async function () {
|
||||
// "Access is denied. (os error 5)" // throw in CI
|
||||
);
|
||||
|
||||
Deno.removeSync(testDir, { recursive: true });
|
||||
await Deno.remove(testDir, { recursive: true });
|
||||
});
|
||||
|
||||
Deno.test("ensureLinkSync() throws if link does not exist", function () {
|
||||
|
@ -958,13 +958,15 @@ Deno.test(
|
||||
},
|
||||
},
|
||||
async () => {
|
||||
const tempDir = Deno.makeTempDirSync({ dir: `${moduleDir}/testdata` });
|
||||
const tempDir = await Deno.makeTempDir({
|
||||
dir: `${moduleDir}/testdata`,
|
||||
});
|
||||
const req = new Request(`http://localhost/${basename(tempDir)}/`);
|
||||
const res = await serveDir(req, serveDirOptions);
|
||||
await res.body?.cancel();
|
||||
|
||||
assertEquals(res.status, 200);
|
||||
|
||||
Deno.removeSync(tempDir);
|
||||
await Deno.remove(tempDir);
|
||||
},
|
||||
);
|
||||
|
@ -773,7 +773,9 @@ export async function serveTls(
|
||||
once: true,
|
||||
});
|
||||
|
||||
// deno-lint-ignore no-sync-fn-in-async-fn
|
||||
const key = options.key || Deno.readTextFileSync(options.keyFile!);
|
||||
// deno-lint-ignore no-sync-fn-in-async-fn
|
||||
const cert = options.cert || Deno.readTextFileSync(options.certFile!);
|
||||
|
||||
const listener = Deno.listenTls({
|
||||
|
Loading…
Reference in New Issue
Block a user