Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR resolves two TS errors that were reported on build. I wasn't able to find a better solution than casting to
any
, though I'm not a TypeScript expert.The first issue is that
Event.returnValue
is a boolean and the test asserts that it is called with a string. However, per MDN,returnValue
needs to be set to a string to prevent tab close in legacy browsers:I couldn't figure out how to resolve this type conflict without potentially breaking the action for some browsers, so I cast to any.
The second issue is a mismatch between native DOM window and JSDOM window. I copied the offending lines from the main Svelte project which has a similar linting error in
helpers.ts
(see screenshot below). Wasn't sure how to solve this one either so I slapped anany
on it for now.