editor/code: Enable TypeScript's --useUnknownInCatchVariables option

see: https://www.typescriptlang.org/tsconfig#useUnknownInCatchVariables
This commit is contained in:
Tetsuharu Ohzeki 2023-07-10 23:03:08 +09:00
parent a66b7e3eba
commit 444bc5b3ba
3 changed files with 5 additions and 3 deletions

View file

@ -373,7 +373,7 @@ export function ssr(ctx: CtxInit): Cmd {
selections,
});
} catch (e) {
return e.toString();
return String(e);
}
return null;
},

View file

@ -1,3 +1,4 @@
import * as assert from "node:assert/strict";
import { readdir } from "fs/promises";
import * as path from "path";
@ -30,6 +31,7 @@ class Suite {
await test.promise;
ok(`${test.name}`);
} catch (e) {
assert.ok(e instanceof Error);
error(` ✖︎ ${test.name}\n ${e.stack}`);
failed += 1;
}
@ -50,6 +52,7 @@ export class Context {
await ctx.run();
ok(`${name}`);
} catch (e) {
assert.ok(e instanceof Error);
error(`✖︎ ${name}\n ${e.stack}`);
throw e;
}

View file

@ -12,7 +12,6 @@
"newLine": "LF",
// These disables some enhancement type checking options
// to update typescript version without any code change.
"useUnknownInCatchVariables": false,
"exactOptionalPropertyTypes": false
},
"exclude": ["node_modules", ".vscode-test"],