Skip to content

fix(no_implicit_declare_namespace_export): skip declare global blocks#1484

Open
SAY-5 wants to merge 1 commit into
denoland:mainfrom
SAY-5:fix/no-implicit-declare-namespace-export-skip-global
Open

fix(no_implicit_declare_namespace_export): skip declare global blocks#1484
SAY-5 wants to merge 1 commit into
denoland:mainfrom
SAY-5:fix/no-implicit-declare-namespace-export-skip-global

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented Apr 15, 2026

Per denoland/deno#33268, the no-implicit-declare-namespace-export rule fires on a top-level declare global { ... } block and tells users to add export {} to suppress it. TypeScript explicitly rejects export {} inside declare global ("Exports and export assignments are not permitted in module augmentations"), so the suggested fix doesn't compile.

Bail out of the rule when the module declaration's global flag is set so the hint is no longer surfaced for these blocks. Add valid-case tests covering declare global { const ... } and declare global { interface Window ... }.

Closes denoland/deno#33268

Per denoland/deno#33268, the rule fires on a top-level `declare global { ... }`
block and tells users to add `export {}` to suppress it. But TypeScript
explicitly rejects `export {}` inside `declare global` ("Exports and
export assignments are not permitted in module augmentations"), so the
suggested fix doesn't compile.

Bail out of the rule when the module declaration's `global` flag is
set so the hint is no longer surfaced for these blocks. Add valid-case
tests covering `declare global { const ... }` and `declare global {
interface Window ... }`.

Closes denoland/deno#33268
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

deno lint - no-implicit-declare-namespace-export error in declare global statement

2 participants