Skip to content

🐛 Declare __interactors without the module keyword - #334

Merged
taras merged 1 commit into
mainfrom
fix/globalthis-namespace
Sep 30, 2026
Merged

taras merged 1 commit into
mainfrom
fix/globalthis-namespace

Conversation

@taras

@taras taras commented Sep 30, 2026

Copy link
Copy Markdown
Member

Motivation

deno test -A fails on every pull request, and on main itself — the run for
the merge of #332 fails the same way:

TS1540 [ERROR]: A 'namespace' declaration should not be declared using the
'module' keyword. Please use the 'namespace' keyword instead.

  module globalThis {
    at packages/globals/src/globals.ts:48:10

Deno 2.9 bundles TypeScript 6, which turned the long-deprecated
module X {} namespace syntax into an error. The
// deno-lint-ignore prefer-namespace-keyword sitting directly above it is a
fossil of when the same thing was only a lint warning — the code has been living
on borrowed time and the compiler finally called it in.

Nothing in the repository changed to cause this; it arrived with a Deno upgrade
on the runner.

Approach

 declare global {
-  // deno-lint-ignore prefer-namespace-keyword
-  module globalThis {
-    // deno-lint-ignore no-var
-    var __interactors: Globals;
-  }
+  var __interactors: Globals;
 }

The module globalThis wrapper was never doing anything. declare global is
already the global scope, so a var declared directly inside it augments
globalThis exactly the same way. Renaming module to namespace would also
compile, but it would keep a level of nesting that has no effect.

Both ignore comments go with it. no-var does not fire on an ambient
declaration, and leaving the comment behind trips ban-unused-ignore — which I
only noticed because I ran deno lint on the file before and after.

Tests

deno test -A     ok | 31 passed (408 steps) | 0 failed
deno lint        Checked 1 file, no problems
deno check       clean

The global suite is among those passing, which is the one that actually
exercises globalThis.__interactors.

I left formatting alone: deno fmt --check reports 193 unformatted files out of
238 across the repository, so it is not something this PR should start on, and
CI runs only deno test -A.

Note

Unrelated to #333, which touches only .github/workflows/www.yaml and
www/deno.json. That PR is red because of this same pre-existing failure and
should go green once this lands.

`deno test -A` fails on every pull request:

    TS1540 A 'namespace' declaration should not be declared using the
           'module' keyword. Please use the 'namespace' keyword instead.
      module globalThis {
        at packages/globals/src/globals.ts:48:10

Deno 2.9 bundles TypeScript 6, which turned the deprecated `module X {}`
namespace syntax into an error. The `deno-lint-ignore prefer-namespace-keyword`
sitting above it is a fossil of when it was only a lint warning.

Nesting `module globalThis` inside `declare global` was never doing
anything: `declare global` is already the global scope, so a `var` declared
directly in it augments `globalThis` the same way. Both ignore comments go
with the wrapper — `no-var` does not fire on an ambient declaration, and
`ban-unused-ignore` catches it if it is left behind.

`deno test -A` now passes: 31 tests, 408 steps.
@github-actions

Copy link
Copy Markdown
Contributor

Package Changes Through 33fc0c7

There are 1 changes which include @interactors/core with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@interactors/core 1.0.1 1.0.2
@interactors/keyboard 1.0.1 1.0.2
@interactors/html 1.0.1 1.0.2
@interactors/material-ui 5.0.0 5.0.1

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Deploy Preview Ready!

Improve your UI testing experience and make maintenance easier. Interactors are composable page objects that work across Jest, Cypress, and more.
Improve your UI testing experience and make maintenance easier. Interactors are composable page objects that work across Jest, Cypress, and more.

@taras
taras requested review from cowboyd and jbolda September 30, 2026 13:10
@taras
taras merged commit 19cd03e into main Sep 30, 2026
5 checks passed
@taras
taras deleted the fix/globalthis-namespace branch September 30, 2026 13:26

This branch was successfully deployed

1 active deployment
Preview — 33fc0c7d Deployed Sep 30, 2026 by taras via deploy-preview #36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants