Skip to content

Unable to define a .js file as ServiceWorkerGlobalScope #675

Closed
@wilsonpage

Description

@wilsonpage

When a .js file is a service-worker, there's no way to define its scope/self/this as ServiceWorkerGlobalScope. This means service-worker only global APIs like self.skipWaiting() are undefined and fail Typescript's checkjs run.

Minimal test-case

https://github.com/wilsonpage/vscode-scope-test-case

Twitter thread w/ @DanielRosenwasser

https://twitter.com/drosenwasser/status/1113905694028132352

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions