🐛 Declare __interactors without the module keyword - #334
Merged
Merged
Conversation
`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.
Contributor
Package Changes Through 33fc0c7There are 1 changes which include @interactors/core with patch Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
Contributor
|
🚀 Deploy Preview Ready!
|
cowboyd
approved these changes
Sep 30, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
deno test -Afails on every pull request, and onmainitself — the run forthe merge of #332 fails the same way:
Deno 2.9 bundles TypeScript 6, which turned the long-deprecated
module X {}namespace syntax into an error. The// deno-lint-ignore prefer-namespace-keywordsitting directly above it is afossil 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 globalThiswrapper was never doing anything.declare globalisalready the global scope, so a
vardeclared directly inside it augmentsglobalThisexactly the same way. Renamingmoduletonamespacewould alsocompile, but it would keep a level of nesting that has no effect.
Both ignore comments go with it.
no-vardoes not fire on an ambientdeclaration, and leaving the comment behind trips
ban-unused-ignore— which Ionly noticed because I ran
deno linton the file before and after.Tests
The
globalsuite is among those passing, which is the one that actuallyexercises
globalThis.__interactors.I left formatting alone:
deno fmt --checkreports 193 unformatted files out of238 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.yamlandwww/deno.json. That PR is red because of this same pre-existing failure andshould go green once this lands.