the tswhy logo: a question mark in a box

tswhy‽

A community effort to enrich TypeScript diagnostics.

Editing TS1035:

All diagnostics and fixes are authored in markdown. Propose any changes by editing the markdown. Additional fixes can be added. A preview of the rendered diagnostic will update when changes are made.

Once all proposed changes are made, the Propose button will submit the information and confirm raising the PR.

TS1035

Only ambient modules can use quoted names.

When defining a module that can be imported via the module keyword, it must be declared as an ambient module. The following is an error:

module "some-npm-module" {
  export function run();
}

Fix: Use the declare keyword.

Utilize the declare keyword before the module keyword:

declare module "some-npm-module" {
  export function run();
}