Skip to content

Commit 9f8f052

Browse files
committed
Fix the addon's own type checking
1 parent 42dd130 commit 9f8f052

File tree

5 files changed

+84
-25
lines changed

5 files changed

+84
-25
lines changed

addon/addon/build-waiter.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class TestWaiterImpl<T extends object | Primitive = Token> implements TestWaiter
3535
this._register();
3636

3737
if (this.items.has(token)) {
38-
throw new Error(`beginAsync called for ${token} but it is already pending.`);
38+
throw new Error(`beginAsync called for ${token as string} but it is already pending.`);
3939
}
4040

4141
let error = new Error();
@@ -112,7 +112,7 @@ class NoopTestWaiter implements TestWaiter {
112112
return this;
113113
}
114114

115-
endAsync(): void {}
115+
endAsync(): void { }
116116

117117
waitUntil(): boolean {
118118
return true;
@@ -122,7 +122,7 @@ class NoopTestWaiter implements TestWaiter {
122122
return [];
123123
}
124124

125-
reset(): void {}
125+
reset(): void { }
126126
}
127127

128128
/**

addon/addon/waiter-manager.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type Indexable = Record<any, unknown>;
88
// this ensures that if @ember/test-waiters exists in multiple places in the
99
// build output we will still use a single map of waiters (there really should
1010
// only be one of them, or else `settled` will not work at all)
11-
const WAITERS: Map<WaiterName, Waiter> = (function () {
11+
const WAITERS: Map<WaiterName, Waiter> = (function() {
1212
const HAS_SYMBOL = typeof Symbol !== 'undefined';
1313

1414
let symbolName = 'TEST_WAITERS';
@@ -33,6 +33,7 @@ function getGlobal(): Indexable {
3333
if (typeof globalThis !== 'undefined') return indexable(globalThis);
3434
if (typeof self !== 'undefined') return indexable(self);
3535
if (typeof window !== 'undefined') return indexable(window);
36+
// @ts-expect-error cannot find name 'global' -- for old compatibility
3637
if (typeof global !== 'undefined') return indexable(global);
3738

3839
throw new Error('unable to locate global object');

addon/tsconfig.json

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"allowJs": true,
55
"moduleResolution": "node",
66
"allowSyntheticDefaultImports": true,
7+
// have to use this, because the current TS setup errors with ember's own types
8+
// this will be fixed during v2 addon conversion
9+
"skipLibCheck": true,
710
"noImplicitAny": true,
811
"noImplicitThis": true,
912
"alwaysStrict": true,

package.json

+9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717
"concurrently": "^8.2.1",
1818
"release-plan": "^0.8.0"
1919
},
20+
"pnpm": {
21+
"overrides_notes": {
22+
"@glimmer/*": "https://github.com/glimmerjs/glimmer.js/issues/413"
23+
},
24+
"overrides": {
25+
"@glimmer/validator": ">= 0.84.3",
26+
"@glimmer/manager": ">= 0.84.3"
27+
}
28+
},
2029
"volta": {
2130
"node": "18.16.0",
2231
"pnpm": "8.7.6"

pnpm-lock.yaml

+67-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)