1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05:00

Revert "feat(cli): enable useUnknownInCatchVariables by default" (#12643)

This partially reverts commit a065604155.

Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
This commit is contained in:
Luca Casonato 2021-11-04 11:30:37 +01:00 committed by GitHub
parent 7c2abb9d57
commit 318dcc33af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 17 deletions

View file

@ -160,6 +160,8 @@ pub(crate) fn get_ts_config(
"target": "esnext",
"tsBuildInfoFile": "deno:///.tsbuildinfo",
"useDefineForClassFields": true,
// TODO(@kitsonk) remove for Deno 2.0
"useUnknownInCatchVariables": false,
}));
if tsc_emit {
ts_config.merge(&json!({
@ -211,6 +213,8 @@ pub(crate) fn get_ts_config(
"target": "esnext",
"tsBuildInfoFile": "deno:///.tsbuildinfo",
"useDefineForClassFields": true,
// TODO(@kitsonk) remove for Deno 2.0
"useUnknownInCatchVariables": false,
}));
if tsc_emit {
ts_config.merge(&json!({

View file

@ -572,6 +572,8 @@ impl Inner {
"strict": true,
"target": "esnext",
"useDefineForClassFields": true,
// TODO(@kitsonk) remove for Deno 1.15
"useUnknownInCatchVariables": false,
}));
let config = &self.config;
let workspace_settings = config.get_workspace_settings();

View file

@ -1367,13 +1367,6 @@ itest!(error_import_map_unable_to_load {
exit_code: 1,
});
// This test ensure that useUnknownInCatchVariables is enabled by default.
itest!(use_unknown_in_catch_variables {
args: "run useUnknownInCatchVariables.ts",
output: "useUnknownInCatchVariables.ts.out",
exit_code: 1,
});
// Test that setting `self` in the main thread to some other value doesn't break
// the world.
itest!(replace_self {

View file

@ -1,5 +0,0 @@
try {
throw new Error();
} catch (e) {
console.log(e.message);
}

View file

@ -1,5 +0,0 @@
[WILDCARD]
error: TS2571 [ERROR]: Object is of type 'unknown'.
console.log(e.message);
^
at file://[WILDCARD]/useUnknownInCatchVariables.ts:4:15