diff options
| author | Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> | 2023-07-10 23:03:08 +0900 |
|---|---|---|
| committer | Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> | 2023-07-10 23:13:36 +0900 |
| commit | 444bc5b3ba366d2eab252e2c4f5c956a5e21df58 (patch) | |
| tree | ecd03d738a3775eff3710801419bd1a29c696714 | |
| parent | a66b7e3eba90690ed2860125c7d47932fddaff22 (diff) | |
| download | rust-444bc5b3ba366d2eab252e2c4f5c956a5e21df58.tar.gz rust-444bc5b3ba366d2eab252e2c4f5c956a5e21df58.zip | |
editor/code: Enable TypeScript's `--useUnknownInCatchVariables` option
see: https://www.typescriptlang.org/tsconfig#useUnknownInCatchVariables
| -rw-r--r-- | editors/code/src/commands.ts | 4 | ||||
| -rw-r--r-- | editors/code/tests/unit/index.ts | 3 | ||||
| -rw-r--r-- | editors/code/tsconfig.json | 1 |
3 files changed, 5 insertions, 3 deletions
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts index 17202e5345a..94ec5e99c6a 100644 --- a/editors/code/src/commands.ts +++ b/editors/code/src/commands.ts @@ -373,7 +373,7 @@ export function ssr(ctx: CtxInit): Cmd { selections, }); } catch (e) { - return e.toString(); + return String(e); } return null; }, @@ -1156,7 +1156,7 @@ export function viewMemoryLayout(ctx: CtxInit): Cmd { <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> - <style> + <style> * { box-sizing: border-box; } diff --git a/editors/code/tests/unit/index.ts b/editors/code/tests/unit/index.ts index 2fa223bed4a..c231927bb00 100644 --- a/editors/code/tests/unit/index.ts +++ b/editors/code/tests/unit/index.ts @@ -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; } diff --git a/editors/code/tsconfig.json b/editors/code/tsconfig.json index 4b107a5d251..87fd14072f2 100644 --- a/editors/code/tsconfig.json +++ b/editors/code/tsconfig.json @@ -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"], |
