Skip to content

Commit 5683994

Browse files
committed
Enable erasableSyntaxOnly in TypeScript config
Adds the 'erasableSyntaxOnly' option to the base tsconfig to restrict type erasure to erasable syntax only.
1 parent 2fc4b49 commit 5683994

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

packages/common/test/Type.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2442,7 +2442,10 @@ test("omit - single key", () => {
24422442

24432443
test("instanceOf", () => {
24442444
class User {
2445-
constructor(public name: string) {}
2445+
name: string;
2446+
constructor(name: string) {
2447+
this.name = name;
2448+
}
24462449
}
24472450

24482451
class Admin extends User {}

packages/tsconfig/base.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"skipLibCheck": true,
1717
"strict": true,
1818
"exactOptionalPropertyTypes": true,
19-
"noErrorTruncation": false
19+
"noErrorTruncation": false,
20+
"erasableSyntaxOnly": true
2021
},
2122
"exclude": ["node_modules"]
2223
}

packages/web/test/SharedWebWorker.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ import { SimpleName, wait } from "@evolu/common";
99
// Mock BroadcastChannel
1010
class MockBroadcastChannel {
1111
onmessage: ((event: MessageEvent) => void) | null = null;
12+
name: string;
1213

13-
constructor(public name: string) {}
14+
constructor(name: string) {
15+
this.name = name;
16+
}
1417

1518
postMessage = vi.fn();
1619
close = vi.fn();

0 commit comments

Comments
 (0)