mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
feat(cli): enable useUnknownInCatchVariables
by default (#12547)
Closes #11826 **BREAKING CHANGE** this behaviour was disable when introduced in Deno 1.14/TypeScript 4.4. It will highlight code that unsafely handles variables that are caught, and will cause type errors in unsafe code.
This commit is contained in:
parent
be68b82eb4
commit
a065604155
17 changed files with 56 additions and 17 deletions
|
@ -1,5 +1,6 @@
|
|||
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
||||
import {
|
||||
assert,
|
||||
assertEquals,
|
||||
assertRejects,
|
||||
assertThrows,
|
||||
|
@ -251,6 +252,7 @@ unitTest(
|
|||
try {
|
||||
await Deno.writeFile(filename, data, { signal: ac.signal });
|
||||
} catch (e) {
|
||||
assert(e instanceof Error);
|
||||
assertEquals(e.name, "AbortError");
|
||||
}
|
||||
const stat = Deno.statSync(filename);
|
||||
|
@ -269,6 +271,7 @@ unitTest(
|
|||
try {
|
||||
await Deno.writeFile(filename, data, { signal: ac.signal });
|
||||
} catch (e) {
|
||||
assert(e instanceof Error);
|
||||
assertEquals(e.name, "AbortError");
|
||||
}
|
||||
const stat = Deno.statSync(filename);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue